diff --git a/packages/google-cloud-websecurityscanner/.eslintignore b/packages/google-cloud-websecurityscanner/.eslintignore new file mode 100644 index 00000000000..ea5b04aebe6 --- /dev/null +++ b/packages/google-cloud-websecurityscanner/.eslintignore @@ -0,0 +1,7 @@ +**/node_modules +**/coverage +test/fixtures +build/ +docs/ +protos/ +samples/generated/ diff --git a/packages/google-cloud-websecurityscanner/.eslintrc.json b/packages/google-cloud-websecurityscanner/.eslintrc.json new file mode 100644 index 00000000000..78215349546 --- /dev/null +++ b/packages/google-cloud-websecurityscanner/.eslintrc.json @@ -0,0 +1,3 @@ +{ + "extends": "./node_modules/gts" +} diff --git a/packages/google-cloud-websecurityscanner/.gitattributes b/packages/google-cloud-websecurityscanner/.gitattributes new file mode 100644 index 00000000000..33739cb74e4 --- /dev/null +++ b/packages/google-cloud-websecurityscanner/.gitattributes @@ -0,0 +1,4 @@ +*.ts text eol=lf +*.js text eol=lf +protos/* linguist-generated +**/api-extractor.json linguist-language=JSON-with-Comments diff --git a/packages/google-cloud-websecurityscanner/.github/.OwlBot.yaml b/packages/google-cloud-websecurityscanner/.github/.OwlBot.yaml new file mode 100644 index 00000000000..83ee7372c75 --- /dev/null +++ b/packages/google-cloud-websecurityscanner/.github/.OwlBot.yaml @@ -0,0 +1,23 @@ +# Copyright 2021 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +docker: + image: gcr.io/cloud-devrel-public-resources/owlbot-nodejs:latest + +deep-remove-regex: + - /owl-bot-staging + +deep-copy-regex: + - source: /google/cloud/websecurityscanner/(.*)/.*-nodejs/(.*) + dest: /owl-bot-staging/$1/$2 + diff --git a/packages/google-cloud-websecurityscanner/.gitignore b/packages/google-cloud-websecurityscanner/.gitignore new file mode 100644 index 00000000000..5d32b23782f --- /dev/null +++ b/packages/google-cloud-websecurityscanner/.gitignore @@ -0,0 +1,14 @@ +**/*.log +**/node_modules +.coverage +coverage +.nyc_output +docs/ +out/ +build/ +system-test/secrets.js +system-test/*key.json +*.lock +.DS_Store +package-lock.json +__pycache__ diff --git a/packages/google-cloud-websecurityscanner/.jsdoc.js b/packages/google-cloud-websecurityscanner/.jsdoc.js new file mode 100644 index 00000000000..65475a4d9bf --- /dev/null +++ b/packages/google-cloud-websecurityscanner/.jsdoc.js @@ -0,0 +1,55 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + +'use strict'; + +module.exports = { + opts: { + readme: './README.md', + package: './package.json', + template: './node_modules/jsdoc-fresh', + recurse: true, + verbose: true, + destination: './docs/' + }, + plugins: [ + 'plugins/markdown', + 'jsdoc-region-tag' + ], + source: { + excludePattern: '(^|\\/|\\\\)[._]', + include: [ + 'build/src', + 'protos' + ], + includePattern: '\\.js$' + }, + templates: { + copyright: 'Copyright 2022 Google LLC', + includeDate: false, + sourceFiles: false, + systemName: '@google-cloud/web-security-scanner', + theme: 'lumen', + default: { + outputSourceFiles: false + } + }, + markdown: { + idInHeadings: true + } +}; diff --git a/packages/google-cloud-websecurityscanner/.mocharc.js b/packages/google-cloud-websecurityscanner/.mocharc.js new file mode 100644 index 00000000000..0b600509bed --- /dev/null +++ b/packages/google-cloud-websecurityscanner/.mocharc.js @@ -0,0 +1,29 @@ +// Copyright 2020 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +const config = { + "enable-source-maps": true, + "throw-deprecation": true, + "timeout": 10000, + "recursive": true +} +if (process.env.MOCHA_THROW_DEPRECATION === 'false') { + delete config['throw-deprecation']; +} +if (process.env.MOCHA_REPORTER) { + config.reporter = process.env.MOCHA_REPORTER; +} +if (process.env.MOCHA_REPORTER_OUTPUT) { + config['reporter-option'] = `output=${process.env.MOCHA_REPORTER_OUTPUT}`; +} +module.exports = config diff --git a/packages/google-cloud-websecurityscanner/.nycrc b/packages/google-cloud-websecurityscanner/.nycrc new file mode 100644 index 00000000000..b18d5472b62 --- /dev/null +++ b/packages/google-cloud-websecurityscanner/.nycrc @@ -0,0 +1,24 @@ +{ + "report-dir": "./.coverage", + "reporter": ["text", "lcov"], + "exclude": [ + "**/*-test", + "**/.coverage", + "**/apis", + "**/benchmark", + "**/conformance", + "**/docs", + "**/samples", + "**/scripts", + "**/protos", + "**/test", + "**/*.d.ts", + ".jsdoc.js", + "**/.jsdoc.js", + "karma.conf.js", + "webpack-tests.config.js", + "webpack.config.js" + ], + "exclude-after-remap": false, + "all": true +} diff --git a/packages/google-cloud-websecurityscanner/.prettierignore b/packages/google-cloud-websecurityscanner/.prettierignore new file mode 100644 index 00000000000..9340ad9b86d --- /dev/null +++ b/packages/google-cloud-websecurityscanner/.prettierignore @@ -0,0 +1,6 @@ +**/node_modules +**/coverage +test/fixtures +build/ +docs/ +protos/ diff --git a/packages/google-cloud-websecurityscanner/.prettierrc.js b/packages/google-cloud-websecurityscanner/.prettierrc.js new file mode 100644 index 00000000000..d1b95106f4c --- /dev/null +++ b/packages/google-cloud-websecurityscanner/.prettierrc.js @@ -0,0 +1,17 @@ +// Copyright 2020 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +module.exports = { + ...require('gts/.prettierrc.json') +} diff --git a/packages/google-cloud-websecurityscanner/.repo-metadata.json b/packages/google-cloud-websecurityscanner/.repo-metadata.json new file mode 100644 index 00000000000..d1c0542e290 --- /dev/null +++ b/packages/google-cloud-websecurityscanner/.repo-metadata.json @@ -0,0 +1,16 @@ +{ + "client_documentation": "https://cloud.google.com/nodejs/docs/reference/web-security-scanner/latest", + "api_id": "websecurityscanner.googleapis.com", + "distribution_name": "@google-cloud/web-security-scanner", + "release_level": "stable", + "default_version": "v1beta", + "language": "nodejs", + "name_pretty": "Web Security Scanner", + "repo": "googleapis/nodejs-web-security-scanner", + "product_documentation": "https://cloud.google.com/security-scanner/", + "requires_billing": true, + "name": "websecurityscanner", + "issue_tracker": "https://github.com/googleapis/nodejs-web-security-scanner/issues", + "api_shortname": "websecurityscanner", + "library_type": "GAPIC_AUTO" +} diff --git a/packages/google-cloud-websecurityscanner/CHANGELOG.md b/packages/google-cloud-websecurityscanner/CHANGELOG.md new file mode 100644 index 00000000000..43a61153e78 --- /dev/null +++ b/packages/google-cloud-websecurityscanner/CHANGELOG.md @@ -0,0 +1,122 @@ +# Changelog + +## [2.1.3](https://github.com/googleapis/nodejs-web-security-scanner/compare/v2.1.2...v2.1.3) (2022-11-10) + + +### Bug Fixes + +* **deps:** Use google-gax v3.5.2 ([#148](https://github.com/googleapis/nodejs-web-security-scanner/issues/148)) ([6f6cf70](https://github.com/googleapis/nodejs-web-security-scanner/commit/6f6cf7089280129b7d8c8acd2acbeee5388da598)) +* Preserve default values in x-goog-request-params header ([#140](https://github.com/googleapis/nodejs-web-security-scanner/issues/140)) ([e16d06d](https://github.com/googleapis/nodejs-web-security-scanner/commit/e16d06d8e4ea03eee1eb3feddc57b3bc95678728)) +* Regenerated protos JS and TS definitions ([#151](https://github.com/googleapis/nodejs-web-security-scanner/issues/151)) ([7a6395a](https://github.com/googleapis/nodejs-web-security-scanner/commit/7a6395aedcad3a87738e6c38bc5880d66dc99e0c)) + +## [2.1.2](https://github.com/googleapis/nodejs-web-security-scanner/compare/v2.1.1...v2.1.2) (2022-08-27) + + +### Bug Fixes + +* do not import the whole google-gax from proto JS ([#1553](https://github.com/googleapis/nodejs-web-security-scanner/issues/1553)) ([#139](https://github.com/googleapis/nodejs-web-security-scanner/issues/139)) ([4ff7015](https://github.com/googleapis/nodejs-web-security-scanner/commit/4ff701583b66f1f7f80b9c9ab2b2445549a6c81f)) +* use google-gax v3.3.0 ([4ff7015](https://github.com/googleapis/nodejs-web-security-scanner/commit/4ff701583b66f1f7f80b9c9ab2b2445549a6c81f)) + +## [2.1.1](https://github.com/googleapis/nodejs-web-security-scanner/compare/v2.1.0...v2.1.1) (2022-08-23) + + +### Bug Fixes + +* better support for fallback mode ([#135](https://github.com/googleapis/nodejs-web-security-scanner/issues/135)) ([9b70cc5](https://github.com/googleapis/nodejs-web-security-scanner/commit/9b70cc5a238bdf595a0dd05244662e60156de8d1)) +* change import long to require ([#136](https://github.com/googleapis/nodejs-web-security-scanner/issues/136)) ([f9e6d50](https://github.com/googleapis/nodejs-web-security-scanner/commit/f9e6d502b1b5c7e47e349dc8569d61853524c519)) +* remove pip install statements ([#1546](https://github.com/googleapis/nodejs-web-security-scanner/issues/1546)) ([#138](https://github.com/googleapis/nodejs-web-security-scanner/issues/138)) ([00a8d54](https://github.com/googleapis/nodejs-web-security-scanner/commit/00a8d549df6e346b202e8ea674642769a08cead5)) + +## [2.1.0](https://github.com/googleapis/nodejs-web-security-scanner/compare/v2.0.0...v2.1.0) (2022-06-29) + + +### Features + +* support regapic LRO ([#129](https://github.com/googleapis/nodejs-web-security-scanner/issues/129)) ([bc9ba59](https://github.com/googleapis/nodejs-web-security-scanner/commit/bc9ba59369cf1945d1352076c01a2139e8d3c1ce)) + +## [2.0.0](https://github.com/googleapis/nodejs-web-security-scanner/compare/v1.1.1...v2.0.0) (2022-05-19) + + +### ⚠ BREAKING CHANGES + +* update library to use Node 12 (#124) + +### Build System + +* update library to use Node 12 ([#124](https://github.com/googleapis/nodejs-web-security-scanner/issues/124)) ([f6f6886](https://github.com/googleapis/nodejs-web-security-scanner/commit/f6f6886ac002dbc95b248bdab22c6d6f1fa28ba2)) + +### [1.1.1](https://www.github.com/googleapis/nodejs-web-security-scanner/compare/v1.1.0...v1.1.1) (2021-09-09) + + +### Bug Fixes + +* **build:** migrate to using main branch ([#77](https://www.github.com/googleapis/nodejs-web-security-scanner/issues/77)) ([caf7a6c](https://www.github.com/googleapis/nodejs-web-security-scanner/commit/caf7a6c7b28c5bc2346edbf5051c991c9ee8f62e)) + +## [1.1.0](https://www.github.com/googleapis/nodejs-web-security-scanner/compare/v1.0.7...v1.1.0) (2021-08-23) + + +### Features + +* turns on self-signed JWT feature flag ([#74](https://www.github.com/googleapis/nodejs-web-security-scanner/issues/74)) ([f806cd5](https://www.github.com/googleapis/nodejs-web-security-scanner/commit/f806cd5c38d8a04927fb3b57199cd425d5beb9b3)) + +### [1.0.7](https://www.github.com/googleapis/nodejs-web-security-scanner/compare/v1.0.6...v1.0.7) (2021-08-17) + + +### Bug Fixes + +* **deps:** google-gax v2.24.1 ([#72](https://www.github.com/googleapis/nodejs-web-security-scanner/issues/72)) ([3821eed](https://www.github.com/googleapis/nodejs-web-security-scanner/commit/3821eed56dc35cd476ce8042cdb18792cd9f0821)) + +### [1.0.6](https://www.github.com/googleapis/nodejs-web-security-scanner/compare/v1.0.5...v1.0.6) (2021-07-16) + + +### Bug Fixes + +* Updating WORKSPACE files to use the newest version of the Typescript generator. ([#64](https://www.github.com/googleapis/nodejs-web-security-scanner/issues/64)) ([d22bb5d](https://www.github.com/googleapis/nodejs-web-security-scanner/commit/d22bb5d52449ee2329f603d2b7c5667e4a74a7f6)) + +### [1.0.5](https://www.github.com/googleapis/nodejs-web-security-scanner/compare/v1.0.4...v1.0.5) (2021-07-12) + + +### Bug Fixes + +* **deps:** google-gax v2.17.1 ([#62](https://www.github.com/googleapis/nodejs-web-security-scanner/issues/62)) ([8dd2c22](https://www.github.com/googleapis/nodejs-web-security-scanner/commit/8dd2c2291b9cec0d3d2e0af39f44768293037d5c)) + +### [1.0.4](https://www.github.com/googleapis/nodejs-web-security-scanner/compare/v1.0.3...v1.0.4) (2021-06-29) + + +### Bug Fixes + +* **deps:** google-gax v2.17.0 with mTLS ([#59](https://www.github.com/googleapis/nodejs-web-security-scanner/issues/59)) ([8ea4607](https://www.github.com/googleapis/nodejs-web-security-scanner/commit/8ea4607ee57ab7e876ec2d16a9e32f83b600a5e1)) + +### [1.0.3](https://www.github.com/googleapis/nodejs-web-security-scanner/compare/v1.0.2...v1.0.3) (2021-06-23) + + +### Bug Fixes + +* make request optional in all cases ([#55](https://www.github.com/googleapis/nodejs-web-security-scanner/issues/55)) ([c6dfc29](https://www.github.com/googleapis/nodejs-web-security-scanner/commit/c6dfc29bf8f9f69f5a94319bb2f3410e7a782e3d)) + +### [1.0.2](https://www.github.com/googleapis/nodejs-web-security-scanner/compare/v1.0.1...v1.0.2) (2021-05-25) + + +### Bug Fixes + +* GoogleAdsError missing using generator version after 1.3.0 ([#46](https://www.github.com/googleapis/nodejs-web-security-scanner/issues/46)) ([4d97ddc](https://www.github.com/googleapis/nodejs-web-security-scanner/commit/4d97ddc5340c337c6c80bf6c098e0f9a10f26297)) + +### [1.0.1](https://www.github.com/googleapis/nodejs-web-security-scanner/compare/v1.0.0...v1.0.1) (2021-05-12) + + +### Bug Fixes + +* **deps:** require google-gax v2.12.0 ([#38](https://www.github.com/googleapis/nodejs-web-security-scanner/issues/38)) ([5c32ea0](https://www.github.com/googleapis/nodejs-web-security-scanner/commit/5c32ea032303cd9a5276fd1ccff6a04232541ccd)) +* use require() to load JSON protos ([#41](https://www.github.com/googleapis/nodejs-web-security-scanner/issues/41)) ([0e4c54a](https://www.github.com/googleapis/nodejs-web-security-scanner/commit/0e4c54a70ad84df105b9bd9b94078d2d7d2bd43c)) + +## 1.0.0 (2020-12-12) + + +### ⚠ BREAKING CHANGES + +* write initial samples (#2) +* initial stub of library + +### Features + +* initial stub of library ([5e79020](https://www.github.com/googleapis/nodejs-web-security-scanner/commit/5e79020df9274bb946122bc87494c4fb037cacfc)) +* write initial samples ([#2](https://www.github.com/googleapis/nodejs-web-security-scanner/issues/2)) ([f1e575b](https://www.github.com/googleapis/nodejs-web-security-scanner/commit/f1e575bcac6ab0223e8de3cefee70bb8699ee98d)) diff --git a/packages/google-cloud-websecurityscanner/CODE_OF_CONDUCT.md b/packages/google-cloud-websecurityscanner/CODE_OF_CONDUCT.md new file mode 100644 index 00000000000..2add2547a81 --- /dev/null +++ b/packages/google-cloud-websecurityscanner/CODE_OF_CONDUCT.md @@ -0,0 +1,94 @@ + +# Code of Conduct + +## Our Pledge + +In the interest of fostering an open and welcoming environment, we as +contributors and maintainers pledge to making participation in our project and +our community a harassment-free experience for everyone, regardless of age, body +size, disability, ethnicity, gender identity and expression, level of +experience, education, socio-economic status, nationality, personal appearance, +race, religion, or sexual identity and orientation. + +## Our Standards + +Examples of behavior that contributes to creating a positive environment +include: + +* Using welcoming and inclusive language +* Being respectful of differing viewpoints and experiences +* Gracefully accepting constructive criticism +* Focusing on what is best for the community +* Showing empathy towards other community members + +Examples of unacceptable behavior by participants include: + +* The use of sexualized language or imagery and unwelcome sexual attention or + advances +* Trolling, insulting/derogatory comments, and personal or political attacks +* Public or private harassment +* Publishing others' private information, such as a physical or electronic + address, without explicit permission +* Other conduct which could reasonably be considered inappropriate in a + professional setting + +## Our Responsibilities + +Project maintainers are responsible for clarifying the standards of acceptable +behavior and are expected to take appropriate and fair corrective action in +response to any instances of unacceptable behavior. + +Project maintainers have the right and responsibility to remove, edit, or reject +comments, commits, code, wiki edits, issues, and other contributions that are +not aligned to this Code of Conduct, or to ban temporarily or permanently any +contributor for other behaviors that they deem inappropriate, threatening, +offensive, or harmful. + +## Scope + +This Code of Conduct applies both within project spaces and in public spaces +when an individual is representing the project or its community. Examples of +representing a project or community include using an official project e-mail +address, posting via an official social media account, or acting as an appointed +representative at an online or offline event. Representation of a project may be +further defined and clarified by project maintainers. + +This Code of Conduct also applies outside the project spaces when the Project +Steward has a reasonable belief that an individual's behavior may have a +negative impact on the project or its community. + +## Conflict Resolution + +We do not believe that all conflict is bad; healthy debate and disagreement +often yield positive results. However, it is never okay to be disrespectful or +to engage in behavior that violates the project’s code of conduct. + +If you see someone violating the code of conduct, you are encouraged to address +the behavior directly with those involved. Many issues can be resolved quickly +and easily, and this gives people more control over the outcome of their +dispute. If you are unable to resolve the matter for any reason, or if the +behavior is threatening or harassing, report it. We are dedicated to providing +an environment where participants feel welcome and safe. + +Reports should be directed to *googleapis-stewards@google.com*, the +Project Steward(s) for *Google Cloud Client Libraries*. It is the Project Steward’s duty to +receive and address reported violations of the code of conduct. They will then +work with a committee consisting of representatives from the Open Source +Programs Office and the Google Open Source Strategy team. If for any reason you +are uncomfortable reaching out to the Project Steward, please email +opensource@google.com. + +We will investigate every complaint, but you may not receive a direct response. +We will use our discretion in determining when and how to follow up on reported +incidents, which may range from not taking action to permanent expulsion from +the project and project-sponsored spaces. We will notify the accused of the +report and provide them an opportunity to discuss it before any action is taken. +The identity of the reporter will be omitted from the details of the report +supplied to the accused. In potentially harmful situations, such as ongoing +harassment or threats to anyone's safety, we may take action without notice. + +## Attribution + +This Code of Conduct is adapted from the Contributor Covenant, version 1.4, +available at +https://www.contributor-covenant.org/version/1/4/code-of-conduct.html \ No newline at end of file diff --git a/packages/google-cloud-websecurityscanner/CONTRIBUTING.md b/packages/google-cloud-websecurityscanner/CONTRIBUTING.md new file mode 100644 index 00000000000..8403ca655a0 --- /dev/null +++ b/packages/google-cloud-websecurityscanner/CONTRIBUTING.md @@ -0,0 +1,76 @@ +# How to become a contributor and submit your own code + +**Table of contents** + +* [Contributor License Agreements](#contributor-license-agreements) +* [Contributing a patch](#contributing-a-patch) +* [Running the tests](#running-the-tests) +* [Releasing the library](#releasing-the-library) + +## Contributor License Agreements + +We'd love to accept your sample apps and patches! Before we can take them, we +have to jump a couple of legal hurdles. + +Please fill out either the individual or corporate Contributor License Agreement +(CLA). + + * If you are an individual writing original source code and you're sure you + own the intellectual property, then you'll need to sign an [individual CLA](https://developers.google.com/open-source/cla/individual). + * If you work for a company that wants to allow you to contribute your work, + then you'll need to sign a [corporate CLA](https://developers.google.com/open-source/cla/corporate). + +Follow either of the two links above to access the appropriate CLA and +instructions for how to sign and return it. Once we receive it, we'll be able to +accept your pull requests. + +## Contributing A Patch + +1. Submit an issue describing your proposed change to the repo in question. +1. The repo owner will respond to your issue promptly. +1. If your proposed change is accepted, and you haven't already done so, sign a + Contributor License Agreement (see details above). +1. Fork the desired repo, develop and test your code changes. +1. Ensure that your code adheres to the existing style in the code to which + you are contributing. +1. Ensure that your code has an appropriate set of tests which all pass. +1. Title your pull request following [Conventional Commits](https://www.conventionalcommits.org/) styling. +1. Submit a pull request. + +### Before you begin + +1. [Select or create a Cloud Platform project][projects]. +1. [Enable billing for your project][billing]. +1. [Enable the Web Security Scanner API][enable_api]. +1. [Set up authentication with a service account][auth] so you can access the + API from your local workstation. + + +## Running the tests + +1. [Prepare your environment for Node.js setup][setup]. + +1. Install dependencies: + + npm install + +1. Run the tests: + + # Run unit tests. + npm test + + # Run sample integration tests. + npm run samples-test + + # Run all system tests. + npm run system-test + +1. Lint (and maybe fix) any changes: + + npm run fix + +[setup]: https://cloud.google.com/nodejs/docs/setup +[projects]: https://console.cloud.google.com/project +[billing]: https://support.google.com/cloud/answer/6293499#enable-billing +[enable_api]: https://console.cloud.google.com/flows/enableapi?apiid=websecurityscanner.googleapis.com +[auth]: https://cloud.google.com/docs/authentication/getting-started \ No newline at end of file diff --git a/packages/google-cloud-websecurityscanner/LICENSE b/packages/google-cloud-websecurityscanner/LICENSE new file mode 100644 index 00000000000..d6456956733 --- /dev/null +++ b/packages/google-cloud-websecurityscanner/LICENSE @@ -0,0 +1,202 @@ + + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright [yyyy] [name of copyright owner] + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. diff --git a/packages/google-cloud-websecurityscanner/README.md b/packages/google-cloud-websecurityscanner/README.md new file mode 100644 index 00000000000..f8b9be08c6b --- /dev/null +++ b/packages/google-cloud-websecurityscanner/README.md @@ -0,0 +1,164 @@ +[//]: # "This README.md file is auto-generated, all changes to this file will be lost." +[//]: # "To regenerate it, use `python -m synthtool`." +Google Cloud Platform logo + +# [Web Security Scanner: Node.js Client](https://github.com/googleapis/nodejs-web-security-scanner) + +[![release level](https://img.shields.io/badge/release%20level-stable-brightgreen.svg?style=flat)](https://cloud.google.com/terms/launch-stages) +[![npm version](https://img.shields.io/npm/v/@google-cloud/web-security-scanner.svg)](https://www.npmjs.org/package/@google-cloud/web-security-scanner) + + + + +Websecurityscanner client for Node.js + + +A comprehensive list of changes in each version may be found in +[the CHANGELOG](https://github.com/googleapis/nodejs-web-security-scanner/blob/main/CHANGELOG.md). + +* [Web Security Scanner Node.js Client API Reference][client-docs] +* [Web Security Scanner Documentation][product-docs] +* [github.com/googleapis/nodejs-web-security-scanner](https://github.com/googleapis/nodejs-web-security-scanner) + +Read more about the client libraries for Cloud APIs, including the older +Google APIs Client Libraries, in [Client Libraries Explained][explained]. + +[explained]: https://cloud.google.com/apis/docs/client-libraries-explained + +**Table of contents:** + + +* [Quickstart](#quickstart) + * [Before you begin](#before-you-begin) + * [Installing the client library](#installing-the-client-library) + * [Using the client library](#using-the-client-library) +* [Samples](#samples) +* [Versioning](#versioning) +* [Contributing](#contributing) +* [License](#license) + +## Quickstart + +### Before you begin + +1. [Select or create a Cloud Platform project][projects]. +1. [Enable billing for your project][billing]. +1. [Enable the Web Security Scanner API][enable_api]. +1. [Set up authentication with a service account][auth] so you can access the + API from your local workstation. + +### Installing the client library + +```bash +npm install @google-cloud/web-security-scanner +``` + + +### Using the client library + +```javascript +// Imports the Google Cloud client library + +// remove this line after package is released +// eslint-disable-next-line node/no-missing-require +const { + WebSecurityScannerClient, +} = require('@google-cloud/web-security-scanner'); + +// TODO(developer): replace with your prefered project ID. +// const projectId = 'my-project' + +// Creates a client +// eslint-disable-next-line no-unused-vars +const client = new WebSecurityScannerClient(); + +//TODO(library generator): write the actual function you will be testing +async function listConfigs() { + const stats = await client.listScanConfigs({ + parent: `projects/${projectId}`, + }); + console.info(stats); +} +listConfigs(); + +``` + + + +## Samples + +Samples are in the [`samples/`](https://github.com/googleapis/nodejs-web-security-scanner/tree/main/samples) directory. Each sample's `README.md` has instructions for running its sample. + +| Sample | Source Code | Try it | +| --------------------------- | --------------------------------- | ------ | +| Quickstart | [source code](https://github.com/googleapis/nodejs-web-security-scanner/blob/main/samples/quickstart.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-web-security-scanner&page=editor&open_in_editor=samples/quickstart.js,samples/README.md) | + + + +The [Web Security Scanner Node.js Client API Reference][client-docs] documentation +also contains samples. + +## Supported Node.js Versions + +Our client libraries follow the [Node.js release schedule](https://nodejs.org/en/about/releases/). +Libraries are compatible with all current _active_ and _maintenance_ versions of +Node.js. +If you are using an end-of-life version of Node.js, we recommend that you update +as soon as possible to an actively supported LTS version. + +Google's client libraries support legacy versions of Node.js runtimes on a +best-efforts basis with the following warnings: + +* Legacy versions are not tested in continuous integration. +* Some security patches and features cannot be backported. +* Dependencies cannot be kept up-to-date. + +Client libraries targeting some end-of-life versions of Node.js are available, and +can be installed through npm [dist-tags](https://docs.npmjs.com/cli/dist-tag). +The dist-tags follow the naming convention `legacy-(version)`. +For example, `npm install @google-cloud/web-security-scanner@legacy-8` installs client libraries +for versions compatible with Node.js 8. + +## Versioning + +This library follows [Semantic Versioning](http://semver.org/). + + + +This library is considered to be **stable**. The code surface will not change in backwards-incompatible ways +unless absolutely necessary (e.g. because of critical security issues) or with +an extensive deprecation period. Issues and requests against **stable** libraries +are addressed with the highest priority. + + + + + + +More Information: [Google Cloud Platform Launch Stages][launch_stages] + +[launch_stages]: https://cloud.google.com/terms/launch-stages + +## Contributing + +Contributions welcome! See the [Contributing Guide](https://github.com/googleapis/nodejs-web-security-scanner/blob/main/CONTRIBUTING.md). + +Please note that this `README.md`, the `samples/README.md`, +and a variety of configuration files in this repository (including `.nycrc` and `tsconfig.json`) +are generated from a central template. To edit one of these files, make an edit +to its templates in +[directory](https://github.com/googleapis/synthtool). + +## License + +Apache Version 2.0 + +See [LICENSE](https://github.com/googleapis/nodejs-web-security-scanner/blob/main/LICENSE) + +[client-docs]: https://cloud.google.com/nodejs/docs/reference/web-security-scanner/latest +[product-docs]: https://cloud.google.com/security-scanner/ +[shell_img]: https://gstatic.com/cloudssh/images/open-btn.png +[projects]: https://console.cloud.google.com/project +[billing]: https://support.google.com/cloud/answer/6293499#enable-billing +[enable_api]: https://console.cloud.google.com/flows/enableapi?apiid=websecurityscanner.googleapis.com +[auth]: https://cloud.google.com/docs/authentication/getting-started diff --git a/packages/google-cloud-websecurityscanner/linkinator.config.json b/packages/google-cloud-websecurityscanner/linkinator.config.json new file mode 100644 index 00000000000..befd23c8633 --- /dev/null +++ b/packages/google-cloud-websecurityscanner/linkinator.config.json @@ -0,0 +1,16 @@ +{ + "recurse": true, + "skip": [ + "https://codecov.io/gh/googleapis/", + "www.googleapis.com", + "img.shields.io", + "https://console.cloud.google.com/cloudshell", + "https://support.google.com" + ], + "silent": true, + "concurrency": 5, + "retry": true, + "retryErrors": true, + "retryErrorsCount": 5, + "retryErrorsJitter": 3000 +} diff --git a/packages/google-cloud-websecurityscanner/package.json b/packages/google-cloud-websecurityscanner/package.json new file mode 100644 index 00000000000..9eda94c01ef --- /dev/null +++ b/packages/google-cloud-websecurityscanner/package.json @@ -0,0 +1,66 @@ +{ + "name": "@google-cloud/web-security-scanner", + "version": "2.1.3", + "description": "Websecurityscanner client for Node.js", + "repository": "googleapis/nodejs-web-security-scanner", + "license": "Apache-2.0", + "author": "Google LLC", + "main": "build/src/index.js", + "files": [ + "build/src", + "build/protos" + ], + "keywords": [ + "google apis client", + "google api client", + "google apis", + "google api", + "google", + "google cloud platform", + "google cloud", + "cloud", + "google websecurityscanner", + "websecurityscanner", + "web security scanner" + ], + "scripts": { + "clean": "gts clean", + "compile": "tsc -p . && cp -r protos build/", + "compile-protos": "compileProtos src", + "docs": "jsdoc -c .jsdoc.js", + "predocs-test": "npm run docs", + "docs-test": "linkinator docs", + "fix": "gts fix", + "lint": "gts check", + "prepare": "npm run compile-protos && npm run compile", + "system-test": "c8 mocha build/system-test", + "test": "c8 mocha build/test", + "samples-test": "cd samples/ && npm link ../ && npm test", + "prelint": "cd samples; npm link ../; npm i" + }, + "dependencies": { + "google-gax": "^3.5.2" + }, + "devDependencies": { + "@types/mocha": "^9.0.0", + "@types/node": "^18.0.0", + "@types/sinon": "^10.0.0", + "c8": "^7.3.5", + "gts": "^3.1.0", + "jsdoc": "^4.0.0", + "jsdoc-fresh": "^2.0.0", + "jsdoc-region-tag": "^2.0.0", + "linkinator": "^4.0.0", + "mocha": "^9.2.2", + "null-loader": "^4.0.1", + "pack-n-play": "^1.0.0-2", + "sinon": "^14.0.0", + "ts-loader": "^9.0.0", + "typescript": "^4.6.4", + "webpack": "^5.9.0", + "webpack-cli": "^4.2.0" + }, + "engines": { + "node": ">=12.0.0" + } +} diff --git a/packages/google-cloud-websecurityscanner/protos/google/cloud/websecurityscanner/v1/crawled_url.proto b/packages/google-cloud-websecurityscanner/protos/google/cloud/websecurityscanner/v1/crawled_url.proto new file mode 100644 index 00000000000..65fc000ffc4 --- /dev/null +++ b/packages/google-cloud-websecurityscanner/protos/google/cloud/websecurityscanner/v1/crawled_url.proto @@ -0,0 +1,40 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +syntax = "proto3"; + +package google.cloud.websecurityscanner.v1; + +option csharp_namespace = "Google.Cloud.WebSecurityScanner.V1"; +option go_package = "google.golang.org/genproto/googleapis/cloud/websecurityscanner/v1;websecurityscanner"; +option java_multiple_files = true; +option java_outer_classname = "CrawledUrlProto"; +option java_package = "com.google.cloud.websecurityscanner.v1"; +option php_namespace = "Google\\Cloud\\WebSecurityScanner\\V1"; +option ruby_package = "Google::Cloud::WebSecurityScanner::V1"; + +// A CrawledUrl resource represents a URL that was crawled during a ScanRun. Web +// Security Scanner Service crawls the web applications, following all links +// within the scope of sites, to find the URLs to test against. +message CrawledUrl { + // Output only. The http method of the request that was used to visit the URL, in + // uppercase. + string http_method = 1; + + // Output only. The URL that was crawled. + string url = 2; + + // Output only. The body of the request that was used to visit the URL. + string body = 3; +} diff --git a/packages/google-cloud-websecurityscanner/protos/google/cloud/websecurityscanner/v1/finding.proto b/packages/google-cloud-websecurityscanner/protos/google/cloud/websecurityscanner/v1/finding.proto new file mode 100644 index 00000000000..71fea950193 --- /dev/null +++ b/packages/google-cloud-websecurityscanner/protos/google/cloud/websecurityscanner/v1/finding.proto @@ -0,0 +1,122 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +syntax = "proto3"; + +package google.cloud.websecurityscanner.v1; + +import "google/api/field_behavior.proto"; +import "google/api/resource.proto"; +import "google/cloud/websecurityscanner/v1/finding_addon.proto"; + +option csharp_namespace = "Google.Cloud.WebSecurityScanner.V1"; +option go_package = "google.golang.org/genproto/googleapis/cloud/websecurityscanner/v1;websecurityscanner"; +option java_multiple_files = true; +option java_outer_classname = "FindingProto"; +option java_package = "com.google.cloud.websecurityscanner.v1"; +option php_namespace = "Google\\Cloud\\WebSecurityScanner\\V1"; +option ruby_package = "Google::Cloud::WebSecurityScanner::V1"; + +// A Finding resource represents a vulnerability instance identified during a +// ScanRun. +message Finding { + option (google.api.resource) = { + type: "websecurityscanner.googleapis.com/Finding" + pattern: "projects/{project}/scanConfigs/{scan_config}/scanRuns/{scan_run}/findings/{finding}" + }; + + // The severity level of a vulnerability. + enum Severity { + // No severity specified. The default value. + SEVERITY_UNSPECIFIED = 0; + + // Critical severity. + CRITICAL = 1; + + // High severity. + HIGH = 2; + + // Medium severity. + MEDIUM = 3; + + // Low severity. + LOW = 4; + } + + // Output only. The resource name of the Finding. The name follows the format of + // 'projects/{projectId}/scanConfigs/{scanConfigId}/scanruns/{scanRunId}/findings/{findingId}'. + // The finding IDs are generated by the system. + string name = 1; + + // Output only. The type of the Finding. + // Detailed and up-to-date information on findings can be found here: + // https://cloud.google.com/security-command-center/docs/how-to-remediate-web-security-scanner-findings + string finding_type = 2; + + // Output only. The severity level of the reported vulnerability. + Severity severity = 17 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The http method of the request that triggered the vulnerability, in + // uppercase. + string http_method = 3; + + // Output only. The URL produced by the server-side fuzzer and used in the request that + // triggered the vulnerability. + string fuzzed_url = 4; + + // Output only. The body of the request that triggered the vulnerability. + string body = 5; + + // Output only. The description of the vulnerability. + string description = 6; + + // Output only. The URL containing human-readable payload that user can leverage to + // reproduce the vulnerability. + string reproduction_url = 7; + + // Output only. If the vulnerability was originated from nested IFrame, the immediate + // parent IFrame is reported. + string frame_url = 8; + + // Output only. The URL where the browser lands when the vulnerability is detected. + string final_url = 9; + + // Output only. The tracking ID uniquely identifies a vulnerability instance across + // multiple ScanRuns. + string tracking_id = 10; + + // Output only. An addon containing information reported for a vulnerability with an HTML + // form, if any. + Form form = 16; + + // Output only. An addon containing information about outdated libraries. + OutdatedLibrary outdated_library = 11; + + // Output only. An addon containing detailed information regarding any resource causing the + // vulnerability such as JavaScript sources, image, audio files, etc. + ViolatingResource violating_resource = 12; + + // Output only. An addon containing information about vulnerable or missing HTTP headers. + VulnerableHeaders vulnerable_headers = 15; + + // Output only. An addon containing information about request parameters which were found + // to be vulnerable. + VulnerableParameters vulnerable_parameters = 13; + + // Output only. An addon containing information reported for an XSS, if any. + Xss xss = 14; + + // Output only. An addon containing information reported for an XXE, if any. + Xxe xxe = 18 [(google.api.field_behavior) = OUTPUT_ONLY]; +} diff --git a/packages/google-cloud-websecurityscanner/protos/google/cloud/websecurityscanner/v1/finding_addon.proto b/packages/google-cloud-websecurityscanner/protos/google/cloud/websecurityscanner/v1/finding_addon.proto new file mode 100644 index 00000000000..1bcec8c716f --- /dev/null +++ b/packages/google-cloud-websecurityscanner/protos/google/cloud/websecurityscanner/v1/finding_addon.proto @@ -0,0 +1,166 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +syntax = "proto3"; + +package google.cloud.websecurityscanner.v1; + +option csharp_namespace = "Google.Cloud.WebSecurityScanner.V1"; +option go_package = "google.golang.org/genproto/googleapis/cloud/websecurityscanner/v1;websecurityscanner"; +option java_multiple_files = true; +option java_outer_classname = "FindingAddonProto"; +option java_package = "com.google.cloud.websecurityscanner.v1"; +option php_namespace = "Google\\Cloud\\WebSecurityScanner\\V1"; +option ruby_package = "Google::Cloud::WebSecurityScanner::V1"; + +// ! Information about a vulnerability with an HTML. +message Form { + // ! The URI where to send the form when it's submitted. + string action_uri = 1; + + // ! The names of form fields related to the vulnerability. + repeated string fields = 2; +} + +// Information reported for an outdated library. +message OutdatedLibrary { + // The name of the outdated library. + string library_name = 1; + + // The version number. + string version = 2; + + // URLs to learn more information about the vulnerabilities in the library. + repeated string learn_more_urls = 3; +} + +// Information regarding any resource causing the vulnerability such +// as JavaScript sources, image, audio files, etc. +message ViolatingResource { + // The MIME type of this resource. + string content_type = 1; + + // URL of this violating resource. + string resource_url = 2; +} + +// Information about vulnerable request parameters. +message VulnerableParameters { + // The vulnerable parameter names. + repeated string parameter_names = 1; +} + +// Information about vulnerable or missing HTTP Headers. +message VulnerableHeaders { + // Describes a HTTP Header. + message Header { + // Header name. + string name = 1; + + // Header value. + string value = 2; + } + + // List of vulnerable headers. + repeated Header headers = 1; + + // List of missing headers. + repeated Header missing_headers = 2; +} + +// Information reported for an XSS. +message Xss { + // Types of XSS attack vector. + enum AttackVector { + // Unknown attack vector. + ATTACK_VECTOR_UNSPECIFIED = 0; + + // The attack comes from fuzzing the browser's localStorage. + LOCAL_STORAGE = 1; + + // The attack comes from fuzzing the browser's sessionStorage. + SESSION_STORAGE = 2; + + // The attack comes from fuzzing the window's name property. + WINDOW_NAME = 3; + + // The attack comes from fuzzing the referrer property. + REFERRER = 4; + + // The attack comes from fuzzing an input element. + FORM_INPUT = 5; + + // The attack comes from fuzzing the browser's cookies. + COOKIE = 6; + + // The attack comes from hijacking the post messaging mechanism. + POST_MESSAGE = 7; + + // The attack comes from fuzzing parameters in the url. + GET_PARAMETERS = 8; + + // The attack comes from fuzzing the fragment in the url. + URL_FRAGMENT = 9; + + // The attack comes from fuzzing the HTML comments. + HTML_COMMENT = 10; + + // The attack comes from fuzzing the POST parameters. + POST_PARAMETERS = 11; + + // The attack comes from fuzzing the protocol. + PROTOCOL = 12; + + // The attack comes from the server side and is stored. + STORED_XSS = 13; + + // The attack is a Same-Origin Method Execution attack via a GET parameter. + SAME_ORIGIN = 14; + + // The attack payload is received from a third-party host via a URL that is + // user-controllable + USER_CONTROLLABLE_URL = 15; + } + + // Stack traces leading to the point where the XSS occurred. + repeated string stack_traces = 1; + + // An error message generated by a javascript breakage. + string error_message = 2; + + // The attack vector of the payload triggering this XSS. + AttackVector attack_vector = 3; + + // The reproduction url for the seeding POST request of a Stored XSS. + string stored_xss_seeding_url = 4; +} + +// Information reported for an XXE. +message Xxe { + // Locations within a request where XML was substituted. + enum Location { + // Unknown Location. + LOCATION_UNSPECIFIED = 0; + + // The XML payload replaced the complete request body. + COMPLETE_REQUEST_BODY = 1; + } + + // The XML string that triggered the XXE vulnerability. Non-payload values + // might be redacted. + string payload_value = 1; + + // Location within the request where the payload was placed. + Location payload_location = 2; +} diff --git a/packages/google-cloud-websecurityscanner/protos/google/cloud/websecurityscanner/v1/finding_type_stats.proto b/packages/google-cloud-websecurityscanner/protos/google/cloud/websecurityscanner/v1/finding_type_stats.proto new file mode 100644 index 00000000000..7999f76d6a7 --- /dev/null +++ b/packages/google-cloud-websecurityscanner/protos/google/cloud/websecurityscanner/v1/finding_type_stats.proto @@ -0,0 +1,35 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +syntax = "proto3"; + +package google.cloud.websecurityscanner.v1; + +option csharp_namespace = "Google.Cloud.WebSecurityScanner.V1"; +option go_package = "google.golang.org/genproto/googleapis/cloud/websecurityscanner/v1;websecurityscanner"; +option java_multiple_files = true; +option java_outer_classname = "FindingTypeStatsProto"; +option java_package = "com.google.cloud.websecurityscanner.v1"; +option php_namespace = "Google\\Cloud\\WebSecurityScanner\\V1"; +option ruby_package = "Google::Cloud::WebSecurityScanner::V1"; + +// A FindingTypeStats resource represents stats regarding a specific FindingType +// of Findings under a given ScanRun. +message FindingTypeStats { + // Output only. The finding type associated with the stats. + string finding_type = 1; + + // Output only. The count of findings belonging to this finding type. + int32 finding_count = 2; +} diff --git a/packages/google-cloud-websecurityscanner/protos/google/cloud/websecurityscanner/v1/scan_config.proto b/packages/google-cloud-websecurityscanner/protos/google/cloud/websecurityscanner/v1/scan_config.proto new file mode 100644 index 00000000000..85641af2fb5 --- /dev/null +++ b/packages/google-cloud-websecurityscanner/protos/google/cloud/websecurityscanner/v1/scan_config.proto @@ -0,0 +1,193 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +syntax = "proto3"; + +package google.cloud.websecurityscanner.v1; + +import "google/api/field_behavior.proto"; +import "google/protobuf/timestamp.proto"; + +option csharp_namespace = "Google.Cloud.WebSecurityScanner.V1"; +option go_package = "google.golang.org/genproto/googleapis/cloud/websecurityscanner/v1;websecurityscanner"; +option java_multiple_files = true; +option java_outer_classname = "ScanConfigProto"; +option java_package = "com.google.cloud.websecurityscanner.v1"; +option php_namespace = "Google\\Cloud\\WebSecurityScanner\\V1"; +option ruby_package = "Google::Cloud::WebSecurityScanner::V1"; + +// A ScanConfig resource contains the configurations to launch a scan. +message ScanConfig { + // Scan authentication configuration. + message Authentication { + // Describes authentication configuration that uses a Google account. + message GoogleAccount { + option deprecated = true; + + // Required. The user name of the Google account. + string username = 1; + + // Required. Input only. The password of the Google account. The credential is stored encrypted + // and not returned in any response nor included in audit logs. + string password = 2; + } + + // Describes authentication configuration that uses a custom account. + message CustomAccount { + // Required. The user name of the custom account. + string username = 1; + + // Required. Input only. The password of the custom account. The credential is stored encrypted + // and not returned in any response nor included in audit logs. + string password = 2; + + // Required. The login form URL of the website. + string login_url = 3; + } + + // Describes authentication configuration for Identity-Aware-Proxy (IAP). + message IapCredential { + // Describes authentication configuration when Web-Security-Scanner + // service account is added in Identity-Aware-Proxy (IAP) access policies. + message IapTestServiceAccountInfo { + // Required. Describes OAuth2 client id of resources protected by + // Identity-Aware-Proxy (IAP). + string target_audience_client_id = 1 [(google.api.field_behavior) = REQUIRED]; + } + + // Identity-Aware-Proxy (IAP) Authentication Configuration + oneof iap_credentials { + // Authentication configuration when Web-Security-Scanner service + // account is added in Identity-Aware-Proxy (IAP) access policies. + IapTestServiceAccountInfo iap_test_service_account_info = 1; + } + } + + // Required. + // Authentication configuration + oneof authentication { + // Authentication using a Google account. + GoogleAccount google_account = 1 [deprecated = true]; + + // Authentication using a custom account. + CustomAccount custom_account = 2; + + // Authentication using Identity-Aware-Proxy (IAP). + IapCredential iap_credential = 4; + } + } + + // Scan schedule configuration. + message Schedule { + // A timestamp indicates when the next run will be scheduled. The value is + // refreshed by the server after each run. If unspecified, it will default + // to current server time, which means the scan will be scheduled to start + // immediately. + google.protobuf.Timestamp schedule_time = 1; + + // Required. The duration of time between executions in days. + int32 interval_duration_days = 2; + } + + // Type of user agents used for scanning. + enum UserAgent { + // The user agent is unknown. Service will default to CHROME_LINUX. + USER_AGENT_UNSPECIFIED = 0; + + // Chrome on Linux. This is the service default if unspecified. + CHROME_LINUX = 1; + + // Chrome on Android. + CHROME_ANDROID = 2; + + // Safari on IPhone. + SAFARI_IPHONE = 3; + } + + // Scan risk levels supported by Web Security Scanner. LOW impact + // scanning will minimize requests with the potential to modify data. To + // achieve the maximum scan coverage, NORMAL risk level is recommended. + enum RiskLevel { + // Use default, which is NORMAL. + RISK_LEVEL_UNSPECIFIED = 0; + + // Normal scanning (Recommended) + NORMAL = 1; + + // Lower impact scanning + LOW = 2; + } + + // Controls export of scan configurations and results to Security + // Command Center. + enum ExportToSecurityCommandCenter { + // Use default, which is ENABLED. + EXPORT_TO_SECURITY_COMMAND_CENTER_UNSPECIFIED = 0; + + // Export results of this scan to Security Command Center. + ENABLED = 1; + + // Do not export results of this scan to Security Command Center. + DISABLED = 2; + } + + // The resource name of the ScanConfig. The name follows the format of + // 'projects/{projectId}/scanConfigs/{scanConfigId}'. The ScanConfig IDs are + // generated by the system. + string name = 1; + + // Required. The user provided display name of the ScanConfig. + string display_name = 2; + + // The maximum QPS during scanning. A valid value ranges from 5 to 20 + // inclusively. If the field is unspecified or its value is set 0, server will + // default to 15. Other values outside of [5, 20] range will be rejected with + // INVALID_ARGUMENT error. + int32 max_qps = 3; + + // Required. The starting URLs from which the scanner finds site pages. + repeated string starting_urls = 4; + + // The authentication configuration. If specified, service will use the + // authentication configuration during scanning. + Authentication authentication = 5; + + // The user agent used during scanning. + UserAgent user_agent = 6; + + // The excluded URL patterns as described in + // https://cloud.google.com/security-command-center/docs/how-to-use-web-security-scanner#excluding_urls + repeated string blacklist_patterns = 7; + + // The schedule of the ScanConfig. + Schedule schedule = 8; + + // Controls export of scan configurations and results to Security + // Command Center. + ExportToSecurityCommandCenter export_to_security_command_center = 10; + + // The risk level selected for the scan + RiskLevel risk_level = 12; + + // Whether the scan config is managed by Web Security Scanner, output + // only. + bool managed_scan = 13; + + // Whether the scan configuration has enabled static IP address scan feature. + // If enabled, the scanner will access applications from static IP addresses. + bool static_ip_scan = 14; + + // Whether to keep scanning even if most requests return HTTP error codes. + bool ignore_http_status_errors = 15; +} diff --git a/packages/google-cloud-websecurityscanner/protos/google/cloud/websecurityscanner/v1/scan_config_error.proto b/packages/google-cloud-websecurityscanner/protos/google/cloud/websecurityscanner/v1/scan_config_error.proto new file mode 100644 index 00000000000..5924f91553d --- /dev/null +++ b/packages/google-cloud-websecurityscanner/protos/google/cloud/websecurityscanner/v1/scan_config_error.proto @@ -0,0 +1,189 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +syntax = "proto3"; + +package google.cloud.websecurityscanner.v1; + +option csharp_namespace = "Google.Cloud.WebSecurityScanner.V1"; +option go_package = "google.golang.org/genproto/googleapis/cloud/websecurityscanner/v1;websecurityscanner"; +option java_multiple_files = true; +option java_outer_classname = "ScanConfigErrorProto"; +option java_package = "com.google.cloud.websecurityscanner.v1"; +option php_namespace = "Google\\Cloud\\WebSecurityScanner\\V1"; +option ruby_package = "Google::Cloud::WebSecurityScanner::V1"; + +// Defines a custom error message used by CreateScanConfig and UpdateScanConfig +// APIs when scan configuration validation fails. It is also reported as part of +// a ScanRunErrorTrace message if scan validation fails due to a scan +// configuration error. +message ScanConfigError { + // Output only. + // Defines an error reason code. + // Next id: 44 + enum Code { + option allow_alias = true; + + // There is no error. + CODE_UNSPECIFIED = 0; + + // There is no error. + OK = 0; + + // Indicates an internal server error. + // Please DO NOT USE THIS ERROR CODE unless the root cause is truly unknown. + INTERNAL_ERROR = 1; + + // One of the seed URLs is an App Engine URL but we cannot validate the scan + // settings due to an App Engine API backend error. + APPENGINE_API_BACKEND_ERROR = 2; + + // One of the seed URLs is an App Engine URL but we cannot access the + // App Engine API to validate scan settings. + APPENGINE_API_NOT_ACCESSIBLE = 3; + + // One of the seed URLs is an App Engine URL but the Default Host of the + // App Engine is not set. + APPENGINE_DEFAULT_HOST_MISSING = 4; + + // Google corporate accounts can not be used for scanning. + CANNOT_USE_GOOGLE_COM_ACCOUNT = 6; + + // The account of the scan creator can not be used for scanning. + CANNOT_USE_OWNER_ACCOUNT = 7; + + // This scan targets Compute Engine, but we cannot validate scan settings + // due to a Compute Engine API backend error. + COMPUTE_API_BACKEND_ERROR = 8; + + // This scan targets Compute Engine, but we cannot access the Compute Engine + // API to validate the scan settings. + COMPUTE_API_NOT_ACCESSIBLE = 9; + + // The Custom Login URL does not belong to the current project. + CUSTOM_LOGIN_URL_DOES_NOT_BELONG_TO_CURRENT_PROJECT = 10; + + // The Custom Login URL is malformed (can not be parsed). + CUSTOM_LOGIN_URL_MALFORMED = 11; + + // The Custom Login URL is mapped to a non-routable IP address in DNS. + CUSTOM_LOGIN_URL_MAPPED_TO_NON_ROUTABLE_ADDRESS = 12; + + // The Custom Login URL is mapped to an IP address which is not reserved for + // the current project. + CUSTOM_LOGIN_URL_MAPPED_TO_UNRESERVED_ADDRESS = 13; + + // The Custom Login URL has a non-routable IP address. + CUSTOM_LOGIN_URL_HAS_NON_ROUTABLE_IP_ADDRESS = 14; + + // The Custom Login URL has an IP address which is not reserved for the + // current project. + CUSTOM_LOGIN_URL_HAS_UNRESERVED_IP_ADDRESS = 15; + + // Another scan with the same name (case-sensitive) already exists. + DUPLICATE_SCAN_NAME = 16; + + // A field is set to an invalid value. + INVALID_FIELD_VALUE = 18; + + // There was an error trying to authenticate to the scan target. + FAILED_TO_AUTHENTICATE_TO_TARGET = 19; + + // Finding type value is not specified in the list findings request. + FINDING_TYPE_UNSPECIFIED = 20; + + // Scan targets Compute Engine, yet current project was not whitelisted for + // Google Compute Engine Scanning Alpha access. + FORBIDDEN_TO_SCAN_COMPUTE = 21; + + // User tries to update managed scan + FORBIDDEN_UPDATE_TO_MANAGED_SCAN = 43; + + // The supplied filter is malformed. For example, it can not be parsed, does + // not have a filter type in expression, or the same filter type appears + // more than once. + MALFORMED_FILTER = 22; + + // The supplied resource name is malformed (can not be parsed). + MALFORMED_RESOURCE_NAME = 23; + + // The current project is not in an active state. + PROJECT_INACTIVE = 24; + + // A required field is not set. + REQUIRED_FIELD = 25; + + // Project id, scanconfig id, scanrun id, or finding id are not consistent + // with each other in resource name. + RESOURCE_NAME_INCONSISTENT = 26; + + // The scan being requested to start is already running. + SCAN_ALREADY_RUNNING = 27; + + // The scan that was requested to be stopped is not running. + SCAN_NOT_RUNNING = 28; + + // One of the seed URLs does not belong to the current project. + SEED_URL_DOES_NOT_BELONG_TO_CURRENT_PROJECT = 29; + + // One of the seed URLs is malformed (can not be parsed). + SEED_URL_MALFORMED = 30; + + // One of the seed URLs is mapped to a non-routable IP address in DNS. + SEED_URL_MAPPED_TO_NON_ROUTABLE_ADDRESS = 31; + + // One of the seed URLs is mapped to an IP address which is not reserved + // for the current project. + SEED_URL_MAPPED_TO_UNRESERVED_ADDRESS = 32; + + // One of the seed URLs has on-routable IP address. + SEED_URL_HAS_NON_ROUTABLE_IP_ADDRESS = 33; + + // One of the seed URLs has an IP address that is not reserved + // for the current project. + SEED_URL_HAS_UNRESERVED_IP_ADDRESS = 35; + + // The Web Security Scanner service account is not configured under the + // project. + SERVICE_ACCOUNT_NOT_CONFIGURED = 36; + + // A project has reached the maximum number of scans. + TOO_MANY_SCANS = 37; + + // Resolving the details of the current project fails. + UNABLE_TO_RESOLVE_PROJECT_INFO = 38; + + // One or more blacklist patterns were in the wrong format. + UNSUPPORTED_BLACKLIST_PATTERN_FORMAT = 39; + + // The supplied filter is not supported. + UNSUPPORTED_FILTER = 40; + + // The supplied finding type is not supported. For example, we do not + // provide findings of the given finding type. + UNSUPPORTED_FINDING_TYPE = 41; + + // The URL scheme of one or more of the supplied URLs is not supported. + UNSUPPORTED_URL_SCHEME = 42; + } + + // Output only. Indicates the reason code for a configuration failure. + Code code = 1; + + // Output only. Indicates the full name of the ScanConfig field that triggers this error, + // for example "scan_config.max_qps". This field is provided for + // troubleshooting purposes only and its actual value can change in the + // future. + string field_name = 2; +} diff --git a/packages/google-cloud-websecurityscanner/protos/google/cloud/websecurityscanner/v1/scan_run.proto b/packages/google-cloud-websecurityscanner/protos/google/cloud/websecurityscanner/v1/scan_run.proto new file mode 100644 index 00000000000..71df3a043ee --- /dev/null +++ b/packages/google-cloud-websecurityscanner/protos/google/cloud/websecurityscanner/v1/scan_run.proto @@ -0,0 +1,110 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +syntax = "proto3"; + +package google.cloud.websecurityscanner.v1; + +import "google/cloud/websecurityscanner/v1/scan_run_error_trace.proto"; +import "google/cloud/websecurityscanner/v1/scan_run_warning_trace.proto"; +import "google/protobuf/timestamp.proto"; + +option csharp_namespace = "Google.Cloud.WebSecurityScanner.V1"; +option go_package = "google.golang.org/genproto/googleapis/cloud/websecurityscanner/v1;websecurityscanner"; +option java_multiple_files = true; +option java_outer_classname = "ScanRunProto"; +option java_package = "com.google.cloud.websecurityscanner.v1"; +option php_namespace = "Google\\Cloud\\WebSecurityScanner\\V1"; +option ruby_package = "Google::Cloud::WebSecurityScanner::V1"; + +// A ScanRun is a output-only resource representing an actual run of the scan. +// Next id: 12 +message ScanRun { + // Types of ScanRun execution state. + enum ExecutionState { + // Represents an invalid state caused by internal server error. This value + // should never be returned. + EXECUTION_STATE_UNSPECIFIED = 0; + + // The scan is waiting in the queue. + QUEUED = 1; + + // The scan is in progress. + SCANNING = 2; + + // The scan is either finished or stopped by user. + FINISHED = 3; + } + + // Types of ScanRun result state. + enum ResultState { + // Default value. This value is returned when the ScanRun is not yet + // finished. + RESULT_STATE_UNSPECIFIED = 0; + + // The scan finished without errors. + SUCCESS = 1; + + // The scan finished with errors. + ERROR = 2; + + // The scan was terminated by user. + KILLED = 3; + } + + // Output only. The resource name of the ScanRun. The name follows the format of + // 'projects/{projectId}/scanConfigs/{scanConfigId}/scanRuns/{scanRunId}'. + // The ScanRun IDs are generated by the system. + string name = 1; + + // Output only. The execution state of the ScanRun. + ExecutionState execution_state = 2; + + // Output only. The result state of the ScanRun. This field is only available after the + // execution state reaches "FINISHED". + ResultState result_state = 3; + + // Output only. The time at which the ScanRun started. + google.protobuf.Timestamp start_time = 4; + + // Output only. The time at which the ScanRun reached termination state - that the ScanRun + // is either finished or stopped by user. + google.protobuf.Timestamp end_time = 5; + + // Output only. The number of URLs crawled during this ScanRun. If the scan is in progress, + // the value represents the number of URLs crawled up to now. + int64 urls_crawled_count = 6; + + // Output only. The number of URLs tested during this ScanRun. If the scan is in progress, + // the value represents the number of URLs tested up to now. The number of + // URLs tested is usually larger than the number URLS crawled because + // typically a crawled URL is tested with multiple test payloads. + int64 urls_tested_count = 7; + + // Output only. Whether the scan run has found any vulnerabilities. + bool has_vulnerabilities = 8; + + // Output only. The percentage of total completion ranging from 0 to 100. + // If the scan is in queue, the value is 0. + // If the scan is running, the value ranges from 0 to 100. + // If the scan is finished, the value is 100. + int32 progress_percent = 9; + + // Output only. If result_state is an ERROR, this field provides the primary reason for + // scan's termination and more details, if such are available. + ScanRunErrorTrace error_trace = 10; + + // Output only. A list of warnings, if such are encountered during this scan run. + repeated ScanRunWarningTrace warning_traces = 11; +} diff --git a/packages/google-cloud-websecurityscanner/protos/google/cloud/websecurityscanner/v1/scan_run_error_trace.proto b/packages/google-cloud-websecurityscanner/protos/google/cloud/websecurityscanner/v1/scan_run_error_trace.proto new file mode 100644 index 00000000000..0c41c14321f --- /dev/null +++ b/packages/google-cloud-websecurityscanner/protos/google/cloud/websecurityscanner/v1/scan_run_error_trace.proto @@ -0,0 +1,75 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +syntax = "proto3"; + +package google.cloud.websecurityscanner.v1; + +import "google/cloud/websecurityscanner/v1/scan_config_error.proto"; + +option csharp_namespace = "Google.Cloud.WebSecurityScanner.V1"; +option go_package = "google.golang.org/genproto/googleapis/cloud/websecurityscanner/v1;websecurityscanner"; +option java_multiple_files = true; +option java_outer_classname = "ScanRunErrorTraceProto"; +option java_package = "com.google.cloud.websecurityscanner.v1"; +option php_namespace = "Google\\Cloud\\WebSecurityScanner\\V1"; +option ruby_package = "Google::Cloud::WebSecurityScanner::V1"; + +// Output only. +// Defines an error trace message for a ScanRun. +message ScanRunErrorTrace { + // Output only. + // Defines an error reason code. + // Next id: 8 + enum Code { + // Default value is never used. + CODE_UNSPECIFIED = 0; + + // Indicates that the scan run failed due to an internal server error. + INTERNAL_ERROR = 1; + + // Indicates a scan configuration error, usually due to outdated ScanConfig + // settings, such as starting_urls or the DNS configuration. + SCAN_CONFIG_ISSUE = 2; + + // Indicates an authentication error, usually due to outdated ScanConfig + // authentication settings. + AUTHENTICATION_CONFIG_ISSUE = 3; + + // Indicates a scan operation timeout, usually caused by a very large site. + TIMED_OUT_WHILE_SCANNING = 4; + + // Indicates that a scan encountered excessive redirects, either to + // authentication or some other page outside of the scan scope. + TOO_MANY_REDIRECTS = 5; + + // Indicates that a scan encountered numerous errors from the web site + // pages. When available, most_common_http_error_code field indicates the + // most common HTTP error code encountered during the scan. + TOO_MANY_HTTP_ERRORS = 6; + } + + // Output only. Indicates the error reason code. + Code code = 1; + + // Output only. If the scan encounters SCAN_CONFIG_ISSUE error, this field has the error + // message encountered during scan configuration validation that is performed + // before each scan run. + ScanConfigError scan_config_error = 2; + + // Output only. If the scan encounters TOO_MANY_HTTP_ERRORS, this field indicates the most + // common HTTP error code, if such is available. For example, if this code is + // 404, the scan has encountered too many NOT_FOUND responses. + int32 most_common_http_error_code = 3; +} diff --git a/packages/google-cloud-websecurityscanner/protos/google/cloud/websecurityscanner/v1/scan_run_log.proto b/packages/google-cloud-websecurityscanner/protos/google/cloud/websecurityscanner/v1/scan_run_log.proto new file mode 100644 index 00000000000..1ff167e3f3d --- /dev/null +++ b/packages/google-cloud-websecurityscanner/protos/google/cloud/websecurityscanner/v1/scan_run_log.proto @@ -0,0 +1,55 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +syntax = "proto3"; + +package google.cloud.websecurityscanner.v1; + +import "google/cloud/websecurityscanner/v1/scan_run.proto"; +import "google/cloud/websecurityscanner/v1/scan_run_error_trace.proto"; + +option csharp_namespace = "Google.Cloud.WebSecurityScanner.V1"; +option go_package = "google.golang.org/genproto/googleapis/cloud/websecurityscanner/v1;websecurityscanner"; +option java_multiple_files = true; +option java_outer_classname = "ScanRunLogProto"; +option java_package = "com.google.cloud.websecurityscanner.v1"; +option php_namespace = "Google\\Cloud\\WebSecurityScanner\\V1"; +option ruby_package = "Google::Cloud::WebSecurityScanner::V1"; + +// A ScanRunLog is an output-only proto used for Stackdriver customer logging. +// It is used for logs covering the start and end of scan pipelines. +// Other than an added summary, this is a subset of the ScanRun. +// Representation in logs is either a proto Struct, or converted to JSON. +// Next id: 9 +message ScanRunLog { + // Human friendly message about the event. + string summary = 1; + + // The resource name of the ScanRun being logged. + string name = 2; + + // The execution state of the ScanRun. + google.cloud.websecurityscanner.v1.ScanRun.ExecutionState execution_state = 3; + + // The result state of the ScanRun. + google.cloud.websecurityscanner.v1.ScanRun.ResultState result_state = 4; + + int64 urls_crawled_count = 5; + + int64 urls_tested_count = 6; + + bool has_findings = 7; + + google.cloud.websecurityscanner.v1.ScanRunErrorTrace error_trace = 8; +} diff --git a/packages/google-cloud-websecurityscanner/protos/google/cloud/websecurityscanner/v1/scan_run_warning_trace.proto b/packages/google-cloud-websecurityscanner/protos/google/cloud/websecurityscanner/v1/scan_run_warning_trace.proto new file mode 100644 index 00000000000..dfc61697701 --- /dev/null +++ b/packages/google-cloud-websecurityscanner/protos/google/cloud/websecurityscanner/v1/scan_run_warning_trace.proto @@ -0,0 +1,61 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +syntax = "proto3"; + +package google.cloud.websecurityscanner.v1; + +option csharp_namespace = "Google.Cloud.WebSecurityScanner.V1"; +option go_package = "google.golang.org/genproto/googleapis/cloud/websecurityscanner/v1;websecurityscanner"; +option java_multiple_files = true; +option java_outer_classname = "ScanRunWarningTraceProto"; +option java_package = "com.google.cloud.websecurityscanner.v1"; +option php_namespace = "Google\\Cloud\\WebSecurityScanner\\V1"; +option ruby_package = "Google::Cloud::WebSecurityScanner::V1"; + +// Output only. +// Defines a warning trace message for ScanRun. Warning traces provide customers +// with useful information that helps make the scanning process more effective. +message ScanRunWarningTrace { + // Output only. + // Defines a warning message code. + // Next id: 6 + enum Code { + // Default value is never used. + CODE_UNSPECIFIED = 0; + + // Indicates that a scan discovered an unexpectedly low number of URLs. This + // is sometimes caused by complex navigation features or by using a single + // URL for numerous pages. + INSUFFICIENT_CRAWL_RESULTS = 1; + + // Indicates that a scan discovered too many URLs to test, or excessive + // redundant URLs. + TOO_MANY_CRAWL_RESULTS = 2; + + // Indicates that too many tests have been generated for the scan. Customer + // should try reducing the number of starting URLs, increasing the QPS rate, + // or narrowing down the scope of the scan using the excluded patterns. + TOO_MANY_FUZZ_TASKS = 3; + + // Indicates that a scan is blocked by IAP. + BLOCKED_BY_IAP = 4; + + // Indicates that no seeds is found for a scan + NO_STARTING_URL_FOUND_FOR_MANAGED_SCAN = 5; + } + + // Output only. Indicates the warning code. + Code code = 1; +} diff --git a/packages/google-cloud-websecurityscanner/protos/google/cloud/websecurityscanner/v1/web_security_scanner.proto b/packages/google-cloud-websecurityscanner/protos/google/cloud/websecurityscanner/v1/web_security_scanner.proto new file mode 100644 index 00000000000..efcc9bf2d39 --- /dev/null +++ b/packages/google-cloud-websecurityscanner/protos/google/cloud/websecurityscanner/v1/web_security_scanner.proto @@ -0,0 +1,337 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +syntax = "proto3"; + +package google.cloud.websecurityscanner.v1; + +import "google/api/annotations.proto"; +import "google/api/client.proto"; +import "google/cloud/websecurityscanner/v1/crawled_url.proto"; +import "google/cloud/websecurityscanner/v1/finding.proto"; +import "google/cloud/websecurityscanner/v1/finding_type_stats.proto"; +import "google/cloud/websecurityscanner/v1/scan_config.proto"; +import "google/cloud/websecurityscanner/v1/scan_run.proto"; +import "google/protobuf/empty.proto"; +import "google/protobuf/field_mask.proto"; + +option csharp_namespace = "Google.Cloud.WebSecurityScanner.V1"; +option go_package = "google.golang.org/genproto/googleapis/cloud/websecurityscanner/v1;websecurityscanner"; +option java_multiple_files = true; +option java_outer_classname = "WebSecurityScannerProto"; +option java_package = "com.google.cloud.websecurityscanner.v1"; +option php_namespace = "Google\\Cloud\\WebSecurityScanner\\V1"; +option ruby_package = "Google::Cloud::WebSecurityScanner::V1"; + +// Web Security Scanner Service identifies security vulnerabilities in web +// applications hosted on Google Cloud. It crawls your application, and +// attempts to exercise as many user inputs and event handlers as possible. +service WebSecurityScanner { + option (google.api.default_host) = "websecurityscanner.googleapis.com"; + option (google.api.oauth_scopes) = "https://www.googleapis.com/auth/cloud-platform"; + + // Creates a new ScanConfig. + rpc CreateScanConfig(CreateScanConfigRequest) returns (ScanConfig) { + option (google.api.http) = { + post: "/v1/{parent=projects/*}/scanConfigs" + body: "scan_config" + }; + } + + // Deletes an existing ScanConfig and its child resources. + rpc DeleteScanConfig(DeleteScanConfigRequest) returns (google.protobuf.Empty) { + option (google.api.http) = { + delete: "/v1/{name=projects/*/scanConfigs/*}" + }; + } + + // Gets a ScanConfig. + rpc GetScanConfig(GetScanConfigRequest) returns (ScanConfig) { + option (google.api.http) = { + get: "/v1/{name=projects/*/scanConfigs/*}" + }; + } + + // Lists ScanConfigs under a given project. + rpc ListScanConfigs(ListScanConfigsRequest) returns (ListScanConfigsResponse) { + option (google.api.http) = { + get: "/v1/{parent=projects/*}/scanConfigs" + }; + } + + // Updates a ScanConfig. This method support partial update of a ScanConfig. + rpc UpdateScanConfig(UpdateScanConfigRequest) returns (ScanConfig) { + option (google.api.http) = { + patch: "/v1/{scan_config.name=projects/*/scanConfigs/*}" + body: "scan_config" + }; + } + + // Start a ScanRun according to the given ScanConfig. + rpc StartScanRun(StartScanRunRequest) returns (ScanRun) { + option (google.api.http) = { + post: "/v1/{name=projects/*/scanConfigs/*}:start" + body: "*" + }; + } + + // Gets a ScanRun. + rpc GetScanRun(GetScanRunRequest) returns (ScanRun) { + option (google.api.http) = { + get: "/v1/{name=projects/*/scanConfigs/*/scanRuns/*}" + }; + } + + // Lists ScanRuns under a given ScanConfig, in descending order of ScanRun + // stop time. + rpc ListScanRuns(ListScanRunsRequest) returns (ListScanRunsResponse) { + option (google.api.http) = { + get: "/v1/{parent=projects/*/scanConfigs/*}/scanRuns" + }; + } + + // Stops a ScanRun. The stopped ScanRun is returned. + rpc StopScanRun(StopScanRunRequest) returns (ScanRun) { + option (google.api.http) = { + post: "/v1/{name=projects/*/scanConfigs/*/scanRuns/*}:stop" + body: "*" + }; + } + + // List CrawledUrls under a given ScanRun. + rpc ListCrawledUrls(ListCrawledUrlsRequest) returns (ListCrawledUrlsResponse) { + option (google.api.http) = { + get: "/v1/{parent=projects/*/scanConfigs/*/scanRuns/*}/crawledUrls" + }; + } + + // Gets a Finding. + rpc GetFinding(GetFindingRequest) returns (Finding) { + option (google.api.http) = { + get: "/v1/{name=projects/*/scanConfigs/*/scanRuns/*/findings/*}" + }; + } + + // List Findings under a given ScanRun. + rpc ListFindings(ListFindingsRequest) returns (ListFindingsResponse) { + option (google.api.http) = { + get: "/v1/{parent=projects/*/scanConfigs/*/scanRuns/*}/findings" + }; + } + + // List all FindingTypeStats under a given ScanRun. + rpc ListFindingTypeStats(ListFindingTypeStatsRequest) returns (ListFindingTypeStatsResponse) { + option (google.api.http) = { + get: "/v1/{parent=projects/*/scanConfigs/*/scanRuns/*}/findingTypeStats" + }; + } +} + +// Request for the `CreateScanConfig` method. +message CreateScanConfigRequest { + // Required. The parent resource name where the scan is created, which should be a + // project resource name in the format 'projects/{projectId}'. + string parent = 1; + + // Required. The ScanConfig to be created. + ScanConfig scan_config = 2; +} + +// Request for the `DeleteScanConfig` method. +message DeleteScanConfigRequest { + // Required. The resource name of the ScanConfig to be deleted. The name follows the + // format of 'projects/{projectId}/scanConfigs/{scanConfigId}'. + string name = 1; +} + +// Request for the `GetScanConfig` method. +message GetScanConfigRequest { + // Required. The resource name of the ScanConfig to be returned. The name follows the + // format of 'projects/{projectId}/scanConfigs/{scanConfigId}'. + string name = 1; +} + +// Request for the `ListScanConfigs` method. +message ListScanConfigsRequest { + // Required. The parent resource name, which should be a project resource name in the + // format 'projects/{projectId}'. + string parent = 1; + + // A token identifying a page of results to be returned. This should be a + // `next_page_token` value returned from a previous List request. + // If unspecified, the first page of results is returned. + string page_token = 2; + + // The maximum number of ScanConfigs to return, can be limited by server. + // If not specified or not positive, the implementation will select a + // reasonable value. + int32 page_size = 3; +} + +// Request for the `UpdateScanConfigRequest` method. +message UpdateScanConfigRequest { + // Required. The ScanConfig to be updated. The name field must be set to identify the + // resource to be updated. The values of fields not covered by the mask + // will be ignored. + ScanConfig scan_config = 2; + + // Required. The update mask applies to the resource. For the `FieldMask` definition, + // see + // https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#fieldmask + google.protobuf.FieldMask update_mask = 3; +} + +// Response for the `ListScanConfigs` method. +message ListScanConfigsResponse { + // The list of ScanConfigs returned. + repeated ScanConfig scan_configs = 1; + + // Token to retrieve the next page of results, or empty if there are no + // more results in the list. + string next_page_token = 2; +} + +// Request for the `StartScanRun` method. +message StartScanRunRequest { + // Required. The resource name of the ScanConfig to be used. The name follows the + // format of 'projects/{projectId}/scanConfigs/{scanConfigId}'. + string name = 1; +} + +// Request for the `GetScanRun` method. +message GetScanRunRequest { + // Required. The resource name of the ScanRun to be returned. The name follows the + // format of + // 'projects/{projectId}/scanConfigs/{scanConfigId}/scanRuns/{scanRunId}'. + string name = 1; +} + +// Request for the `ListScanRuns` method. +message ListScanRunsRequest { + // Required. The parent resource name, which should be a scan resource name in the + // format 'projects/{projectId}/scanConfigs/{scanConfigId}'. + string parent = 1; + + // A token identifying a page of results to be returned. This should be a + // `next_page_token` value returned from a previous List request. + // If unspecified, the first page of results is returned. + string page_token = 2; + + // The maximum number of ScanRuns to return, can be limited by server. + // If not specified or not positive, the implementation will select a + // reasonable value. + int32 page_size = 3; +} + +// Response for the `ListScanRuns` method. +message ListScanRunsResponse { + // The list of ScanRuns returned. + repeated ScanRun scan_runs = 1; + + // Token to retrieve the next page of results, or empty if there are no + // more results in the list. + string next_page_token = 2; +} + +// Request for the `StopScanRun` method. +message StopScanRunRequest { + // Required. The resource name of the ScanRun to be stopped. The name follows the + // format of + // 'projects/{projectId}/scanConfigs/{scanConfigId}/scanRuns/{scanRunId}'. + string name = 1; +} + +// Request for the `ListCrawledUrls` method. +message ListCrawledUrlsRequest { + // Required. The parent resource name, which should be a scan run resource name in the + // format + // 'projects/{projectId}/scanConfigs/{scanConfigId}/scanRuns/{scanRunId}'. + string parent = 1; + + // A token identifying a page of results to be returned. This should be a + // `next_page_token` value returned from a previous List request. + // If unspecified, the first page of results is returned. + string page_token = 2; + + // The maximum number of CrawledUrls to return, can be limited by server. + // If not specified or not positive, the implementation will select a + // reasonable value. + int32 page_size = 3; +} + +// Response for the `ListCrawledUrls` method. +message ListCrawledUrlsResponse { + // The list of CrawledUrls returned. + repeated CrawledUrl crawled_urls = 1; + + // Token to retrieve the next page of results, or empty if there are no + // more results in the list. + string next_page_token = 2; +} + +// Request for the `GetFinding` method. +message GetFindingRequest { + // Required. The resource name of the Finding to be returned. The name follows the + // format of + // 'projects/{projectId}/scanConfigs/{scanConfigId}/scanRuns/{scanRunId}/findings/{findingId}'. + string name = 1; +} + +// Request for the `ListFindings` method. +message ListFindingsRequest { + // Required. The parent resource name, which should be a scan run resource name in the + // format + // 'projects/{projectId}/scanConfigs/{scanConfigId}/scanRuns/{scanRunId}'. + string parent = 1; + + // The filter expression. The expression must be in the format: + // . + // Supported field: 'finding_type'. + // Supported operator: '='. + string filter = 2; + + // A token identifying a page of results to be returned. This should be a + // `next_page_token` value returned from a previous List request. + // If unspecified, the first page of results is returned. + string page_token = 3; + + // The maximum number of Findings to return, can be limited by server. + // If not specified or not positive, the implementation will select a + // reasonable value. + int32 page_size = 4; +} + +// Response for the `ListFindings` method. +message ListFindingsResponse { + // The list of Findings returned. + repeated Finding findings = 1; + + // Token to retrieve the next page of results, or empty if there are no + // more results in the list. + string next_page_token = 2; +} + +// Request for the `ListFindingTypeStats` method. +message ListFindingTypeStatsRequest { + // Required. The parent resource name, which should be a scan run resource name in the + // format + // 'projects/{projectId}/scanConfigs/{scanConfigId}/scanRuns/{scanRunId}'. + string parent = 1; +} + +// Response for the `ListFindingTypeStats` method. +message ListFindingTypeStatsResponse { + // The list of FindingTypeStats returned. + repeated FindingTypeStats finding_type_stats = 1; +} diff --git a/packages/google-cloud-websecurityscanner/protos/google/cloud/websecurityscanner/v1alpha/crawled_url.proto b/packages/google-cloud-websecurityscanner/protos/google/cloud/websecurityscanner/v1alpha/crawled_url.proto new file mode 100644 index 00000000000..c22f4272f16 --- /dev/null +++ b/packages/google-cloud-websecurityscanner/protos/google/cloud/websecurityscanner/v1alpha/crawled_url.proto @@ -0,0 +1,38 @@ +// Copyright 2019 Google LLC. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// + +syntax = "proto3"; + +package google.cloud.websecurityscanner.v1alpha; + +option go_package = "google.golang.org/genproto/googleapis/cloud/websecurityscanner/v1alpha;websecurityscanner"; +option java_multiple_files = true; +option java_outer_classname = "CrawledUrlProto"; +option java_package = "com.google.cloud.websecurityscanner.v1alpha"; + +// A CrawledUrl resource represents a URL that was crawled during a ScanRun. Web +// Security Scanner Service crawls the web applications, following all links +// within the scope of sites, to find the URLs to test against. +message CrawledUrl { + // Output only. The http method of the request that was used to visit the URL, in + // uppercase. + string http_method = 1; + + // Output only. The URL that was crawled. + string url = 2; + + // Output only. The body of the request that was used to visit the URL. + string body = 3; +} diff --git a/packages/google-cloud-websecurityscanner/protos/google/cloud/websecurityscanner/v1alpha/finding.proto b/packages/google-cloud-websecurityscanner/protos/google/cloud/websecurityscanner/v1alpha/finding.proto new file mode 100644 index 00000000000..c02020f3431 --- /dev/null +++ b/packages/google-cloud-websecurityscanner/protos/google/cloud/websecurityscanner/v1alpha/finding.proto @@ -0,0 +1,152 @@ +// Copyright 2019 Google LLC. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// + +syntax = "proto3"; + +package google.cloud.websecurityscanner.v1alpha; + +import "google/api/resource.proto"; +import "google/cloud/websecurityscanner/v1alpha/finding_addon.proto"; + +option go_package = "google.golang.org/genproto/googleapis/cloud/websecurityscanner/v1alpha;websecurityscanner"; +option java_multiple_files = true; +option java_outer_classname = "FindingProto"; +option java_package = "com.google.cloud.websecurityscanner.v1alpha"; + +// A Finding resource represents a vulnerability instance identified during a +// ScanRun. +message Finding { + option (google.api.resource) = { + type: "websecurityscanner.googleapis.com/Finding" + pattern: "projects/{project}/scanConfigs/{scan_config}/scanRuns/{scan_run}/findings/{finding}" + }; + + // Types of Findings. + enum FindingType { + // The invalid finding type. + FINDING_TYPE_UNSPECIFIED = 0; + + // A page that was served over HTTPS also resources over HTTP. A + // man-in-the-middle attacker could tamper with the HTTP resource and gain + // full access to the website that loads the resource or to monitor the + // actions taken by the user. + MIXED_CONTENT = 1; + + // The version of an included library is known to contain a security issue. + // The scanner checks the version of library in use against a known list of + // vulnerable libraries. False positives are possible if the version + // detection fails or if the library has been manually patched. + OUTDATED_LIBRARY = 2; + + // This type of vulnerability occurs when the value of a request parameter + // is reflected at the beginning of the response, for example, in requests + // using JSONP. Under certain circumstances, an attacker may be able to + // supply an alphanumeric-only Flash file in the vulnerable parameter + // causing the browser to execute the Flash file as if it originated on the + // vulnerable server. + ROSETTA_FLASH = 5; + + // A cross-site scripting (XSS) bug is found via JavaScript callback. For + // detailed explanations on XSS, see + // https://www.google.com/about/appsecurity/learning/xss/. + XSS_CALLBACK = 3; + + // A potential cross-site scripting (XSS) bug due to JavaScript breakage. + // In some circumstances, the application under test might modify the test + // string before it is parsed by the browser. When the browser attempts to + // runs this modified test string, it will likely break and throw a + // JavaScript execution error, thus an injection issue is occurring. + // However, it may not be exploitable. Manual verification is needed to see + // if the test string modifications can be evaded and confirm that the issue + // is in fact an XSS vulnerability. For detailed explanations on XSS, see + // https://www.google.com/about/appsecurity/learning/xss/. + XSS_ERROR = 4; + + // An application appears to be transmitting a password field in clear text. + // An attacker can eavesdrop network traffic and sniff the password field. + CLEAR_TEXT_PASSWORD = 6; + + // An application returns sensitive content with an invalid content type, + // or without an 'X-Content-Type-Options: nosniff' header. + INVALID_CONTENT_TYPE = 7; + + // A cross-site scripting (XSS) vulnerability in AngularJS module that + // occurs when a user-provided string is interpolated by Angular. + XSS_ANGULAR_CALLBACK = 8; + + // A malformed or invalid valued header. + INVALID_HEADER = 9; + + // Misspelled security header name. + MISSPELLED_SECURITY_HEADER_NAME = 10; + + // Mismatching values in a duplicate security header. + MISMATCHING_SECURITY_HEADER_VALUES = 11; + } + + // The resource name of the Finding. The name follows the format of + // 'projects/{projectId}/scanConfigs/{scanConfigId}/scanruns/{scanRunId}/findings/{findingId}'. + // The finding IDs are generated by the system. + string name = 1; + + // The type of the Finding. + FindingType finding_type = 2; + + // The http method of the request that triggered the vulnerability, in + // uppercase. + string http_method = 3; + + // The URL produced by the server-side fuzzer and used in the request that + // triggered the vulnerability. + string fuzzed_url = 4; + + // The body of the request that triggered the vulnerability. + string body = 5; + + // The description of the vulnerability. + string description = 6; + + // The URL containing human-readable payload that user can leverage to + // reproduce the vulnerability. + string reproduction_url = 7; + + // If the vulnerability was originated from nested IFrame, the immediate + // parent IFrame is reported. + string frame_url = 8; + + // The URL where the browser lands when the vulnerability is detected. + string final_url = 9; + + // The tracking ID uniquely identifies a vulnerability instance across + // multiple ScanRuns. + string tracking_id = 10; + + // An addon containing information about outdated libraries. + OutdatedLibrary outdated_library = 11; + + // An addon containing detailed information regarding any resource causing the + // vulnerability such as JavaScript sources, image, audio files, etc. + ViolatingResource violating_resource = 12; + + // An addon containing information about vulnerable or missing HTTP headers. + VulnerableHeaders vulnerable_headers = 15; + + // An addon containing information about request parameters which were found + // to be vulnerable. + VulnerableParameters vulnerable_parameters = 13; + + // An addon containing information reported for an XSS, if any. + Xss xss = 14; +} diff --git a/packages/google-cloud-websecurityscanner/protos/google/cloud/websecurityscanner/v1alpha/finding_addon.proto b/packages/google-cloud-websecurityscanner/protos/google/cloud/websecurityscanner/v1alpha/finding_addon.proto new file mode 100644 index 00000000000..3fafdb40206 --- /dev/null +++ b/packages/google-cloud-websecurityscanner/protos/google/cloud/websecurityscanner/v1alpha/finding_addon.proto @@ -0,0 +1,78 @@ +// Copyright 2019 Google LLC. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// + +syntax = "proto3"; + +package google.cloud.websecurityscanner.v1alpha; + +option go_package = "google.golang.org/genproto/googleapis/cloud/websecurityscanner/v1alpha;websecurityscanner"; +option java_multiple_files = true; +option java_outer_classname = "FindingAddonProto"; +option java_package = "com.google.cloud.websecurityscanner.v1alpha"; + +// Information reported for an outdated library. +message OutdatedLibrary { + // The name of the outdated library. + string library_name = 1; + + // The version number. + string version = 2; + + // URLs to learn more information about the vulnerabilities in the library. + repeated string learn_more_urls = 3; +} + +// Information regarding any resource causing the vulnerability such +// as JavaScript sources, image, audio files, etc. +message ViolatingResource { + // The MIME type of this resource. + string content_type = 1; + + // URL of this violating resource. + string resource_url = 2; +} + +// Information about vulnerable request parameters. +message VulnerableParameters { + // The vulnerable parameter names. + repeated string parameter_names = 1; +} + +// Information about vulnerable or missing HTTP Headers. +message VulnerableHeaders { + // Describes a HTTP Header. + message Header { + // Header name. + string name = 1; + + // Header value. + string value = 2; + } + + // List of vulnerable headers. + repeated Header headers = 1; + + // List of missing headers. + repeated Header missing_headers = 2; +} + +// Information reported for an XSS. +message Xss { + // Stack traces leading to the point where the XSS occurred. + repeated string stack_traces = 1; + + // An error message generated by a javascript breakage. + string error_message = 2; +} diff --git a/packages/google-cloud-websecurityscanner/protos/google/cloud/websecurityscanner/v1alpha/finding_type_stats.proto b/packages/google-cloud-websecurityscanner/protos/google/cloud/websecurityscanner/v1alpha/finding_type_stats.proto new file mode 100644 index 00000000000..e46b330c627 --- /dev/null +++ b/packages/google-cloud-websecurityscanner/protos/google/cloud/websecurityscanner/v1alpha/finding_type_stats.proto @@ -0,0 +1,35 @@ +// Copyright 2019 Google LLC. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// + +syntax = "proto3"; + +package google.cloud.websecurityscanner.v1alpha; + +import "google/cloud/websecurityscanner/v1alpha/finding.proto"; + +option go_package = "google.golang.org/genproto/googleapis/cloud/websecurityscanner/v1alpha;websecurityscanner"; +option java_multiple_files = true; +option java_outer_classname = "FindingTypeStatsProto"; +option java_package = "com.google.cloud.websecurityscanner.v1alpha"; + +// A FindingTypeStats resource represents stats regarding a specific FindingType +// of Findings under a given ScanRun. +message FindingTypeStats { + // The finding type associated with the stats. + Finding.FindingType finding_type = 1; + + // The count of findings belonging to this finding type. + int32 finding_count = 2; +} diff --git a/packages/google-cloud-websecurityscanner/protos/google/cloud/websecurityscanner/v1alpha/scan_config.proto b/packages/google-cloud-websecurityscanner/protos/google/cloud/websecurityscanner/v1alpha/scan_config.proto new file mode 100644 index 00000000000..5497b1a0f6a --- /dev/null +++ b/packages/google-cloud-websecurityscanner/protos/google/cloud/websecurityscanner/v1alpha/scan_config.proto @@ -0,0 +1,157 @@ +// Copyright 2019 Google LLC. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// + +syntax = "proto3"; + +package google.cloud.websecurityscanner.v1alpha; + +import "google/api/field_behavior.proto"; +import "google/api/resource.proto"; +import "google/cloud/websecurityscanner/v1alpha/scan_run.proto"; +import "google/protobuf/timestamp.proto"; + +option go_package = "google.golang.org/genproto/googleapis/cloud/websecurityscanner/v1alpha;websecurityscanner"; +option java_multiple_files = true; +option java_outer_classname = "ScanConfigProto"; +option java_package = "com.google.cloud.websecurityscanner.v1alpha"; + +// A ScanConfig resource contains the configurations to launch a scan. +// next id: 12 +message ScanConfig { + option (google.api.resource) = { + type: "websecurityscanner.googleapis.com/ScanConfig" + pattern: "projects/{project}/scanConfigs/{scan_config}" + }; + + // Scan authentication configuration. + message Authentication { + // Describes authentication configuration that uses a Google account. + message GoogleAccount { + // Required. The user name of the Google account. + string username = 1 [(google.api.field_behavior) = REQUIRED]; + + // Required. Input only. The password of the Google account. The credential is stored encrypted + // and not returned in any response nor included in audit logs. + string password = 2 [ + (google.api.field_behavior) = REQUIRED, + (google.api.field_behavior) = INPUT_ONLY + ]; + } + + // Describes authentication configuration that uses a custom account. + message CustomAccount { + // Required. The user name of the custom account. + string username = 1 [(google.api.field_behavior) = REQUIRED]; + + // Required. Input only. The password of the custom account. The credential is stored encrypted + // and not returned in any response nor included in audit logs. + string password = 2 [ + (google.api.field_behavior) = REQUIRED, + (google.api.field_behavior) = INPUT_ONLY + ]; + + // Required. The login form URL of the website. + string login_url = 3 [(google.api.field_behavior) = REQUIRED]; + } + + // Required. + // Authentication configuration + oneof authentication { + // Authentication using a Google account. + GoogleAccount google_account = 1; + + // Authentication using a custom account. + CustomAccount custom_account = 2; + } + } + + // Scan schedule configuration. + message Schedule { + // A timestamp indicates when the next run will be scheduled. The value is + // refreshed by the server after each run. If unspecified, it will default + // to current server time, which means the scan will be scheduled to start + // immediately. + google.protobuf.Timestamp schedule_time = 1; + + // Required. The duration of time between executions in days. + int32 interval_duration_days = 2 [(google.api.field_behavior) = REQUIRED]; + } + + // Type of user agents used for scanning. + enum UserAgent { + // The user agent is unknown. Service will default to CHROME_LINUX. + USER_AGENT_UNSPECIFIED = 0; + + // Chrome on Linux. This is the service default if unspecified. + CHROME_LINUX = 1; + + // Chrome on Android. + CHROME_ANDROID = 2; + + // Safari on IPhone. + SAFARI_IPHONE = 3; + } + + // Cloud platforms supported by Cloud Web Security Scanner. + enum TargetPlatform { + // The target platform is unknown. Requests with this enum value will be + // rejected with INVALID_ARGUMENT error. + TARGET_PLATFORM_UNSPECIFIED = 0; + + // Google App Engine service. + APP_ENGINE = 1; + + // Google Compute Engine service. + COMPUTE = 2; + } + + // The resource name of the ScanConfig. The name follows the format of + // 'projects/{projectId}/scanConfigs/{scanConfigId}'. The ScanConfig IDs are + // generated by the system. + string name = 1; + + // Required. The user provided display name of the ScanConfig. + string display_name = 2 [(google.api.field_behavior) = REQUIRED]; + + // The maximum QPS during scanning. A valid value ranges from 5 to 20 + // inclusively. If the field is unspecified or its value is set 0, server will + // default to 15. Other values outside of [5, 20] range will be rejected with + // INVALID_ARGUMENT error. + int32 max_qps = 3; + + // Required. The starting URLs from which the scanner finds site pages. + repeated string starting_urls = 4 [(google.api.field_behavior) = REQUIRED]; + + // The authentication configuration. If specified, service will use the + // authentication configuration during scanning. + Authentication authentication = 5; + + // The user agent used during scanning. + UserAgent user_agent = 6; + + // The blacklist URL patterns as described in + // https://cloud.google.com/security-scanner/docs/excluded-urls + repeated string blacklist_patterns = 7; + + // The schedule of the ScanConfig. + Schedule schedule = 8; + + // Set of Cloud Platforms targeted by the scan. If empty, APP_ENGINE will be + // used as a default. + repeated TargetPlatform target_platforms = 9; + + // Latest ScanRun if available. + ScanRun latest_run = 11; +} diff --git a/packages/google-cloud-websecurityscanner/protos/google/cloud/websecurityscanner/v1alpha/scan_run.proto b/packages/google-cloud-websecurityscanner/protos/google/cloud/websecurityscanner/v1alpha/scan_run.proto new file mode 100644 index 00000000000..79c54194938 --- /dev/null +++ b/packages/google-cloud-websecurityscanner/protos/google/cloud/websecurityscanner/v1alpha/scan_run.proto @@ -0,0 +1,104 @@ +// Copyright 2019 Google LLC. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// + +syntax = "proto3"; + +package google.cloud.websecurityscanner.v1alpha; + +import "google/api/resource.proto"; +import "google/protobuf/timestamp.proto"; + +option go_package = "google.golang.org/genproto/googleapis/cloud/websecurityscanner/v1alpha;websecurityscanner"; +option java_multiple_files = true; +option java_outer_classname = "ScanRunProto"; +option java_package = "com.google.cloud.websecurityscanner.v1alpha"; + +// A ScanRun is a output-only resource representing an actual run of the scan. +message ScanRun { + option (google.api.resource) = { + type: "websecurityscanner.googleapis.com/ScanRun" + pattern: "projects/{project}/scanConfigs/{scan_config}/scanRuns/{scan_run}" + }; + + // Types of ScanRun execution state. + enum ExecutionState { + // Represents an invalid state caused by internal server error. This value + // should never be returned. + EXECUTION_STATE_UNSPECIFIED = 0; + + // The scan is waiting in the queue. + QUEUED = 1; + + // The scan is in progress. + SCANNING = 2; + + // The scan is either finished or stopped by user. + FINISHED = 3; + } + + // Types of ScanRun result state. + enum ResultState { + // Default value. This value is returned when the ScanRun is not yet + // finished. + RESULT_STATE_UNSPECIFIED = 0; + + // The scan finished without errors. + SUCCESS = 1; + + // The scan finished with errors. + ERROR = 2; + + // The scan was terminated by user. + KILLED = 3; + } + + // The resource name of the ScanRun. The name follows the format of + // 'projects/{projectId}/scanConfigs/{scanConfigId}/scanRuns/{scanRunId}'. + // The ScanRun IDs are generated by the system. + string name = 1; + + // The execution state of the ScanRun. + ExecutionState execution_state = 2; + + // The result state of the ScanRun. This field is only available after the + // execution state reaches "FINISHED". + ResultState result_state = 3; + + // The time at which the ScanRun started. + google.protobuf.Timestamp start_time = 4; + + // The time at which the ScanRun reached termination state - that the ScanRun + // is either finished or stopped by user. + google.protobuf.Timestamp end_time = 5; + + // The number of URLs crawled during this ScanRun. If the scan is in progress, + // the value represents the number of URLs crawled up to now. + int64 urls_crawled_count = 6; + + // The number of URLs tested during this ScanRun. If the scan is in progress, + // the value represents the number of URLs tested up to now. The number of + // URLs tested is usually larger than the number URLS crawled because + // typically a crawled URL is tested with multiple test payloads. + int64 urls_tested_count = 7; + + // Whether the scan run has found any vulnerabilities. + bool has_vulnerabilities = 8; + + // The percentage of total completion ranging from 0 to 100. + // If the scan is in queue, the value is 0. + // If the scan is running, the value ranges from 0 to 100. + // If the scan is finished, the value is 100. + int32 progress_percent = 9; +} diff --git a/packages/google-cloud-websecurityscanner/protos/google/cloud/websecurityscanner/v1alpha/web_security_scanner.proto b/packages/google-cloud-websecurityscanner/protos/google/cloud/websecurityscanner/v1alpha/web_security_scanner.proto new file mode 100644 index 00000000000..f34bd74d56b --- /dev/null +++ b/packages/google-cloud-websecurityscanner/protos/google/cloud/websecurityscanner/v1alpha/web_security_scanner.proto @@ -0,0 +1,410 @@ +// Copyright 2019 Google LLC. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// + +syntax = "proto3"; + +package google.cloud.websecurityscanner.v1alpha; + +import "google/api/annotations.proto"; +import "google/api/client.proto"; +import "google/api/field_behavior.proto"; +import "google/api/resource.proto"; +import "google/cloud/websecurityscanner/v1alpha/crawled_url.proto"; +import "google/cloud/websecurityscanner/v1alpha/finding.proto"; +import "google/cloud/websecurityscanner/v1alpha/finding_type_stats.proto"; +import "google/cloud/websecurityscanner/v1alpha/scan_config.proto"; +import "google/cloud/websecurityscanner/v1alpha/scan_run.proto"; +import "google/protobuf/empty.proto"; +import "google/protobuf/field_mask.proto"; + +option go_package = "google.golang.org/genproto/googleapis/cloud/websecurityscanner/v1alpha;websecurityscanner"; +option java_multiple_files = true; +option java_outer_classname = "WebSecurityScannerProto"; +option java_package = "com.google.cloud.websecurityscanner.v1alpha"; + +// Cloud Web Security Scanner Service identifies security vulnerabilities in web +// applications hosted on Google Cloud Platform. It crawls your application, and +// attempts to exercise as many user inputs and event handlers as possible. +service WebSecurityScanner { + option (google.api.default_host) = "websecurityscanner.googleapis.com"; + option (google.api.oauth_scopes) = "https://www.googleapis.com/auth/cloud-platform"; + + // Creates a new ScanConfig. + rpc CreateScanConfig(CreateScanConfigRequest) returns (ScanConfig) { + option (google.api.http) = { + post: "/v1alpha/{parent=projects/*}/scanConfigs" + body: "scan_config" + }; + option (google.api.method_signature) = "parent,scan_config"; + } + + // Deletes an existing ScanConfig and its child resources. + rpc DeleteScanConfig(DeleteScanConfigRequest) returns (google.protobuf.Empty) { + option (google.api.http) = { + delete: "/v1alpha/{name=projects/*/scanConfigs/*}" + }; + option (google.api.method_signature) = "name"; + } + + // Gets a ScanConfig. + rpc GetScanConfig(GetScanConfigRequest) returns (ScanConfig) { + option (google.api.http) = { + get: "/v1alpha/{name=projects/*/scanConfigs/*}" + }; + option (google.api.method_signature) = "name"; + } + + // Lists ScanConfigs under a given project. + rpc ListScanConfigs(ListScanConfigsRequest) returns (ListScanConfigsResponse) { + option (google.api.http) = { + get: "/v1alpha/{parent=projects/*}/scanConfigs" + }; + option (google.api.method_signature) = "parent"; + } + + // Updates a ScanConfig. This method support partial update of a ScanConfig. + rpc UpdateScanConfig(UpdateScanConfigRequest) returns (ScanConfig) { + option (google.api.http) = { + patch: "/v1alpha/{scan_config.name=projects/*/scanConfigs/*}" + body: "scan_config" + }; + option (google.api.method_signature) = "scan_config,update_mask"; + } + + // Start a ScanRun according to the given ScanConfig. + rpc StartScanRun(StartScanRunRequest) returns (ScanRun) { + option (google.api.http) = { + post: "/v1alpha/{name=projects/*/scanConfigs/*}:start" + body: "*" + }; + option (google.api.method_signature) = "name"; + } + + // Gets a ScanRun. + rpc GetScanRun(GetScanRunRequest) returns (ScanRun) { + option (google.api.http) = { + get: "/v1alpha/{name=projects/*/scanConfigs/*/scanRuns/*}" + }; + option (google.api.method_signature) = "name"; + } + + // Lists ScanRuns under a given ScanConfig, in descending order of ScanRun + // stop time. + rpc ListScanRuns(ListScanRunsRequest) returns (ListScanRunsResponse) { + option (google.api.http) = { + get: "/v1alpha/{parent=projects/*/scanConfigs/*}/scanRuns" + }; + option (google.api.method_signature) = "parent"; + } + + // Stops a ScanRun. The stopped ScanRun is returned. + rpc StopScanRun(StopScanRunRequest) returns (ScanRun) { + option (google.api.http) = { + post: "/v1alpha/{name=projects/*/scanConfigs/*/scanRuns/*}:stop" + body: "*" + }; + option (google.api.method_signature) = "name"; + } + + // List CrawledUrls under a given ScanRun. + rpc ListCrawledUrls(ListCrawledUrlsRequest) returns (ListCrawledUrlsResponse) { + option (google.api.http) = { + get: "/v1alpha/{parent=projects/*/scanConfigs/*/scanRuns/*}/crawledUrls" + }; + option (google.api.method_signature) = "parent"; + } + + // Gets a Finding. + rpc GetFinding(GetFindingRequest) returns (Finding) { + option (google.api.http) = { + get: "/v1alpha/{name=projects/*/scanConfigs/*/scanRuns/*/findings/*}" + }; + option (google.api.method_signature) = "name"; + } + + // List Findings under a given ScanRun. + rpc ListFindings(ListFindingsRequest) returns (ListFindingsResponse) { + option (google.api.http) = { + get: "/v1alpha/{parent=projects/*/scanConfigs/*/scanRuns/*}/findings" + }; + option (google.api.method_signature) = "parent,filter"; + } + + // List all FindingTypeStats under a given ScanRun. + rpc ListFindingTypeStats(ListFindingTypeStatsRequest) returns (ListFindingTypeStatsResponse) { + option (google.api.http) = { + get: "/v1alpha/{parent=projects/*/scanConfigs/*/scanRuns/*}/findingTypeStats" + }; + option (google.api.method_signature) = "parent"; + } +} + +// Request for the `CreateScanConfig` method. +message CreateScanConfigRequest { + // Required. The parent resource name where the scan is created, which should be a + // project resource name in the format 'projects/{projectId}'. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "cloudresourcemanager.googleapis.com/Project" + } + ]; + + // Required. The ScanConfig to be created. + ScanConfig scan_config = 2 [(google.api.field_behavior) = REQUIRED]; +} + +// Request for the `DeleteScanConfig` method. +message DeleteScanConfigRequest { + // Required. The resource name of the ScanConfig to be deleted. The name follows the + // format of 'projects/{projectId}/scanConfigs/{scanConfigId}'. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "websecurityscanner.googleapis.com/ScanConfig" + } + ]; +} + +// Request for the `GetScanConfig` method. +message GetScanConfigRequest { + // Required. The resource name of the ScanConfig to be returned. The name follows the + // format of 'projects/{projectId}/scanConfigs/{scanConfigId}'. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "websecurityscanner.googleapis.com/ScanConfig" + } + ]; +} + +// Request for the `ListScanConfigs` method. +message ListScanConfigsRequest { + // Required. The parent resource name, which should be a project resource name in the + // format 'projects/{projectId}'. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "cloudresourcemanager.googleapis.com/Project" + } + ]; + + // A token identifying a page of results to be returned. This should be a + // `next_page_token` value returned from a previous List request. + // If unspecified, the first page of results is returned. + string page_token = 2; + + // The maximum number of ScanConfigs to return, can be limited by server. + // If not specified or not positive, the implementation will select a + // reasonable value. + int32 page_size = 3; +} + +// Request for the `UpdateScanConfigRequest` method. +message UpdateScanConfigRequest { + // Required. The ScanConfig to be updated. The name field must be set to identify the + // resource to be updated. The values of fields not covered by the mask + // will be ignored. + ScanConfig scan_config = 2 [(google.api.field_behavior) = REQUIRED]; + + // Required. The update mask applies to the resource. For the `FieldMask` definition, + // see + // https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#fieldmask + google.protobuf.FieldMask update_mask = 3 [(google.api.field_behavior) = REQUIRED]; +} + +// Response for the `ListScanConfigs` method. +message ListScanConfigsResponse { + // The list of ScanConfigs returned. + repeated ScanConfig scan_configs = 1; + + // Token to retrieve the next page of results, or empty if there are no + // more results in the list. + string next_page_token = 2; +} + +// Request for the `StartScanRun` method. +message StartScanRunRequest { + // Required. The resource name of the ScanConfig to be used. The name follows the + // format of 'projects/{projectId}/scanConfigs/{scanConfigId}'. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "websecurityscanner.googleapis.com/ScanConfig" + } + ]; +} + +// Request for the `GetScanRun` method. +message GetScanRunRequest { + // Required. The resource name of the ScanRun to be returned. The name follows the + // format of + // 'projects/{projectId}/scanConfigs/{scanConfigId}/scanRuns/{scanRunId}'. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "websecurityscanner.googleapis.com/ScanRun" + } + ]; +} + +// Request for the `ListScanRuns` method. +message ListScanRunsRequest { + // Required. The parent resource name, which should be a scan resource name in the + // format 'projects/{projectId}/scanConfigs/{scanConfigId}'. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "websecurityscanner.googleapis.com/ScanConfig" + } + ]; + + // A token identifying a page of results to be returned. This should be a + // `next_page_token` value returned from a previous List request. + // If unspecified, the first page of results is returned. + string page_token = 2; + + // The maximum number of ScanRuns to return, can be limited by server. + // If not specified or not positive, the implementation will select a + // reasonable value. + int32 page_size = 3; +} + +// Response for the `ListScanRuns` method. +message ListScanRunsResponse { + // The list of ScanRuns returned. + repeated ScanRun scan_runs = 1; + + // Token to retrieve the next page of results, or empty if there are no + // more results in the list. + string next_page_token = 2; +} + +// Request for the `StopScanRun` method. +message StopScanRunRequest { + // Required. The resource name of the ScanRun to be stopped. The name follows the + // format of + // 'projects/{projectId}/scanConfigs/{scanConfigId}/scanRuns/{scanRunId}'. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "websecurityscanner.googleapis.com/ScanRun" + } + ]; +} + +// Request for the `ListCrawledUrls` method. +message ListCrawledUrlsRequest { + // Required. The parent resource name, which should be a scan run resource name in the + // format + // 'projects/{projectId}/scanConfigs/{scanConfigId}/scanRuns/{scanRunId}'. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "websecurityscanner.googleapis.com/ScanRun" + } + ]; + + // A token identifying a page of results to be returned. This should be a + // `next_page_token` value returned from a previous List request. + // If unspecified, the first page of results is returned. + string page_token = 2; + + // The maximum number of CrawledUrls to return, can be limited by server. + // If not specified or not positive, the implementation will select a + // reasonable value. + int32 page_size = 3; +} + +// Response for the `ListCrawledUrls` method. +message ListCrawledUrlsResponse { + // The list of CrawledUrls returned. + repeated CrawledUrl crawled_urls = 1; + + // Token to retrieve the next page of results, or empty if there are no + // more results in the list. + string next_page_token = 2; +} + +// Request for the `GetFinding` method. +message GetFindingRequest { + // Required. The resource name of the Finding to be returned. The name follows the + // format of + // 'projects/{projectId}/scanConfigs/{scanConfigId}/scanRuns/{scanRunId}/findings/{findingId}'. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "websecurityscanner.googleapis.com/Finding" + } + ]; +} + +// Request for the `ListFindings` method. +message ListFindingsRequest { + // Required. The parent resource name, which should be a scan run resource name in the + // format + // 'projects/{projectId}/scanConfigs/{scanConfigId}/scanRuns/{scanRunId}'. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "websecurityscanner.googleapis.com/ScanRun" + } + ]; + + // Required. The filter expression. The expression must be in the format: + // . + // Supported field: 'finding_type'. + // Supported operator: '='. + string filter = 2 [(google.api.field_behavior) = REQUIRED]; + + // A token identifying a page of results to be returned. This should be a + // `next_page_token` value returned from a previous List request. + // If unspecified, the first page of results is returned. + string page_token = 3; + + // The maximum number of Findings to return, can be limited by server. + // If not specified or not positive, the implementation will select a + // reasonable value. + int32 page_size = 4; +} + +// Response for the `ListFindings` method. +message ListFindingsResponse { + // The list of Findings returned. + repeated Finding findings = 1; + + // Token to retrieve the next page of results, or empty if there are no + // more results in the list. + string next_page_token = 2; +} + +// Request for the `ListFindingTypeStats` method. +message ListFindingTypeStatsRequest { + // Required. The parent resource name, which should be a scan run resource name in the + // format + // 'projects/{projectId}/scanConfigs/{scanConfigId}/scanRuns/{scanRunId}'. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "websecurityscanner.googleapis.com/ScanRun" + } + ]; +} + +// Response for the `ListFindingTypeStats` method. +message ListFindingTypeStatsResponse { + // The list of FindingTypeStats returned. + repeated FindingTypeStats finding_type_stats = 1; +} diff --git a/packages/google-cloud-websecurityscanner/protos/google/cloud/websecurityscanner/v1beta/crawled_url.proto b/packages/google-cloud-websecurityscanner/protos/google/cloud/websecurityscanner/v1beta/crawled_url.proto new file mode 100644 index 00000000000..cbfead4cb3b --- /dev/null +++ b/packages/google-cloud-websecurityscanner/protos/google/cloud/websecurityscanner/v1beta/crawled_url.proto @@ -0,0 +1,41 @@ +// Copyright 2019 Google LLC. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// + +syntax = "proto3"; + +package google.cloud.websecurityscanner.v1beta; + +option csharp_namespace = "Google.Cloud.WebSecurityScanner.V1Beta"; +option go_package = "google.golang.org/genproto/googleapis/cloud/websecurityscanner/v1beta;websecurityscanner"; +option java_multiple_files = true; +option java_outer_classname = "CrawledUrlProto"; +option java_package = "com.google.cloud.websecurityscanner.v1beta"; +option php_namespace = "Google\\Cloud\\WebSecurityScanner\\V1beta"; +option ruby_package = "Google::Cloud::WebSecurityScanner::V1beta"; + +// A CrawledUrl resource represents a URL that was crawled during a ScanRun. Web +// Security Scanner Service crawls the web applications, following all links +// within the scope of sites, to find the URLs to test against. +message CrawledUrl { + // The http method of the request that was used to visit the URL, in + // uppercase. + string http_method = 1; + + // The URL that was crawled. + string url = 2; + + // The body of the request that was used to visit the URL. + string body = 3; +} diff --git a/packages/google-cloud-websecurityscanner/protos/google/cloud/websecurityscanner/v1beta/finding.proto b/packages/google-cloud-websecurityscanner/protos/google/cloud/websecurityscanner/v1beta/finding.proto new file mode 100644 index 00000000000..999e0920d79 --- /dev/null +++ b/packages/google-cloud-websecurityscanner/protos/google/cloud/websecurityscanner/v1beta/finding.proto @@ -0,0 +1,98 @@ +// Copyright 2019 Google LLC. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// + +syntax = "proto3"; + +package google.cloud.websecurityscanner.v1beta; + +import "google/api/resource.proto"; +import "google/cloud/websecurityscanner/v1beta/finding_addon.proto"; + +option csharp_namespace = "Google.Cloud.WebSecurityScanner.V1Beta"; +option go_package = "google.golang.org/genproto/googleapis/cloud/websecurityscanner/v1beta;websecurityscanner"; +option java_multiple_files = true; +option java_outer_classname = "FindingProto"; +option java_package = "com.google.cloud.websecurityscanner.v1beta"; +option php_namespace = "Google\\Cloud\\WebSecurityScanner\\V1beta"; +option ruby_package = "Google::Cloud::WebSecurityScanner::V1beta"; + +// A Finding resource represents a vulnerability instance identified during a +// ScanRun. +message Finding { + option (google.api.resource) = { + type: "websecurityscanner.googleapis.com/Finding" + pattern: "projects/{project}/scanConfigs/{scan_config}/scanRuns/{scan_run}/findings/{finding}" + }; + + // The resource name of the Finding. The name follows the format of + // 'projects/{projectId}/scanConfigs/{scanConfigId}/scanruns/{scanRunId}/findings/{findingId}'. + // The finding IDs are generated by the system. + string name = 1; + + // The type of the Finding. + // Detailed and up-to-date information on findings can be found here: + // https://cloud.google.com/security-scanner/docs/scan-result-details + string finding_type = 2; + + // The http method of the request that triggered the vulnerability, in + // uppercase. + string http_method = 3; + + // The URL produced by the server-side fuzzer and used in the request that + // triggered the vulnerability. + string fuzzed_url = 4; + + // The body of the request that triggered the vulnerability. + string body = 5; + + // The description of the vulnerability. + string description = 6; + + // The URL containing human-readable payload that user can leverage to + // reproduce the vulnerability. + string reproduction_url = 7; + + // If the vulnerability was originated from nested IFrame, the immediate + // parent IFrame is reported. + string frame_url = 8; + + // The URL where the browser lands when the vulnerability is detected. + string final_url = 9; + + // The tracking ID uniquely identifies a vulnerability instance across + // multiple ScanRuns. + string tracking_id = 10; + + // An addon containing information reported for a vulnerability with an HTML + // form, if any. + Form form = 16; + + // An addon containing information about outdated libraries. + OutdatedLibrary outdated_library = 11; + + // An addon containing detailed information regarding any resource causing the + // vulnerability such as JavaScript sources, image, audio files, etc. + ViolatingResource violating_resource = 12; + + // An addon containing information about vulnerable or missing HTTP headers. + VulnerableHeaders vulnerable_headers = 15; + + // An addon containing information about request parameters which were found + // to be vulnerable. + VulnerableParameters vulnerable_parameters = 13; + + // An addon containing information reported for an XSS, if any. + Xss xss = 14; +} diff --git a/packages/google-cloud-websecurityscanner/protos/google/cloud/websecurityscanner/v1beta/finding_addon.proto b/packages/google-cloud-websecurityscanner/protos/google/cloud/websecurityscanner/v1beta/finding_addon.proto new file mode 100644 index 00000000000..c29f6cadd9a --- /dev/null +++ b/packages/google-cloud-websecurityscanner/protos/google/cloud/websecurityscanner/v1beta/finding_addon.proto @@ -0,0 +1,90 @@ +// Copyright 2019 Google LLC. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// + +syntax = "proto3"; + +package google.cloud.websecurityscanner.v1beta; + +option csharp_namespace = "Google.Cloud.WebSecurityScanner.V1Beta"; +option go_package = "google.golang.org/genproto/googleapis/cloud/websecurityscanner/v1beta;websecurityscanner"; +option java_multiple_files = true; +option java_outer_classname = "FindingAddonProto"; +option java_package = "com.google.cloud.websecurityscanner.v1beta"; +option php_namespace = "Google\\Cloud\\WebSecurityScanner\\V1beta"; +option ruby_package = "Google::Cloud::WebSecurityScanner::V1beta"; + +// ! Information about a vulnerability with an HTML. +message Form { + // ! The URI where to send the form when it's submitted. + string action_uri = 1; + + // ! The names of form fields related to the vulnerability. + repeated string fields = 2; +} + +// Information reported for an outdated library. +message OutdatedLibrary { + // The name of the outdated library. + string library_name = 1; + + // The version number. + string version = 2; + + // URLs to learn more information about the vulnerabilities in the library. + repeated string learn_more_urls = 3; +} + +// Information regarding any resource causing the vulnerability such +// as JavaScript sources, image, audio files, etc. +message ViolatingResource { + // The MIME type of this resource. + string content_type = 1; + + // URL of this violating resource. + string resource_url = 2; +} + +// Information about vulnerable request parameters. +message VulnerableParameters { + // The vulnerable parameter names. + repeated string parameter_names = 1; +} + +// Information about vulnerable or missing HTTP Headers. +message VulnerableHeaders { + // Describes a HTTP Header. + message Header { + // Header name. + string name = 1; + + // Header value. + string value = 2; + } + + // List of vulnerable headers. + repeated Header headers = 1; + + // List of missing headers. + repeated Header missing_headers = 2; +} + +// Information reported for an XSS. +message Xss { + // Stack traces leading to the point where the XSS occurred. + repeated string stack_traces = 1; + + // An error message generated by a javascript breakage. + string error_message = 2; +} diff --git a/packages/google-cloud-websecurityscanner/protos/google/cloud/websecurityscanner/v1beta/finding_type_stats.proto b/packages/google-cloud-websecurityscanner/protos/google/cloud/websecurityscanner/v1beta/finding_type_stats.proto new file mode 100644 index 00000000000..9b215761819 --- /dev/null +++ b/packages/google-cloud-websecurityscanner/protos/google/cloud/websecurityscanner/v1beta/finding_type_stats.proto @@ -0,0 +1,36 @@ +// Copyright 2019 Google LLC. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// + +syntax = "proto3"; + +package google.cloud.websecurityscanner.v1beta; + +option csharp_namespace = "Google.Cloud.WebSecurityScanner.V1Beta"; +option go_package = "google.golang.org/genproto/googleapis/cloud/websecurityscanner/v1beta;websecurityscanner"; +option java_multiple_files = true; +option java_outer_classname = "FindingTypeStatsProto"; +option java_package = "com.google.cloud.websecurityscanner.v1beta"; +option php_namespace = "Google\\Cloud\\WebSecurityScanner\\V1beta"; +option ruby_package = "Google::Cloud::WebSecurityScanner::V1beta"; + +// A FindingTypeStats resource represents stats regarding a specific FindingType +// of Findings under a given ScanRun. +message FindingTypeStats { + // The finding type associated with the stats. + string finding_type = 1; + + // The count of findings belonging to this finding type. + int32 finding_count = 2; +} diff --git a/packages/google-cloud-websecurityscanner/protos/google/cloud/websecurityscanner/v1beta/scan_config.proto b/packages/google-cloud-websecurityscanner/protos/google/cloud/websecurityscanner/v1beta/scan_config.proto new file mode 100644 index 00000000000..b25c6198415 --- /dev/null +++ b/packages/google-cloud-websecurityscanner/protos/google/cloud/websecurityscanner/v1beta/scan_config.proto @@ -0,0 +1,193 @@ +// Copyright 2019 Google LLC. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// + +syntax = "proto3"; + +package google.cloud.websecurityscanner.v1beta; + +import "google/api/field_behavior.proto"; +import "google/api/resource.proto"; +import "google/cloud/websecurityscanner/v1beta/scan_run.proto"; +import "google/protobuf/timestamp.proto"; + +option csharp_namespace = "Google.Cloud.WebSecurityScanner.V1Beta"; +option go_package = "google.golang.org/genproto/googleapis/cloud/websecurityscanner/v1beta;websecurityscanner"; +option java_multiple_files = true; +option java_outer_classname = "ScanConfigProto"; +option java_package = "com.google.cloud.websecurityscanner.v1beta"; +option php_namespace = "Google\\Cloud\\WebSecurityScanner\\V1beta"; +option ruby_package = "Google::Cloud::WebSecurityScanner::V1beta"; + +// A ScanConfig resource contains the configurations to launch a scan. +message ScanConfig { + option (google.api.resource) = { + type: "websecurityscanner.googleapis.com/ScanConfig" + pattern: "projects/{project}/scanConfigs/{scan_config}" + }; + + // Scan authentication configuration. + message Authentication { + // Describes authentication configuration that uses a Google account. + message GoogleAccount { + // Required. The user name of the Google account. + string username = 1 [(google.api.field_behavior) = REQUIRED]; + + // Required. Input only. The password of the Google account. The credential is stored encrypted + // and not returned in any response nor included in audit logs. + string password = 2 [ + (google.api.field_behavior) = REQUIRED, + (google.api.field_behavior) = INPUT_ONLY + ]; + } + + // Describes authentication configuration that uses a custom account. + message CustomAccount { + // Required. The user name of the custom account. + string username = 1 [(google.api.field_behavior) = REQUIRED]; + + // Required. Input only. The password of the custom account. The credential is stored encrypted + // and not returned in any response nor included in audit logs. + string password = 2 [ + (google.api.field_behavior) = REQUIRED, + (google.api.field_behavior) = INPUT_ONLY + ]; + + // Required. The login form URL of the website. + string login_url = 3 [(google.api.field_behavior) = REQUIRED]; + } + + // Required. + // Authentication configuration + oneof authentication { + // Authentication using a Google account. + GoogleAccount google_account = 1; + + // Authentication using a custom account. + CustomAccount custom_account = 2; + } + } + + // Scan schedule configuration. + message Schedule { + // A timestamp indicates when the next run will be scheduled. The value is + // refreshed by the server after each run. If unspecified, it will default + // to current server time, which means the scan will be scheduled to start + // immediately. + google.protobuf.Timestamp schedule_time = 1; + + // Required. The duration of time between executions in days. + int32 interval_duration_days = 2 [(google.api.field_behavior) = REQUIRED]; + } + + // Type of user agents used for scanning. + enum UserAgent { + // The user agent is unknown. Service will default to CHROME_LINUX. + USER_AGENT_UNSPECIFIED = 0; + + // Chrome on Linux. This is the service default if unspecified. + CHROME_LINUX = 1; + + // Chrome on Android. + CHROME_ANDROID = 2; + + // Safari on IPhone. + SAFARI_IPHONE = 3; + } + + // Cloud platforms supported by Cloud Web Security Scanner. + enum TargetPlatform { + // The target platform is unknown. Requests with this enum value will be + // rejected with INVALID_ARGUMENT error. + TARGET_PLATFORM_UNSPECIFIED = 0; + + // Google App Engine service. + APP_ENGINE = 1; + + // Google Compute Engine service. + COMPUTE = 2; + } + + // Scan risk levels supported by Cloud Web Security Scanner. LOW impact + // scanning will minimize requests with the potential to modify data. To + // achieve the maximum scan coverage, NORMAL risk level is recommended. + enum RiskLevel { + // Use default, which is NORMAL. + RISK_LEVEL_UNSPECIFIED = 0; + + // Normal scanning (Recommended) + NORMAL = 1; + + // Lower impact scanning + LOW = 2; + } + + // Controls export of scan configurations and results to Cloud Security + // Command Center. + enum ExportToSecurityCommandCenter { + // Use default, which is ENABLED. + EXPORT_TO_SECURITY_COMMAND_CENTER_UNSPECIFIED = 0; + + // Export results of this scan to Cloud Security Command Center. + ENABLED = 1; + + // Do not export results of this scan to Cloud Security Command Center. + DISABLED = 2; + } + + // The resource name of the ScanConfig. The name follows the format of + // 'projects/{projectId}/scanConfigs/{scanConfigId}'. The ScanConfig IDs are + // generated by the system. + string name = 1; + + // Required. The user provided display name of the ScanConfig. + string display_name = 2 [(google.api.field_behavior) = REQUIRED]; + + // The maximum QPS during scanning. A valid value ranges from 5 to 20 + // inclusively. If the field is unspecified or its value is set 0, server will + // default to 15. Other values outside of [5, 20] range will be rejected with + // INVALID_ARGUMENT error. + int32 max_qps = 3; + + // Required. The starting URLs from which the scanner finds site pages. + repeated string starting_urls = 4 [(google.api.field_behavior) = REQUIRED]; + + // The authentication configuration. If specified, service will use the + // authentication configuration during scanning. + Authentication authentication = 5; + + // The user agent used during scanning. + UserAgent user_agent = 6; + + // The blacklist URL patterns as described in + // https://cloud.google.com/security-scanner/docs/excluded-urls + repeated string blacklist_patterns = 7; + + // The schedule of the ScanConfig. + Schedule schedule = 8; + + // Set of Cloud Platforms targeted by the scan. If empty, APP_ENGINE will be + // used as a default. + repeated TargetPlatform target_platforms = 9; + + // Controls export of scan configurations and results to Cloud Security + // Command Center. + ExportToSecurityCommandCenter export_to_security_command_center = 10; + + // Latest ScanRun if available. + ScanRun latest_run = 11; + + // The risk level selected for the scan + RiskLevel risk_level = 12; +} diff --git a/packages/google-cloud-websecurityscanner/protos/google/cloud/websecurityscanner/v1beta/scan_config_error.proto b/packages/google-cloud-websecurityscanner/protos/google/cloud/websecurityscanner/v1beta/scan_config_error.proto new file mode 100644 index 00000000000..3920b74fdc7 --- /dev/null +++ b/packages/google-cloud-websecurityscanner/protos/google/cloud/websecurityscanner/v1beta/scan_config_error.proto @@ -0,0 +1,190 @@ +// Copyright 2019 Google LLC. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// + +syntax = "proto3"; + +package google.cloud.websecurityscanner.v1beta; + +option csharp_namespace = "Google.Cloud.WebSecurityScanner.V1Beta"; +option go_package = "google.golang.org/genproto/googleapis/cloud/websecurityscanner/v1beta;websecurityscanner"; +option java_multiple_files = true; +option java_outer_classname = "ScanConfigErrorProto"; +option java_package = "com.google.cloud.websecurityscanner.v1beta"; +option php_namespace = "Google\\Cloud\\WebSecurityScanner\\V1beta"; +option ruby_package = "Google::Cloud::WebSecurityScanner::V1beta"; + +// Defines a custom error message used by CreateScanConfig and UpdateScanConfig +// APIs when scan configuration validation fails. It is also reported as part of +// a ScanRunErrorTrace message if scan validation fails due to a scan +// configuration error. +message ScanConfigError { + // Output only. + // Defines an error reason code. + // Next id: 44 + enum Code { + option allow_alias = true; + + // There is no error. + CODE_UNSPECIFIED = 0; + + // There is no error. + OK = 0; + + // Indicates an internal server error. + // Please DO NOT USE THIS ERROR CODE unless the root cause is truly unknown. + INTERNAL_ERROR = 1; + + // One of the seed URLs is an App Engine URL but we cannot validate the scan + // settings due to an App Engine API backend error. + APPENGINE_API_BACKEND_ERROR = 2; + + // One of the seed URLs is an App Engine URL but we cannot access the + // App Engine API to validate scan settings. + APPENGINE_API_NOT_ACCESSIBLE = 3; + + // One of the seed URLs is an App Engine URL but the Default Host of the + // App Engine is not set. + APPENGINE_DEFAULT_HOST_MISSING = 4; + + // Google corporate accounts can not be used for scanning. + CANNOT_USE_GOOGLE_COM_ACCOUNT = 6; + + // The account of the scan creator can not be used for scanning. + CANNOT_USE_OWNER_ACCOUNT = 7; + + // This scan targets Compute Engine, but we cannot validate scan settings + // due to a Compute Engine API backend error. + COMPUTE_API_BACKEND_ERROR = 8; + + // This scan targets Compute Engine, but we cannot access the Compute Engine + // API to validate the scan settings. + COMPUTE_API_NOT_ACCESSIBLE = 9; + + // The Custom Login URL does not belong to the current project. + CUSTOM_LOGIN_URL_DOES_NOT_BELONG_TO_CURRENT_PROJECT = 10; + + // The Custom Login URL is malformed (can not be parsed). + CUSTOM_LOGIN_URL_MALFORMED = 11; + + // The Custom Login URL is mapped to a non-routable IP address in DNS. + CUSTOM_LOGIN_URL_MAPPED_TO_NON_ROUTABLE_ADDRESS = 12; + + // The Custom Login URL is mapped to an IP address which is not reserved for + // the current project. + CUSTOM_LOGIN_URL_MAPPED_TO_UNRESERVED_ADDRESS = 13; + + // The Custom Login URL has a non-routable IP address. + CUSTOM_LOGIN_URL_HAS_NON_ROUTABLE_IP_ADDRESS = 14; + + // The Custom Login URL has an IP address which is not reserved for the + // current project. + CUSTOM_LOGIN_URL_HAS_UNRESERVED_IP_ADDRESS = 15; + + // Another scan with the same name (case-sensitive) already exists. + DUPLICATE_SCAN_NAME = 16; + + // A field is set to an invalid value. + INVALID_FIELD_VALUE = 18; + + // There was an error trying to authenticate to the scan target. + FAILED_TO_AUTHENTICATE_TO_TARGET = 19; + + // Finding type value is not specified in the list findings request. + FINDING_TYPE_UNSPECIFIED = 20; + + // Scan targets Compute Engine, yet current project was not whitelisted for + // Google Compute Engine Scanning Alpha access. + FORBIDDEN_TO_SCAN_COMPUTE = 21; + + // User tries to update managed scan + FORBIDDEN_UPDATE_TO_MANAGED_SCAN = 43; + + // The supplied filter is malformed. For example, it can not be parsed, does + // not have a filter type in expression, or the same filter type appears + // more than once. + MALFORMED_FILTER = 22; + + // The supplied resource name is malformed (can not be parsed). + MALFORMED_RESOURCE_NAME = 23; + + // The current project is not in an active state. + PROJECT_INACTIVE = 24; + + // A required field is not set. + REQUIRED_FIELD = 25; + + // Project id, scanconfig id, scanrun id, or finding id are not consistent + // with each other in resource name. + RESOURCE_NAME_INCONSISTENT = 26; + + // The scan being requested to start is already running. + SCAN_ALREADY_RUNNING = 27; + + // The scan that was requested to be stopped is not running. + SCAN_NOT_RUNNING = 28; + + // One of the seed URLs does not belong to the current project. + SEED_URL_DOES_NOT_BELONG_TO_CURRENT_PROJECT = 29; + + // One of the seed URLs is malformed (can not be parsed). + SEED_URL_MALFORMED = 30; + + // One of the seed URLs is mapped to a non-routable IP address in DNS. + SEED_URL_MAPPED_TO_NON_ROUTABLE_ADDRESS = 31; + + // One of the seed URLs is mapped to an IP address which is not reserved + // for the current project. + SEED_URL_MAPPED_TO_UNRESERVED_ADDRESS = 32; + + // One of the seed URLs has on-routable IP address. + SEED_URL_HAS_NON_ROUTABLE_IP_ADDRESS = 33; + + // One of the seed URLs has an IP address that is not reserved + // for the current project. + SEED_URL_HAS_UNRESERVED_IP_ADDRESS = 35; + + // The Cloud Security Scanner service account is not configured under the + // project. + SERVICE_ACCOUNT_NOT_CONFIGURED = 36; + + // A project has reached the maximum number of scans. + TOO_MANY_SCANS = 37; + + // Resolving the details of the current project fails. + UNABLE_TO_RESOLVE_PROJECT_INFO = 38; + + // One or more blacklist patterns were in the wrong format. + UNSUPPORTED_BLACKLIST_PATTERN_FORMAT = 39; + + // The supplied filter is not supported. + UNSUPPORTED_FILTER = 40; + + // The supplied finding type is not supported. For example, we do not + // provide findings of the given finding type. + UNSUPPORTED_FINDING_TYPE = 41; + + // The URL scheme of one or more of the supplied URLs is not supported. + UNSUPPORTED_URL_SCHEME = 42; + } + + // Indicates the reason code for a configuration failure. + Code code = 1; + + // Indicates the full name of the ScanConfig field that triggers this error, + // for example "scan_config.max_qps". This field is provided for + // troubleshooting purposes only and its actual value can change in the + // future. + string field_name = 2; +} diff --git a/packages/google-cloud-websecurityscanner/protos/google/cloud/websecurityscanner/v1beta/scan_run.proto b/packages/google-cloud-websecurityscanner/protos/google/cloud/websecurityscanner/v1beta/scan_run.proto new file mode 100644 index 00000000000..48800d247e2 --- /dev/null +++ b/packages/google-cloud-websecurityscanner/protos/google/cloud/websecurityscanner/v1beta/scan_run.proto @@ -0,0 +1,117 @@ +// Copyright 2019 Google LLC. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// + +syntax = "proto3"; + +package google.cloud.websecurityscanner.v1beta; + +import "google/api/resource.proto"; +import "google/cloud/websecurityscanner/v1beta/scan_run_error_trace.proto"; +import "google/cloud/websecurityscanner/v1beta/scan_run_warning_trace.proto"; +import "google/protobuf/timestamp.proto"; + +option csharp_namespace = "Google.Cloud.WebSecurityScanner.V1Beta"; +option go_package = "google.golang.org/genproto/googleapis/cloud/websecurityscanner/v1beta;websecurityscanner"; +option java_multiple_files = true; +option java_outer_classname = "ScanRunProto"; +option java_package = "com.google.cloud.websecurityscanner.v1beta"; +option php_namespace = "Google\\Cloud\\WebSecurityScanner\\V1beta"; +option ruby_package = "Google::Cloud::WebSecurityScanner::V1beta"; + +// A ScanRun is a output-only resource representing an actual run of the scan. +// Next id: 12 +message ScanRun { + option (google.api.resource) = { + type: "websecurityscanner.googleapis.com/ScanRun" + pattern: "projects/{project}/scanConfigs/{scan_config}/scanRuns/{scan_run}" + }; + + // Types of ScanRun execution state. + enum ExecutionState { + // Represents an invalid state caused by internal server error. This value + // should never be returned. + EXECUTION_STATE_UNSPECIFIED = 0; + + // The scan is waiting in the queue. + QUEUED = 1; + + // The scan is in progress. + SCANNING = 2; + + // The scan is either finished or stopped by user. + FINISHED = 3; + } + + // Types of ScanRun result state. + enum ResultState { + // Default value. This value is returned when the ScanRun is not yet + // finished. + RESULT_STATE_UNSPECIFIED = 0; + + // The scan finished without errors. + SUCCESS = 1; + + // The scan finished with errors. + ERROR = 2; + + // The scan was terminated by user. + KILLED = 3; + } + + // The resource name of the ScanRun. The name follows the format of + // 'projects/{projectId}/scanConfigs/{scanConfigId}/scanRuns/{scanRunId}'. + // The ScanRun IDs are generated by the system. + string name = 1; + + // The execution state of the ScanRun. + ExecutionState execution_state = 2; + + // The result state of the ScanRun. This field is only available after the + // execution state reaches "FINISHED". + ResultState result_state = 3; + + // The time at which the ScanRun started. + google.protobuf.Timestamp start_time = 4; + + // The time at which the ScanRun reached termination state - that the ScanRun + // is either finished or stopped by user. + google.protobuf.Timestamp end_time = 5; + + // The number of URLs crawled during this ScanRun. If the scan is in progress, + // the value represents the number of URLs crawled up to now. + int64 urls_crawled_count = 6; + + // The number of URLs tested during this ScanRun. If the scan is in progress, + // the value represents the number of URLs tested up to now. The number of + // URLs tested is usually larger than the number URLS crawled because + // typically a crawled URL is tested with multiple test payloads. + int64 urls_tested_count = 7; + + // Whether the scan run has found any vulnerabilities. + bool has_vulnerabilities = 8; + + // The percentage of total completion ranging from 0 to 100. + // If the scan is in queue, the value is 0. + // If the scan is running, the value ranges from 0 to 100. + // If the scan is finished, the value is 100. + int32 progress_percent = 9; + + // If result_state is an ERROR, this field provides the primary reason for + // scan's termination and more details, if such are available. + ScanRunErrorTrace error_trace = 10; + + // A list of warnings, if such are encountered during this scan run. + repeated ScanRunWarningTrace warning_traces = 11; +} diff --git a/packages/google-cloud-websecurityscanner/protos/google/cloud/websecurityscanner/v1beta/scan_run_error_trace.proto b/packages/google-cloud-websecurityscanner/protos/google/cloud/websecurityscanner/v1beta/scan_run_error_trace.proto new file mode 100644 index 00000000000..acbdef2bdf5 --- /dev/null +++ b/packages/google-cloud-websecurityscanner/protos/google/cloud/websecurityscanner/v1beta/scan_run_error_trace.proto @@ -0,0 +1,76 @@ +// Copyright 2019 Google LLC. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// + +syntax = "proto3"; + +package google.cloud.websecurityscanner.v1beta; + +import "google/cloud/websecurityscanner/v1beta/scan_config_error.proto"; + +option csharp_namespace = "Google.Cloud.WebSecurityScanner.V1Beta"; +option go_package = "google.golang.org/genproto/googleapis/cloud/websecurityscanner/v1beta;websecurityscanner"; +option java_multiple_files = true; +option java_outer_classname = "ScanRunErrorTraceProto"; +option java_package = "com.google.cloud.websecurityscanner.v1beta"; +option php_namespace = "Google\\Cloud\\WebSecurityScanner\\V1beta"; +option ruby_package = "Google::Cloud::WebSecurityScanner::V1beta"; + +// Output only. +// Defines an error trace message for a ScanRun. +message ScanRunErrorTrace { + // Output only. + // Defines an error reason code. + // Next id: 7 + enum Code { + // Default value is never used. + CODE_UNSPECIFIED = 0; + + // Indicates that the scan run failed due to an internal server error. + INTERNAL_ERROR = 1; + + // Indicates a scan configuration error, usually due to outdated ScanConfig + // settings, such as starting_urls or the DNS configuration. + SCAN_CONFIG_ISSUE = 2; + + // Indicates an authentication error, usually due to outdated ScanConfig + // authentication settings. + AUTHENTICATION_CONFIG_ISSUE = 3; + + // Indicates a scan operation timeout, usually caused by a very large site. + TIMED_OUT_WHILE_SCANNING = 4; + + // Indicates that a scan encountered excessive redirects, either to + // authentication or some other page outside of the scan scope. + TOO_MANY_REDIRECTS = 5; + + // Indicates that a scan encountered numerous errors from the web site + // pages. When available, most_common_http_error_code field indicates the + // most common HTTP error code encountered during the scan. + TOO_MANY_HTTP_ERRORS = 6; + } + + // Indicates the error reason code. + Code code = 1; + + // If the scan encounters SCAN_CONFIG_ISSUE error, this field has the error + // message encountered during scan configuration validation that is performed + // before each scan run. + ScanConfigError scan_config_error = 2; + + // If the scan encounters TOO_MANY_HTTP_ERRORS, this field indicates the most + // common HTTP error code, if such is available. For example, if this code is + // 404, the scan has encountered too many NOT_FOUND responses. + int32 most_common_http_error_code = 3; +} diff --git a/packages/google-cloud-websecurityscanner/protos/google/cloud/websecurityscanner/v1beta/scan_run_warning_trace.proto b/packages/google-cloud-websecurityscanner/protos/google/cloud/websecurityscanner/v1beta/scan_run_warning_trace.proto new file mode 100644 index 00000000000..6ee6b347496 --- /dev/null +++ b/packages/google-cloud-websecurityscanner/protos/google/cloud/websecurityscanner/v1beta/scan_run_warning_trace.proto @@ -0,0 +1,59 @@ +// Copyright 2019 Google LLC. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// + +syntax = "proto3"; + +package google.cloud.websecurityscanner.v1beta; + +option csharp_namespace = "Google.Cloud.WebSecurityScanner.V1Beta"; +option go_package = "google.golang.org/genproto/googleapis/cloud/websecurityscanner/v1beta;websecurityscanner"; +option java_multiple_files = true; +option java_outer_classname = "ScanRunWarningTraceProto"; +option java_package = "com.google.cloud.websecurityscanner.v1beta"; +option php_namespace = "Google\\Cloud\\WebSecurityScanner\\V1beta"; +option ruby_package = "Google::Cloud::WebSecurityScanner::V1beta"; + +// Output only. +// Defines a warning trace message for ScanRun. Warning traces provide customers +// with useful information that helps make the scanning process more effective. +message ScanRunWarningTrace { + // Output only. + // Defines a warning message code. + // Next id: 6 + enum Code { + // Default value is never used. + CODE_UNSPECIFIED = 0; + + // Indicates that a scan discovered an unexpectedly low number of URLs. This + // is sometimes caused by complex navigation features or by using a single + // URL for numerous pages. + INSUFFICIENT_CRAWL_RESULTS = 1; + + // Indicates that a scan discovered too many URLs to test, or excessive + // redundant URLs. + TOO_MANY_CRAWL_RESULTS = 2; + + // Indicates that too many tests have been generated for the scan. Customer + // should try reducing the number of starting URLs, increasing the QPS rate, + // or narrowing down the scope of the scan using the excluded patterns. + TOO_MANY_FUZZ_TASKS = 3; + + // Indicates that a scan is blocked by IAP. + BLOCKED_BY_IAP = 4; + } + + // Indicates the warning code. + Code code = 1; +} diff --git a/packages/google-cloud-websecurityscanner/protos/google/cloud/websecurityscanner/v1beta/web_security_scanner.proto b/packages/google-cloud-websecurityscanner/protos/google/cloud/websecurityscanner/v1beta/web_security_scanner.proto new file mode 100644 index 00000000000..79be175b5cf --- /dev/null +++ b/packages/google-cloud-websecurityscanner/protos/google/cloud/websecurityscanner/v1beta/web_security_scanner.proto @@ -0,0 +1,413 @@ +// Copyright 2019 Google LLC. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// + +syntax = "proto3"; + +package google.cloud.websecurityscanner.v1beta; + +import "google/api/annotations.proto"; +import "google/api/client.proto"; +import "google/api/field_behavior.proto"; +import "google/api/resource.proto"; +import "google/cloud/websecurityscanner/v1beta/crawled_url.proto"; +import "google/cloud/websecurityscanner/v1beta/finding.proto"; +import "google/cloud/websecurityscanner/v1beta/finding_type_stats.proto"; +import "google/cloud/websecurityscanner/v1beta/scan_config.proto"; +import "google/cloud/websecurityscanner/v1beta/scan_run.proto"; +import "google/protobuf/empty.proto"; +import "google/protobuf/field_mask.proto"; + +option csharp_namespace = "Google.Cloud.WebSecurityScanner.V1Beta"; +option go_package = "google.golang.org/genproto/googleapis/cloud/websecurityscanner/v1beta;websecurityscanner"; +option java_multiple_files = true; +option java_outer_classname = "WebSecurityScannerProto"; +option java_package = "com.google.cloud.websecurityscanner.v1beta"; +option php_namespace = "Google\\Cloud\\WebSecurityScanner\\V1beta"; +option ruby_package = "Google::Cloud::WebSecurityScanner::V1beta"; + +// Cloud Web Security Scanner Service identifies security vulnerabilities in web +// applications hosted on Google Cloud Platform. It crawls your application, and +// attempts to exercise as many user inputs and event handlers as possible. +service WebSecurityScanner { + option (google.api.default_host) = "websecurityscanner.googleapis.com"; + option (google.api.oauth_scopes) = "https://www.googleapis.com/auth/cloud-platform"; + + // Creates a new ScanConfig. + rpc CreateScanConfig(CreateScanConfigRequest) returns (ScanConfig) { + option (google.api.http) = { + post: "/v1beta/{parent=projects/*}/scanConfigs" + body: "scan_config" + }; + option (google.api.method_signature) = "parent,scan_config"; + } + + // Deletes an existing ScanConfig and its child resources. + rpc DeleteScanConfig(DeleteScanConfigRequest) returns (google.protobuf.Empty) { + option (google.api.http) = { + delete: "/v1beta/{name=projects/*/scanConfigs/*}" + }; + option (google.api.method_signature) = "name"; + } + + // Gets a ScanConfig. + rpc GetScanConfig(GetScanConfigRequest) returns (ScanConfig) { + option (google.api.http) = { + get: "/v1beta/{name=projects/*/scanConfigs/*}" + }; + option (google.api.method_signature) = "name"; + } + + // Lists ScanConfigs under a given project. + rpc ListScanConfigs(ListScanConfigsRequest) returns (ListScanConfigsResponse) { + option (google.api.http) = { + get: "/v1beta/{parent=projects/*}/scanConfigs" + }; + option (google.api.method_signature) = "parent"; + } + + // Updates a ScanConfig. This method support partial update of a ScanConfig. + rpc UpdateScanConfig(UpdateScanConfigRequest) returns (ScanConfig) { + option (google.api.http) = { + patch: "/v1beta/{scan_config.name=projects/*/scanConfigs/*}" + body: "scan_config" + }; + option (google.api.method_signature) = "scan_config,update_mask"; + } + + // Start a ScanRun according to the given ScanConfig. + rpc StartScanRun(StartScanRunRequest) returns (ScanRun) { + option (google.api.http) = { + post: "/v1beta/{name=projects/*/scanConfigs/*}:start" + body: "*" + }; + option (google.api.method_signature) = "name"; + } + + // Gets a ScanRun. + rpc GetScanRun(GetScanRunRequest) returns (ScanRun) { + option (google.api.http) = { + get: "/v1beta/{name=projects/*/scanConfigs/*/scanRuns/*}" + }; + option (google.api.method_signature) = "name"; + } + + // Lists ScanRuns under a given ScanConfig, in descending order of ScanRun + // stop time. + rpc ListScanRuns(ListScanRunsRequest) returns (ListScanRunsResponse) { + option (google.api.http) = { + get: "/v1beta/{parent=projects/*/scanConfigs/*}/scanRuns" + }; + option (google.api.method_signature) = "parent"; + } + + // Stops a ScanRun. The stopped ScanRun is returned. + rpc StopScanRun(StopScanRunRequest) returns (ScanRun) { + option (google.api.http) = { + post: "/v1beta/{name=projects/*/scanConfigs/*/scanRuns/*}:stop" + body: "*" + }; + option (google.api.method_signature) = "name"; + } + + // List CrawledUrls under a given ScanRun. + rpc ListCrawledUrls(ListCrawledUrlsRequest) returns (ListCrawledUrlsResponse) { + option (google.api.http) = { + get: "/v1beta/{parent=projects/*/scanConfigs/*/scanRuns/*}/crawledUrls" + }; + option (google.api.method_signature) = "parent"; + } + + // Gets a Finding. + rpc GetFinding(GetFindingRequest) returns (Finding) { + option (google.api.http) = { + get: "/v1beta/{name=projects/*/scanConfigs/*/scanRuns/*/findings/*}" + }; + option (google.api.method_signature) = "name"; + } + + // List Findings under a given ScanRun. + rpc ListFindings(ListFindingsRequest) returns (ListFindingsResponse) { + option (google.api.http) = { + get: "/v1beta/{parent=projects/*/scanConfigs/*/scanRuns/*}/findings" + }; + option (google.api.method_signature) = "parent,filter"; + } + + // List all FindingTypeStats under a given ScanRun. + rpc ListFindingTypeStats(ListFindingTypeStatsRequest) returns (ListFindingTypeStatsResponse) { + option (google.api.http) = { + get: "/v1beta/{parent=projects/*/scanConfigs/*/scanRuns/*}/findingTypeStats" + }; + option (google.api.method_signature) = "parent"; + } +} + +// Request for the `CreateScanConfig` method. +message CreateScanConfigRequest { + // Required. The parent resource name where the scan is created, which should be a + // project resource name in the format 'projects/{projectId}'. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "cloudresourcemanager.googleapis.com/Project" + } + ]; + + // Required. The ScanConfig to be created. + ScanConfig scan_config = 2 [(google.api.field_behavior) = REQUIRED]; +} + +// Request for the `DeleteScanConfig` method. +message DeleteScanConfigRequest { + // Required. The resource name of the ScanConfig to be deleted. The name follows the + // format of 'projects/{projectId}/scanConfigs/{scanConfigId}'. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "websecurityscanner.googleapis.com/ScanConfig" + } + ]; +} + +// Request for the `GetScanConfig` method. +message GetScanConfigRequest { + // Required. The resource name of the ScanConfig to be returned. The name follows the + // format of 'projects/{projectId}/scanConfigs/{scanConfigId}'. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "websecurityscanner.googleapis.com/ScanConfig" + } + ]; +} + +// Request for the `ListScanConfigs` method. +message ListScanConfigsRequest { + // Required. The parent resource name, which should be a project resource name in the + // format 'projects/{projectId}'. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "cloudresourcemanager.googleapis.com/Project" + } + ]; + + // A token identifying a page of results to be returned. This should be a + // `next_page_token` value returned from a previous List request. + // If unspecified, the first page of results is returned. + string page_token = 2; + + // The maximum number of ScanConfigs to return, can be limited by server. + // If not specified or not positive, the implementation will select a + // reasonable value. + int32 page_size = 3; +} + +// Request for the `UpdateScanConfigRequest` method. +message UpdateScanConfigRequest { + // Required. The ScanConfig to be updated. The name field must be set to identify the + // resource to be updated. The values of fields not covered by the mask + // will be ignored. + ScanConfig scan_config = 2 [(google.api.field_behavior) = REQUIRED]; + + // Required. The update mask applies to the resource. For the `FieldMask` definition, + // see + // https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#fieldmask + google.protobuf.FieldMask update_mask = 3 [(google.api.field_behavior) = REQUIRED]; +} + +// Response for the `ListScanConfigs` method. +message ListScanConfigsResponse { + // The list of ScanConfigs returned. + repeated ScanConfig scan_configs = 1; + + // Token to retrieve the next page of results, or empty if there are no + // more results in the list. + string next_page_token = 2; +} + +// Request for the `StartScanRun` method. +message StartScanRunRequest { + // Required. The resource name of the ScanConfig to be used. The name follows the + // format of 'projects/{projectId}/scanConfigs/{scanConfigId}'. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "websecurityscanner.googleapis.com/ScanConfig" + } + ]; +} + +// Request for the `GetScanRun` method. +message GetScanRunRequest { + // Required. The resource name of the ScanRun to be returned. The name follows the + // format of + // 'projects/{projectId}/scanConfigs/{scanConfigId}/scanRuns/{scanRunId}'. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "websecurityscanner.googleapis.com/ScanRun" + } + ]; +} + +// Request for the `ListScanRuns` method. +message ListScanRunsRequest { + // Required. The parent resource name, which should be a scan resource name in the + // format 'projects/{projectId}/scanConfigs/{scanConfigId}'. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "websecurityscanner.googleapis.com/ScanConfig" + } + ]; + + // A token identifying a page of results to be returned. This should be a + // `next_page_token` value returned from a previous List request. + // If unspecified, the first page of results is returned. + string page_token = 2; + + // The maximum number of ScanRuns to return, can be limited by server. + // If not specified or not positive, the implementation will select a + // reasonable value. + int32 page_size = 3; +} + +// Response for the `ListScanRuns` method. +message ListScanRunsResponse { + // The list of ScanRuns returned. + repeated ScanRun scan_runs = 1; + + // Token to retrieve the next page of results, or empty if there are no + // more results in the list. + string next_page_token = 2; +} + +// Request for the `StopScanRun` method. +message StopScanRunRequest { + // Required. The resource name of the ScanRun to be stopped. The name follows the + // format of + // 'projects/{projectId}/scanConfigs/{scanConfigId}/scanRuns/{scanRunId}'. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "websecurityscanner.googleapis.com/ScanRun" + } + ]; +} + +// Request for the `ListCrawledUrls` method. +message ListCrawledUrlsRequest { + // Required. The parent resource name, which should be a scan run resource name in the + // format + // 'projects/{projectId}/scanConfigs/{scanConfigId}/scanRuns/{scanRunId}'. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "websecurityscanner.googleapis.com/ScanRun" + } + ]; + + // A token identifying a page of results to be returned. This should be a + // `next_page_token` value returned from a previous List request. + // If unspecified, the first page of results is returned. + string page_token = 2; + + // The maximum number of CrawledUrls to return, can be limited by server. + // If not specified or not positive, the implementation will select a + // reasonable value. + int32 page_size = 3; +} + +// Response for the `ListCrawledUrls` method. +message ListCrawledUrlsResponse { + // The list of CrawledUrls returned. + repeated CrawledUrl crawled_urls = 1; + + // Token to retrieve the next page of results, or empty if there are no + // more results in the list. + string next_page_token = 2; +} + +// Request for the `GetFinding` method. +message GetFindingRequest { + // Required. The resource name of the Finding to be returned. The name follows the + // format of + // 'projects/{projectId}/scanConfigs/{scanConfigId}/scanRuns/{scanRunId}/findings/{findingId}'. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "websecurityscanner.googleapis.com/Finding" + } + ]; +} + +// Request for the `ListFindings` method. +message ListFindingsRequest { + // Required. The parent resource name, which should be a scan run resource name in the + // format + // 'projects/{projectId}/scanConfigs/{scanConfigId}/scanRuns/{scanRunId}'. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "websecurityscanner.googleapis.com/ScanRun" + } + ]; + + // Required. The filter expression. The expression must be in the format: + // . + // Supported field: 'finding_type'. + // Supported operator: '='. + string filter = 2 [(google.api.field_behavior) = REQUIRED]; + + // A token identifying a page of results to be returned. This should be a + // `next_page_token` value returned from a previous List request. + // If unspecified, the first page of results is returned. + string page_token = 3; + + // The maximum number of Findings to return, can be limited by server. + // If not specified or not positive, the implementation will select a + // reasonable value. + int32 page_size = 4; +} + +// Response for the `ListFindings` method. +message ListFindingsResponse { + // The list of Findings returned. + repeated Finding findings = 1; + + // Token to retrieve the next page of results, or empty if there are no + // more results in the list. + string next_page_token = 2; +} + +// Request for the `ListFindingTypeStats` method. +message ListFindingTypeStatsRequest { + // Required. The parent resource name, which should be a scan run resource name in the + // format + // 'projects/{projectId}/scanConfigs/{scanConfigId}/scanRuns/{scanRunId}'. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "websecurityscanner.googleapis.com/ScanRun" + } + ]; +} + +// Response for the `ListFindingTypeStats` method. +message ListFindingTypeStatsResponse { + // The list of FindingTypeStats returned. + repeated FindingTypeStats finding_type_stats = 1; +} diff --git a/packages/google-cloud-websecurityscanner/protos/protos.d.ts b/packages/google-cloud-websecurityscanner/protos/protos.d.ts new file mode 100644 index 00000000000..47b4d1f254b --- /dev/null +++ b/packages/google-cloud-websecurityscanner/protos/protos.d.ts @@ -0,0 +1,17614 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +import type {protobuf as $protobuf} from "google-gax"; +import Long = require("long"); +/** Namespace google. */ +export namespace google { + + /** Namespace cloud. */ + namespace cloud { + + /** Namespace websecurityscanner. */ + namespace websecurityscanner { + + /** Namespace v1. */ + namespace v1 { + + /** Properties of a CrawledUrl. */ + interface ICrawledUrl { + + /** CrawledUrl httpMethod */ + httpMethod?: (string|null); + + /** CrawledUrl url */ + url?: (string|null); + + /** CrawledUrl body */ + body?: (string|null); + } + + /** Represents a CrawledUrl. */ + class CrawledUrl implements ICrawledUrl { + + /** + * Constructs a new CrawledUrl. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.websecurityscanner.v1.ICrawledUrl); + + /** CrawledUrl httpMethod. */ + public httpMethod: string; + + /** CrawledUrl url. */ + public url: string; + + /** CrawledUrl body. */ + public body: string; + + /** + * Creates a new CrawledUrl instance using the specified properties. + * @param [properties] Properties to set + * @returns CrawledUrl instance + */ + public static create(properties?: google.cloud.websecurityscanner.v1.ICrawledUrl): google.cloud.websecurityscanner.v1.CrawledUrl; + + /** + * Encodes the specified CrawledUrl message. Does not implicitly {@link google.cloud.websecurityscanner.v1.CrawledUrl.verify|verify} messages. + * @param message CrawledUrl message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.websecurityscanner.v1.ICrawledUrl, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CrawledUrl message, length delimited. Does not implicitly {@link google.cloud.websecurityscanner.v1.CrawledUrl.verify|verify} messages. + * @param message CrawledUrl message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.websecurityscanner.v1.ICrawledUrl, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CrawledUrl message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CrawledUrl + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.websecurityscanner.v1.CrawledUrl; + + /** + * Decodes a CrawledUrl message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CrawledUrl + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.websecurityscanner.v1.CrawledUrl; + + /** + * Verifies a CrawledUrl message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a CrawledUrl message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CrawledUrl + */ + public static fromObject(object: { [k: string]: any }): google.cloud.websecurityscanner.v1.CrawledUrl; + + /** + * Creates a plain object from a CrawledUrl message. Also converts values to other types if specified. + * @param message CrawledUrl + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.websecurityscanner.v1.CrawledUrl, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CrawledUrl to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CrawledUrl + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a Finding. */ + interface IFinding { + + /** Finding name */ + name?: (string|null); + + /** Finding findingType */ + findingType?: (string|null); + + /** Finding severity */ + severity?: (google.cloud.websecurityscanner.v1.Finding.Severity|keyof typeof google.cloud.websecurityscanner.v1.Finding.Severity|null); + + /** Finding httpMethod */ + httpMethod?: (string|null); + + /** Finding fuzzedUrl */ + fuzzedUrl?: (string|null); + + /** Finding body */ + body?: (string|null); + + /** Finding description */ + description?: (string|null); + + /** Finding reproductionUrl */ + reproductionUrl?: (string|null); + + /** Finding frameUrl */ + frameUrl?: (string|null); + + /** Finding finalUrl */ + finalUrl?: (string|null); + + /** Finding trackingId */ + trackingId?: (string|null); + + /** Finding form */ + form?: (google.cloud.websecurityscanner.v1.IForm|null); + + /** Finding outdatedLibrary */ + outdatedLibrary?: (google.cloud.websecurityscanner.v1.IOutdatedLibrary|null); + + /** Finding violatingResource */ + violatingResource?: (google.cloud.websecurityscanner.v1.IViolatingResource|null); + + /** Finding vulnerableHeaders */ + vulnerableHeaders?: (google.cloud.websecurityscanner.v1.IVulnerableHeaders|null); + + /** Finding vulnerableParameters */ + vulnerableParameters?: (google.cloud.websecurityscanner.v1.IVulnerableParameters|null); + + /** Finding xss */ + xss?: (google.cloud.websecurityscanner.v1.IXss|null); + + /** Finding xxe */ + xxe?: (google.cloud.websecurityscanner.v1.IXxe|null); + } + + /** Represents a Finding. */ + class Finding implements IFinding { + + /** + * Constructs a new Finding. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.websecurityscanner.v1.IFinding); + + /** Finding name. */ + public name: string; + + /** Finding findingType. */ + public findingType: string; + + /** Finding severity. */ + public severity: (google.cloud.websecurityscanner.v1.Finding.Severity|keyof typeof google.cloud.websecurityscanner.v1.Finding.Severity); + + /** Finding httpMethod. */ + public httpMethod: string; + + /** Finding fuzzedUrl. */ + public fuzzedUrl: string; + + /** Finding body. */ + public body: string; + + /** Finding description. */ + public description: string; + + /** Finding reproductionUrl. */ + public reproductionUrl: string; + + /** Finding frameUrl. */ + public frameUrl: string; + + /** Finding finalUrl. */ + public finalUrl: string; + + /** Finding trackingId. */ + public trackingId: string; + + /** Finding form. */ + public form?: (google.cloud.websecurityscanner.v1.IForm|null); + + /** Finding outdatedLibrary. */ + public outdatedLibrary?: (google.cloud.websecurityscanner.v1.IOutdatedLibrary|null); + + /** Finding violatingResource. */ + public violatingResource?: (google.cloud.websecurityscanner.v1.IViolatingResource|null); + + /** Finding vulnerableHeaders. */ + public vulnerableHeaders?: (google.cloud.websecurityscanner.v1.IVulnerableHeaders|null); + + /** Finding vulnerableParameters. */ + public vulnerableParameters?: (google.cloud.websecurityscanner.v1.IVulnerableParameters|null); + + /** Finding xss. */ + public xss?: (google.cloud.websecurityscanner.v1.IXss|null); + + /** Finding xxe. */ + public xxe?: (google.cloud.websecurityscanner.v1.IXxe|null); + + /** + * Creates a new Finding instance using the specified properties. + * @param [properties] Properties to set + * @returns Finding instance + */ + public static create(properties?: google.cloud.websecurityscanner.v1.IFinding): google.cloud.websecurityscanner.v1.Finding; + + /** + * Encodes the specified Finding message. Does not implicitly {@link google.cloud.websecurityscanner.v1.Finding.verify|verify} messages. + * @param message Finding message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.websecurityscanner.v1.IFinding, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Finding message, length delimited. Does not implicitly {@link google.cloud.websecurityscanner.v1.Finding.verify|verify} messages. + * @param message Finding message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.websecurityscanner.v1.IFinding, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Finding message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Finding + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.websecurityscanner.v1.Finding; + + /** + * Decodes a Finding message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Finding + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.websecurityscanner.v1.Finding; + + /** + * Verifies a Finding message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Finding message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Finding + */ + public static fromObject(object: { [k: string]: any }): google.cloud.websecurityscanner.v1.Finding; + + /** + * Creates a plain object from a Finding message. Also converts values to other types if specified. + * @param message Finding + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.websecurityscanner.v1.Finding, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Finding to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Finding + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace Finding { + + /** Severity enum. */ + enum Severity { + SEVERITY_UNSPECIFIED = 0, + CRITICAL = 1, + HIGH = 2, + MEDIUM = 3, + LOW = 4 + } + } + + /** Properties of a Form. */ + interface IForm { + + /** Form actionUri */ + actionUri?: (string|null); + + /** Form fields */ + fields?: (string[]|null); + } + + /** Represents a Form. */ + class Form implements IForm { + + /** + * Constructs a new Form. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.websecurityscanner.v1.IForm); + + /** Form actionUri. */ + public actionUri: string; + + /** Form fields. */ + public fields: string[]; + + /** + * Creates a new Form instance using the specified properties. + * @param [properties] Properties to set + * @returns Form instance + */ + public static create(properties?: google.cloud.websecurityscanner.v1.IForm): google.cloud.websecurityscanner.v1.Form; + + /** + * Encodes the specified Form message. Does not implicitly {@link google.cloud.websecurityscanner.v1.Form.verify|verify} messages. + * @param message Form message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.websecurityscanner.v1.IForm, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Form message, length delimited. Does not implicitly {@link google.cloud.websecurityscanner.v1.Form.verify|verify} messages. + * @param message Form message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.websecurityscanner.v1.IForm, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Form message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Form + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.websecurityscanner.v1.Form; + + /** + * Decodes a Form message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Form + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.websecurityscanner.v1.Form; + + /** + * Verifies a Form message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Form message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Form + */ + public static fromObject(object: { [k: string]: any }): google.cloud.websecurityscanner.v1.Form; + + /** + * Creates a plain object from a Form message. Also converts values to other types if specified. + * @param message Form + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.websecurityscanner.v1.Form, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Form to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Form + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an OutdatedLibrary. */ + interface IOutdatedLibrary { + + /** OutdatedLibrary libraryName */ + libraryName?: (string|null); + + /** OutdatedLibrary version */ + version?: (string|null); + + /** OutdatedLibrary learnMoreUrls */ + learnMoreUrls?: (string[]|null); + } + + /** Represents an OutdatedLibrary. */ + class OutdatedLibrary implements IOutdatedLibrary { + + /** + * Constructs a new OutdatedLibrary. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.websecurityscanner.v1.IOutdatedLibrary); + + /** OutdatedLibrary libraryName. */ + public libraryName: string; + + /** OutdatedLibrary version. */ + public version: string; + + /** OutdatedLibrary learnMoreUrls. */ + public learnMoreUrls: string[]; + + /** + * Creates a new OutdatedLibrary instance using the specified properties. + * @param [properties] Properties to set + * @returns OutdatedLibrary instance + */ + public static create(properties?: google.cloud.websecurityscanner.v1.IOutdatedLibrary): google.cloud.websecurityscanner.v1.OutdatedLibrary; + + /** + * Encodes the specified OutdatedLibrary message. Does not implicitly {@link google.cloud.websecurityscanner.v1.OutdatedLibrary.verify|verify} messages. + * @param message OutdatedLibrary message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.websecurityscanner.v1.IOutdatedLibrary, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified OutdatedLibrary message, length delimited. Does not implicitly {@link google.cloud.websecurityscanner.v1.OutdatedLibrary.verify|verify} messages. + * @param message OutdatedLibrary message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.websecurityscanner.v1.IOutdatedLibrary, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an OutdatedLibrary message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns OutdatedLibrary + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.websecurityscanner.v1.OutdatedLibrary; + + /** + * Decodes an OutdatedLibrary message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns OutdatedLibrary + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.websecurityscanner.v1.OutdatedLibrary; + + /** + * Verifies an OutdatedLibrary message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an OutdatedLibrary message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns OutdatedLibrary + */ + public static fromObject(object: { [k: string]: any }): google.cloud.websecurityscanner.v1.OutdatedLibrary; + + /** + * Creates a plain object from an OutdatedLibrary message. Also converts values to other types if specified. + * @param message OutdatedLibrary + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.websecurityscanner.v1.OutdatedLibrary, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this OutdatedLibrary to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for OutdatedLibrary + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ViolatingResource. */ + interface IViolatingResource { + + /** ViolatingResource contentType */ + contentType?: (string|null); + + /** ViolatingResource resourceUrl */ + resourceUrl?: (string|null); + } + + /** Represents a ViolatingResource. */ + class ViolatingResource implements IViolatingResource { + + /** + * Constructs a new ViolatingResource. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.websecurityscanner.v1.IViolatingResource); + + /** ViolatingResource contentType. */ + public contentType: string; + + /** ViolatingResource resourceUrl. */ + public resourceUrl: string; + + /** + * Creates a new ViolatingResource instance using the specified properties. + * @param [properties] Properties to set + * @returns ViolatingResource instance + */ + public static create(properties?: google.cloud.websecurityscanner.v1.IViolatingResource): google.cloud.websecurityscanner.v1.ViolatingResource; + + /** + * Encodes the specified ViolatingResource message. Does not implicitly {@link google.cloud.websecurityscanner.v1.ViolatingResource.verify|verify} messages. + * @param message ViolatingResource message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.websecurityscanner.v1.IViolatingResource, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ViolatingResource message, length delimited. Does not implicitly {@link google.cloud.websecurityscanner.v1.ViolatingResource.verify|verify} messages. + * @param message ViolatingResource message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.websecurityscanner.v1.IViolatingResource, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ViolatingResource message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ViolatingResource + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.websecurityscanner.v1.ViolatingResource; + + /** + * Decodes a ViolatingResource message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ViolatingResource + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.websecurityscanner.v1.ViolatingResource; + + /** + * Verifies a ViolatingResource message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ViolatingResource message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ViolatingResource + */ + public static fromObject(object: { [k: string]: any }): google.cloud.websecurityscanner.v1.ViolatingResource; + + /** + * Creates a plain object from a ViolatingResource message. Also converts values to other types if specified. + * @param message ViolatingResource + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.websecurityscanner.v1.ViolatingResource, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ViolatingResource to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ViolatingResource + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a VulnerableParameters. */ + interface IVulnerableParameters { + + /** VulnerableParameters parameterNames */ + parameterNames?: (string[]|null); + } + + /** Represents a VulnerableParameters. */ + class VulnerableParameters implements IVulnerableParameters { + + /** + * Constructs a new VulnerableParameters. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.websecurityscanner.v1.IVulnerableParameters); + + /** VulnerableParameters parameterNames. */ + public parameterNames: string[]; + + /** + * Creates a new VulnerableParameters instance using the specified properties. + * @param [properties] Properties to set + * @returns VulnerableParameters instance + */ + public static create(properties?: google.cloud.websecurityscanner.v1.IVulnerableParameters): google.cloud.websecurityscanner.v1.VulnerableParameters; + + /** + * Encodes the specified VulnerableParameters message. Does not implicitly {@link google.cloud.websecurityscanner.v1.VulnerableParameters.verify|verify} messages. + * @param message VulnerableParameters message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.websecurityscanner.v1.IVulnerableParameters, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified VulnerableParameters message, length delimited. Does not implicitly {@link google.cloud.websecurityscanner.v1.VulnerableParameters.verify|verify} messages. + * @param message VulnerableParameters message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.websecurityscanner.v1.IVulnerableParameters, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a VulnerableParameters message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns VulnerableParameters + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.websecurityscanner.v1.VulnerableParameters; + + /** + * Decodes a VulnerableParameters message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns VulnerableParameters + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.websecurityscanner.v1.VulnerableParameters; + + /** + * Verifies a VulnerableParameters message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a VulnerableParameters message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns VulnerableParameters + */ + public static fromObject(object: { [k: string]: any }): google.cloud.websecurityscanner.v1.VulnerableParameters; + + /** + * Creates a plain object from a VulnerableParameters message. Also converts values to other types if specified. + * @param message VulnerableParameters + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.websecurityscanner.v1.VulnerableParameters, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this VulnerableParameters to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for VulnerableParameters + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a VulnerableHeaders. */ + interface IVulnerableHeaders { + + /** VulnerableHeaders headers */ + headers?: (google.cloud.websecurityscanner.v1.VulnerableHeaders.IHeader[]|null); + + /** VulnerableHeaders missingHeaders */ + missingHeaders?: (google.cloud.websecurityscanner.v1.VulnerableHeaders.IHeader[]|null); + } + + /** Represents a VulnerableHeaders. */ + class VulnerableHeaders implements IVulnerableHeaders { + + /** + * Constructs a new VulnerableHeaders. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.websecurityscanner.v1.IVulnerableHeaders); + + /** VulnerableHeaders headers. */ + public headers: google.cloud.websecurityscanner.v1.VulnerableHeaders.IHeader[]; + + /** VulnerableHeaders missingHeaders. */ + public missingHeaders: google.cloud.websecurityscanner.v1.VulnerableHeaders.IHeader[]; + + /** + * Creates a new VulnerableHeaders instance using the specified properties. + * @param [properties] Properties to set + * @returns VulnerableHeaders instance + */ + public static create(properties?: google.cloud.websecurityscanner.v1.IVulnerableHeaders): google.cloud.websecurityscanner.v1.VulnerableHeaders; + + /** + * Encodes the specified VulnerableHeaders message. Does not implicitly {@link google.cloud.websecurityscanner.v1.VulnerableHeaders.verify|verify} messages. + * @param message VulnerableHeaders message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.websecurityscanner.v1.IVulnerableHeaders, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified VulnerableHeaders message, length delimited. Does not implicitly {@link google.cloud.websecurityscanner.v1.VulnerableHeaders.verify|verify} messages. + * @param message VulnerableHeaders message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.websecurityscanner.v1.IVulnerableHeaders, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a VulnerableHeaders message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns VulnerableHeaders + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.websecurityscanner.v1.VulnerableHeaders; + + /** + * Decodes a VulnerableHeaders message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns VulnerableHeaders + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.websecurityscanner.v1.VulnerableHeaders; + + /** + * Verifies a VulnerableHeaders message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a VulnerableHeaders message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns VulnerableHeaders + */ + public static fromObject(object: { [k: string]: any }): google.cloud.websecurityscanner.v1.VulnerableHeaders; + + /** + * Creates a plain object from a VulnerableHeaders message. Also converts values to other types if specified. + * @param message VulnerableHeaders + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.websecurityscanner.v1.VulnerableHeaders, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this VulnerableHeaders to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for VulnerableHeaders + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace VulnerableHeaders { + + /** Properties of a Header. */ + interface IHeader { + + /** Header name */ + name?: (string|null); + + /** Header value */ + value?: (string|null); + } + + /** Represents a Header. */ + class Header implements IHeader { + + /** + * Constructs a new Header. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.websecurityscanner.v1.VulnerableHeaders.IHeader); + + /** Header name. */ + public name: string; + + /** Header value. */ + public value: string; + + /** + * Creates a new Header instance using the specified properties. + * @param [properties] Properties to set + * @returns Header instance + */ + public static create(properties?: google.cloud.websecurityscanner.v1.VulnerableHeaders.IHeader): google.cloud.websecurityscanner.v1.VulnerableHeaders.Header; + + /** + * Encodes the specified Header message. Does not implicitly {@link google.cloud.websecurityscanner.v1.VulnerableHeaders.Header.verify|verify} messages. + * @param message Header message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.websecurityscanner.v1.VulnerableHeaders.IHeader, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Header message, length delimited. Does not implicitly {@link google.cloud.websecurityscanner.v1.VulnerableHeaders.Header.verify|verify} messages. + * @param message Header message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.websecurityscanner.v1.VulnerableHeaders.IHeader, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Header message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Header + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.websecurityscanner.v1.VulnerableHeaders.Header; + + /** + * Decodes a Header message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Header + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.websecurityscanner.v1.VulnerableHeaders.Header; + + /** + * Verifies a Header message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Header message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Header + */ + public static fromObject(object: { [k: string]: any }): google.cloud.websecurityscanner.v1.VulnerableHeaders.Header; + + /** + * Creates a plain object from a Header message. Also converts values to other types if specified. + * @param message Header + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.websecurityscanner.v1.VulnerableHeaders.Header, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Header to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Header + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Properties of a Xss. */ + interface IXss { + + /** Xss stackTraces */ + stackTraces?: (string[]|null); + + /** Xss errorMessage */ + errorMessage?: (string|null); + + /** Xss attackVector */ + attackVector?: (google.cloud.websecurityscanner.v1.Xss.AttackVector|keyof typeof google.cloud.websecurityscanner.v1.Xss.AttackVector|null); + + /** Xss storedXssSeedingUrl */ + storedXssSeedingUrl?: (string|null); + } + + /** Represents a Xss. */ + class Xss implements IXss { + + /** + * Constructs a new Xss. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.websecurityscanner.v1.IXss); + + /** Xss stackTraces. */ + public stackTraces: string[]; + + /** Xss errorMessage. */ + public errorMessage: string; + + /** Xss attackVector. */ + public attackVector: (google.cloud.websecurityscanner.v1.Xss.AttackVector|keyof typeof google.cloud.websecurityscanner.v1.Xss.AttackVector); + + /** Xss storedXssSeedingUrl. */ + public storedXssSeedingUrl: string; + + /** + * Creates a new Xss instance using the specified properties. + * @param [properties] Properties to set + * @returns Xss instance + */ + public static create(properties?: google.cloud.websecurityscanner.v1.IXss): google.cloud.websecurityscanner.v1.Xss; + + /** + * Encodes the specified Xss message. Does not implicitly {@link google.cloud.websecurityscanner.v1.Xss.verify|verify} messages. + * @param message Xss message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.websecurityscanner.v1.IXss, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Xss message, length delimited. Does not implicitly {@link google.cloud.websecurityscanner.v1.Xss.verify|verify} messages. + * @param message Xss message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.websecurityscanner.v1.IXss, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Xss message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Xss + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.websecurityscanner.v1.Xss; + + /** + * Decodes a Xss message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Xss + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.websecurityscanner.v1.Xss; + + /** + * Verifies a Xss message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Xss message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Xss + */ + public static fromObject(object: { [k: string]: any }): google.cloud.websecurityscanner.v1.Xss; + + /** + * Creates a plain object from a Xss message. Also converts values to other types if specified. + * @param message Xss + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.websecurityscanner.v1.Xss, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Xss to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Xss + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace Xss { + + /** AttackVector enum. */ + enum AttackVector { + ATTACK_VECTOR_UNSPECIFIED = 0, + LOCAL_STORAGE = 1, + SESSION_STORAGE = 2, + WINDOW_NAME = 3, + REFERRER = 4, + FORM_INPUT = 5, + COOKIE = 6, + POST_MESSAGE = 7, + GET_PARAMETERS = 8, + URL_FRAGMENT = 9, + HTML_COMMENT = 10, + POST_PARAMETERS = 11, + PROTOCOL = 12, + STORED_XSS = 13, + SAME_ORIGIN = 14, + USER_CONTROLLABLE_URL = 15 + } + } + + /** Properties of a Xxe. */ + interface IXxe { + + /** Xxe payloadValue */ + payloadValue?: (string|null); + + /** Xxe payloadLocation */ + payloadLocation?: (google.cloud.websecurityscanner.v1.Xxe.Location|keyof typeof google.cloud.websecurityscanner.v1.Xxe.Location|null); + } + + /** Represents a Xxe. */ + class Xxe implements IXxe { + + /** + * Constructs a new Xxe. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.websecurityscanner.v1.IXxe); + + /** Xxe payloadValue. */ + public payloadValue: string; + + /** Xxe payloadLocation. */ + public payloadLocation: (google.cloud.websecurityscanner.v1.Xxe.Location|keyof typeof google.cloud.websecurityscanner.v1.Xxe.Location); + + /** + * Creates a new Xxe instance using the specified properties. + * @param [properties] Properties to set + * @returns Xxe instance + */ + public static create(properties?: google.cloud.websecurityscanner.v1.IXxe): google.cloud.websecurityscanner.v1.Xxe; + + /** + * Encodes the specified Xxe message. Does not implicitly {@link google.cloud.websecurityscanner.v1.Xxe.verify|verify} messages. + * @param message Xxe message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.websecurityscanner.v1.IXxe, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Xxe message, length delimited. Does not implicitly {@link google.cloud.websecurityscanner.v1.Xxe.verify|verify} messages. + * @param message Xxe message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.websecurityscanner.v1.IXxe, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Xxe message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Xxe + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.websecurityscanner.v1.Xxe; + + /** + * Decodes a Xxe message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Xxe + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.websecurityscanner.v1.Xxe; + + /** + * Verifies a Xxe message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Xxe message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Xxe + */ + public static fromObject(object: { [k: string]: any }): google.cloud.websecurityscanner.v1.Xxe; + + /** + * Creates a plain object from a Xxe message. Also converts values to other types if specified. + * @param message Xxe + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.websecurityscanner.v1.Xxe, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Xxe to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Xxe + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace Xxe { + + /** Location enum. */ + enum Location { + LOCATION_UNSPECIFIED = 0, + COMPLETE_REQUEST_BODY = 1 + } + } + + /** Properties of a FindingTypeStats. */ + interface IFindingTypeStats { + + /** FindingTypeStats findingType */ + findingType?: (string|null); + + /** FindingTypeStats findingCount */ + findingCount?: (number|null); + } + + /** Represents a FindingTypeStats. */ + class FindingTypeStats implements IFindingTypeStats { + + /** + * Constructs a new FindingTypeStats. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.websecurityscanner.v1.IFindingTypeStats); + + /** FindingTypeStats findingType. */ + public findingType: string; + + /** FindingTypeStats findingCount. */ + public findingCount: number; + + /** + * Creates a new FindingTypeStats instance using the specified properties. + * @param [properties] Properties to set + * @returns FindingTypeStats instance + */ + public static create(properties?: google.cloud.websecurityscanner.v1.IFindingTypeStats): google.cloud.websecurityscanner.v1.FindingTypeStats; + + /** + * Encodes the specified FindingTypeStats message. Does not implicitly {@link google.cloud.websecurityscanner.v1.FindingTypeStats.verify|verify} messages. + * @param message FindingTypeStats message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.websecurityscanner.v1.IFindingTypeStats, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified FindingTypeStats message, length delimited. Does not implicitly {@link google.cloud.websecurityscanner.v1.FindingTypeStats.verify|verify} messages. + * @param message FindingTypeStats message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.websecurityscanner.v1.IFindingTypeStats, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FindingTypeStats message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns FindingTypeStats + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.websecurityscanner.v1.FindingTypeStats; + + /** + * Decodes a FindingTypeStats message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns FindingTypeStats + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.websecurityscanner.v1.FindingTypeStats; + + /** + * Verifies a FindingTypeStats message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a FindingTypeStats message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns FindingTypeStats + */ + public static fromObject(object: { [k: string]: any }): google.cloud.websecurityscanner.v1.FindingTypeStats; + + /** + * Creates a plain object from a FindingTypeStats message. Also converts values to other types if specified. + * @param message FindingTypeStats + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.websecurityscanner.v1.FindingTypeStats, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this FindingTypeStats to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for FindingTypeStats + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ScanConfig. */ + interface IScanConfig { + + /** ScanConfig name */ + name?: (string|null); + + /** ScanConfig displayName */ + displayName?: (string|null); + + /** ScanConfig maxQps */ + maxQps?: (number|null); + + /** ScanConfig startingUrls */ + startingUrls?: (string[]|null); + + /** ScanConfig authentication */ + authentication?: (google.cloud.websecurityscanner.v1.ScanConfig.IAuthentication|null); + + /** ScanConfig userAgent */ + userAgent?: (google.cloud.websecurityscanner.v1.ScanConfig.UserAgent|keyof typeof google.cloud.websecurityscanner.v1.ScanConfig.UserAgent|null); + + /** ScanConfig blacklistPatterns */ + blacklistPatterns?: (string[]|null); + + /** ScanConfig schedule */ + schedule?: (google.cloud.websecurityscanner.v1.ScanConfig.ISchedule|null); + + /** ScanConfig exportToSecurityCommandCenter */ + exportToSecurityCommandCenter?: (google.cloud.websecurityscanner.v1.ScanConfig.ExportToSecurityCommandCenter|keyof typeof google.cloud.websecurityscanner.v1.ScanConfig.ExportToSecurityCommandCenter|null); + + /** ScanConfig riskLevel */ + riskLevel?: (google.cloud.websecurityscanner.v1.ScanConfig.RiskLevel|keyof typeof google.cloud.websecurityscanner.v1.ScanConfig.RiskLevel|null); + + /** ScanConfig managedScan */ + managedScan?: (boolean|null); + + /** ScanConfig staticIpScan */ + staticIpScan?: (boolean|null); + + /** ScanConfig ignoreHttpStatusErrors */ + ignoreHttpStatusErrors?: (boolean|null); + } + + /** Represents a ScanConfig. */ + class ScanConfig implements IScanConfig { + + /** + * Constructs a new ScanConfig. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.websecurityscanner.v1.IScanConfig); + + /** ScanConfig name. */ + public name: string; + + /** ScanConfig displayName. */ + public displayName: string; + + /** ScanConfig maxQps. */ + public maxQps: number; + + /** ScanConfig startingUrls. */ + public startingUrls: string[]; + + /** ScanConfig authentication. */ + public authentication?: (google.cloud.websecurityscanner.v1.ScanConfig.IAuthentication|null); + + /** ScanConfig userAgent. */ + public userAgent: (google.cloud.websecurityscanner.v1.ScanConfig.UserAgent|keyof typeof google.cloud.websecurityscanner.v1.ScanConfig.UserAgent); + + /** ScanConfig blacklistPatterns. */ + public blacklistPatterns: string[]; + + /** ScanConfig schedule. */ + public schedule?: (google.cloud.websecurityscanner.v1.ScanConfig.ISchedule|null); + + /** ScanConfig exportToSecurityCommandCenter. */ + public exportToSecurityCommandCenter: (google.cloud.websecurityscanner.v1.ScanConfig.ExportToSecurityCommandCenter|keyof typeof google.cloud.websecurityscanner.v1.ScanConfig.ExportToSecurityCommandCenter); + + /** ScanConfig riskLevel. */ + public riskLevel: (google.cloud.websecurityscanner.v1.ScanConfig.RiskLevel|keyof typeof google.cloud.websecurityscanner.v1.ScanConfig.RiskLevel); + + /** ScanConfig managedScan. */ + public managedScan: boolean; + + /** ScanConfig staticIpScan. */ + public staticIpScan: boolean; + + /** ScanConfig ignoreHttpStatusErrors. */ + public ignoreHttpStatusErrors: boolean; + + /** + * Creates a new ScanConfig instance using the specified properties. + * @param [properties] Properties to set + * @returns ScanConfig instance + */ + public static create(properties?: google.cloud.websecurityscanner.v1.IScanConfig): google.cloud.websecurityscanner.v1.ScanConfig; + + /** + * Encodes the specified ScanConfig message. Does not implicitly {@link google.cloud.websecurityscanner.v1.ScanConfig.verify|verify} messages. + * @param message ScanConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.websecurityscanner.v1.IScanConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ScanConfig message, length delimited. Does not implicitly {@link google.cloud.websecurityscanner.v1.ScanConfig.verify|verify} messages. + * @param message ScanConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.websecurityscanner.v1.IScanConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ScanConfig message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ScanConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.websecurityscanner.v1.ScanConfig; + + /** + * Decodes a ScanConfig message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ScanConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.websecurityscanner.v1.ScanConfig; + + /** + * Verifies a ScanConfig message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ScanConfig message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ScanConfig + */ + public static fromObject(object: { [k: string]: any }): google.cloud.websecurityscanner.v1.ScanConfig; + + /** + * Creates a plain object from a ScanConfig message. Also converts values to other types if specified. + * @param message ScanConfig + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.websecurityscanner.v1.ScanConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ScanConfig to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ScanConfig + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace ScanConfig { + + /** Properties of an Authentication. */ + interface IAuthentication { + + /** Authentication googleAccount */ + googleAccount?: (google.cloud.websecurityscanner.v1.ScanConfig.Authentication.IGoogleAccount|null); + + /** Authentication customAccount */ + customAccount?: (google.cloud.websecurityscanner.v1.ScanConfig.Authentication.ICustomAccount|null); + + /** Authentication iapCredential */ + iapCredential?: (google.cloud.websecurityscanner.v1.ScanConfig.Authentication.IIapCredential|null); + } + + /** Represents an Authentication. */ + class Authentication implements IAuthentication { + + /** + * Constructs a new Authentication. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.websecurityscanner.v1.ScanConfig.IAuthentication); + + /** Authentication googleAccount. */ + public googleAccount?: (google.cloud.websecurityscanner.v1.ScanConfig.Authentication.IGoogleAccount|null); + + /** Authentication customAccount. */ + public customAccount?: (google.cloud.websecurityscanner.v1.ScanConfig.Authentication.ICustomAccount|null); + + /** Authentication iapCredential. */ + public iapCredential?: (google.cloud.websecurityscanner.v1.ScanConfig.Authentication.IIapCredential|null); + + /** Authentication authentication. */ + public authentication?: ("googleAccount"|"customAccount"|"iapCredential"); + + /** + * Creates a new Authentication instance using the specified properties. + * @param [properties] Properties to set + * @returns Authentication instance + */ + public static create(properties?: google.cloud.websecurityscanner.v1.ScanConfig.IAuthentication): google.cloud.websecurityscanner.v1.ScanConfig.Authentication; + + /** + * Encodes the specified Authentication message. Does not implicitly {@link google.cloud.websecurityscanner.v1.ScanConfig.Authentication.verify|verify} messages. + * @param message Authentication message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.websecurityscanner.v1.ScanConfig.IAuthentication, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Authentication message, length delimited. Does not implicitly {@link google.cloud.websecurityscanner.v1.ScanConfig.Authentication.verify|verify} messages. + * @param message Authentication message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.websecurityscanner.v1.ScanConfig.IAuthentication, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an Authentication message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Authentication + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.websecurityscanner.v1.ScanConfig.Authentication; + + /** + * Decodes an Authentication message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Authentication + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.websecurityscanner.v1.ScanConfig.Authentication; + + /** + * Verifies an Authentication message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an Authentication message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Authentication + */ + public static fromObject(object: { [k: string]: any }): google.cloud.websecurityscanner.v1.ScanConfig.Authentication; + + /** + * Creates a plain object from an Authentication message. Also converts values to other types if specified. + * @param message Authentication + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.websecurityscanner.v1.ScanConfig.Authentication, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Authentication to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Authentication + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace Authentication { + + /** Properties of a GoogleAccount. */ + interface IGoogleAccount { + + /** GoogleAccount username */ + username?: (string|null); + + /** GoogleAccount password */ + password?: (string|null); + } + + /** Represents a GoogleAccount. */ + class GoogleAccount implements IGoogleAccount { + + /** + * Constructs a new GoogleAccount. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.websecurityscanner.v1.ScanConfig.Authentication.IGoogleAccount); + + /** GoogleAccount username. */ + public username: string; + + /** GoogleAccount password. */ + public password: string; + + /** + * Creates a new GoogleAccount instance using the specified properties. + * @param [properties] Properties to set + * @returns GoogleAccount instance + */ + public static create(properties?: google.cloud.websecurityscanner.v1.ScanConfig.Authentication.IGoogleAccount): google.cloud.websecurityscanner.v1.ScanConfig.Authentication.GoogleAccount; + + /** + * Encodes the specified GoogleAccount message. Does not implicitly {@link google.cloud.websecurityscanner.v1.ScanConfig.Authentication.GoogleAccount.verify|verify} messages. + * @param message GoogleAccount message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.websecurityscanner.v1.ScanConfig.Authentication.IGoogleAccount, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GoogleAccount message, length delimited. Does not implicitly {@link google.cloud.websecurityscanner.v1.ScanConfig.Authentication.GoogleAccount.verify|verify} messages. + * @param message GoogleAccount message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.websecurityscanner.v1.ScanConfig.Authentication.IGoogleAccount, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GoogleAccount message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GoogleAccount + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.websecurityscanner.v1.ScanConfig.Authentication.GoogleAccount; + + /** + * Decodes a GoogleAccount message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GoogleAccount + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.websecurityscanner.v1.ScanConfig.Authentication.GoogleAccount; + + /** + * Verifies a GoogleAccount message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GoogleAccount message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GoogleAccount + */ + public static fromObject(object: { [k: string]: any }): google.cloud.websecurityscanner.v1.ScanConfig.Authentication.GoogleAccount; + + /** + * Creates a plain object from a GoogleAccount message. Also converts values to other types if specified. + * @param message GoogleAccount + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.websecurityscanner.v1.ScanConfig.Authentication.GoogleAccount, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GoogleAccount to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GoogleAccount + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a CustomAccount. */ + interface ICustomAccount { + + /** CustomAccount username */ + username?: (string|null); + + /** CustomAccount password */ + password?: (string|null); + + /** CustomAccount loginUrl */ + loginUrl?: (string|null); + } + + /** Represents a CustomAccount. */ + class CustomAccount implements ICustomAccount { + + /** + * Constructs a new CustomAccount. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.websecurityscanner.v1.ScanConfig.Authentication.ICustomAccount); + + /** CustomAccount username. */ + public username: string; + + /** CustomAccount password. */ + public password: string; + + /** CustomAccount loginUrl. */ + public loginUrl: string; + + /** + * Creates a new CustomAccount instance using the specified properties. + * @param [properties] Properties to set + * @returns CustomAccount instance + */ + public static create(properties?: google.cloud.websecurityscanner.v1.ScanConfig.Authentication.ICustomAccount): google.cloud.websecurityscanner.v1.ScanConfig.Authentication.CustomAccount; + + /** + * Encodes the specified CustomAccount message. Does not implicitly {@link google.cloud.websecurityscanner.v1.ScanConfig.Authentication.CustomAccount.verify|verify} messages. + * @param message CustomAccount message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.websecurityscanner.v1.ScanConfig.Authentication.ICustomAccount, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CustomAccount message, length delimited. Does not implicitly {@link google.cloud.websecurityscanner.v1.ScanConfig.Authentication.CustomAccount.verify|verify} messages. + * @param message CustomAccount message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.websecurityscanner.v1.ScanConfig.Authentication.ICustomAccount, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CustomAccount message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CustomAccount + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.websecurityscanner.v1.ScanConfig.Authentication.CustomAccount; + + /** + * Decodes a CustomAccount message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CustomAccount + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.websecurityscanner.v1.ScanConfig.Authentication.CustomAccount; + + /** + * Verifies a CustomAccount message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a CustomAccount message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CustomAccount + */ + public static fromObject(object: { [k: string]: any }): google.cloud.websecurityscanner.v1.ScanConfig.Authentication.CustomAccount; + + /** + * Creates a plain object from a CustomAccount message. Also converts values to other types if specified. + * @param message CustomAccount + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.websecurityscanner.v1.ScanConfig.Authentication.CustomAccount, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CustomAccount to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CustomAccount + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an IapCredential. */ + interface IIapCredential { + + /** IapCredential iapTestServiceAccountInfo */ + iapTestServiceAccountInfo?: (google.cloud.websecurityscanner.v1.ScanConfig.Authentication.IapCredential.IIapTestServiceAccountInfo|null); + } + + /** Represents an IapCredential. */ + class IapCredential implements IIapCredential { + + /** + * Constructs a new IapCredential. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.websecurityscanner.v1.ScanConfig.Authentication.IIapCredential); + + /** IapCredential iapTestServiceAccountInfo. */ + public iapTestServiceAccountInfo?: (google.cloud.websecurityscanner.v1.ScanConfig.Authentication.IapCredential.IIapTestServiceAccountInfo|null); + + /** IapCredential iapCredentials. */ + public iapCredentials?: "iapTestServiceAccountInfo"; + + /** + * Creates a new IapCredential instance using the specified properties. + * @param [properties] Properties to set + * @returns IapCredential instance + */ + public static create(properties?: google.cloud.websecurityscanner.v1.ScanConfig.Authentication.IIapCredential): google.cloud.websecurityscanner.v1.ScanConfig.Authentication.IapCredential; + + /** + * Encodes the specified IapCredential message. Does not implicitly {@link google.cloud.websecurityscanner.v1.ScanConfig.Authentication.IapCredential.verify|verify} messages. + * @param message IapCredential message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.websecurityscanner.v1.ScanConfig.Authentication.IIapCredential, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified IapCredential message, length delimited. Does not implicitly {@link google.cloud.websecurityscanner.v1.ScanConfig.Authentication.IapCredential.verify|verify} messages. + * @param message IapCredential message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.websecurityscanner.v1.ScanConfig.Authentication.IIapCredential, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an IapCredential message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns IapCredential + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.websecurityscanner.v1.ScanConfig.Authentication.IapCredential; + + /** + * Decodes an IapCredential message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns IapCredential + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.websecurityscanner.v1.ScanConfig.Authentication.IapCredential; + + /** + * Verifies an IapCredential message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an IapCredential message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns IapCredential + */ + public static fromObject(object: { [k: string]: any }): google.cloud.websecurityscanner.v1.ScanConfig.Authentication.IapCredential; + + /** + * Creates a plain object from an IapCredential message. Also converts values to other types if specified. + * @param message IapCredential + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.websecurityscanner.v1.ScanConfig.Authentication.IapCredential, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this IapCredential to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for IapCredential + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace IapCredential { + + /** Properties of an IapTestServiceAccountInfo. */ + interface IIapTestServiceAccountInfo { + + /** IapTestServiceAccountInfo targetAudienceClientId */ + targetAudienceClientId?: (string|null); + } + + /** Represents an IapTestServiceAccountInfo. */ + class IapTestServiceAccountInfo implements IIapTestServiceAccountInfo { + + /** + * Constructs a new IapTestServiceAccountInfo. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.websecurityscanner.v1.ScanConfig.Authentication.IapCredential.IIapTestServiceAccountInfo); + + /** IapTestServiceAccountInfo targetAudienceClientId. */ + public targetAudienceClientId: string; + + /** + * Creates a new IapTestServiceAccountInfo instance using the specified properties. + * @param [properties] Properties to set + * @returns IapTestServiceAccountInfo instance + */ + public static create(properties?: google.cloud.websecurityscanner.v1.ScanConfig.Authentication.IapCredential.IIapTestServiceAccountInfo): google.cloud.websecurityscanner.v1.ScanConfig.Authentication.IapCredential.IapTestServiceAccountInfo; + + /** + * Encodes the specified IapTestServiceAccountInfo message. Does not implicitly {@link google.cloud.websecurityscanner.v1.ScanConfig.Authentication.IapCredential.IapTestServiceAccountInfo.verify|verify} messages. + * @param message IapTestServiceAccountInfo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.websecurityscanner.v1.ScanConfig.Authentication.IapCredential.IIapTestServiceAccountInfo, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified IapTestServiceAccountInfo message, length delimited. Does not implicitly {@link google.cloud.websecurityscanner.v1.ScanConfig.Authentication.IapCredential.IapTestServiceAccountInfo.verify|verify} messages. + * @param message IapTestServiceAccountInfo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.websecurityscanner.v1.ScanConfig.Authentication.IapCredential.IIapTestServiceAccountInfo, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an IapTestServiceAccountInfo message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns IapTestServiceAccountInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.websecurityscanner.v1.ScanConfig.Authentication.IapCredential.IapTestServiceAccountInfo; + + /** + * Decodes an IapTestServiceAccountInfo message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns IapTestServiceAccountInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.websecurityscanner.v1.ScanConfig.Authentication.IapCredential.IapTestServiceAccountInfo; + + /** + * Verifies an IapTestServiceAccountInfo message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an IapTestServiceAccountInfo message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns IapTestServiceAccountInfo + */ + public static fromObject(object: { [k: string]: any }): google.cloud.websecurityscanner.v1.ScanConfig.Authentication.IapCredential.IapTestServiceAccountInfo; + + /** + * Creates a plain object from an IapTestServiceAccountInfo message. Also converts values to other types if specified. + * @param message IapTestServiceAccountInfo + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.websecurityscanner.v1.ScanConfig.Authentication.IapCredential.IapTestServiceAccountInfo, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this IapTestServiceAccountInfo to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for IapTestServiceAccountInfo + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + } + + /** Properties of a Schedule. */ + interface ISchedule { + + /** Schedule scheduleTime */ + scheduleTime?: (google.protobuf.ITimestamp|null); + + /** Schedule intervalDurationDays */ + intervalDurationDays?: (number|null); + } + + /** Represents a Schedule. */ + class Schedule implements ISchedule { + + /** + * Constructs a new Schedule. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.websecurityscanner.v1.ScanConfig.ISchedule); + + /** Schedule scheduleTime. */ + public scheduleTime?: (google.protobuf.ITimestamp|null); + + /** Schedule intervalDurationDays. */ + public intervalDurationDays: number; + + /** + * Creates a new Schedule instance using the specified properties. + * @param [properties] Properties to set + * @returns Schedule instance + */ + public static create(properties?: google.cloud.websecurityscanner.v1.ScanConfig.ISchedule): google.cloud.websecurityscanner.v1.ScanConfig.Schedule; + + /** + * Encodes the specified Schedule message. Does not implicitly {@link google.cloud.websecurityscanner.v1.ScanConfig.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.websecurityscanner.v1.ScanConfig.ISchedule, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Schedule message, length delimited. Does not implicitly {@link google.cloud.websecurityscanner.v1.ScanConfig.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.websecurityscanner.v1.ScanConfig.ISchedule, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * 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.websecurityscanner.v1.ScanConfig.Schedule; + + /** + * 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.websecurityscanner.v1.ScanConfig.Schedule; + + /** + * 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 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.websecurityscanner.v1.ScanConfig.Schedule; + + /** + * 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.websecurityscanner.v1.ScanConfig.Schedule, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Schedule to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * 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; + } + + /** UserAgent enum. */ + enum UserAgent { + USER_AGENT_UNSPECIFIED = 0, + CHROME_LINUX = 1, + CHROME_ANDROID = 2, + SAFARI_IPHONE = 3 + } + + /** RiskLevel enum. */ + enum RiskLevel { + RISK_LEVEL_UNSPECIFIED = 0, + NORMAL = 1, + LOW = 2 + } + + /** ExportToSecurityCommandCenter enum. */ + enum ExportToSecurityCommandCenter { + EXPORT_TO_SECURITY_COMMAND_CENTER_UNSPECIFIED = 0, + ENABLED = 1, + DISABLED = 2 + } + } + + /** Properties of a ScanConfigError. */ + interface IScanConfigError { + + /** ScanConfigError code */ + code?: (google.cloud.websecurityscanner.v1.ScanConfigError.Code|keyof typeof google.cloud.websecurityscanner.v1.ScanConfigError.Code|null); + + /** ScanConfigError fieldName */ + fieldName?: (string|null); + } + + /** Represents a ScanConfigError. */ + class ScanConfigError implements IScanConfigError { + + /** + * Constructs a new ScanConfigError. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.websecurityscanner.v1.IScanConfigError); + + /** ScanConfigError code. */ + public code: (google.cloud.websecurityscanner.v1.ScanConfigError.Code|keyof typeof google.cloud.websecurityscanner.v1.ScanConfigError.Code); + + /** ScanConfigError fieldName. */ + public fieldName: string; + + /** + * Creates a new ScanConfigError instance using the specified properties. + * @param [properties] Properties to set + * @returns ScanConfigError instance + */ + public static create(properties?: google.cloud.websecurityscanner.v1.IScanConfigError): google.cloud.websecurityscanner.v1.ScanConfigError; + + /** + * Encodes the specified ScanConfigError message. Does not implicitly {@link google.cloud.websecurityscanner.v1.ScanConfigError.verify|verify} messages. + * @param message ScanConfigError message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.websecurityscanner.v1.IScanConfigError, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ScanConfigError message, length delimited. Does not implicitly {@link google.cloud.websecurityscanner.v1.ScanConfigError.verify|verify} messages. + * @param message ScanConfigError message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.websecurityscanner.v1.IScanConfigError, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ScanConfigError message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ScanConfigError + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.websecurityscanner.v1.ScanConfigError; + + /** + * Decodes a ScanConfigError message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ScanConfigError + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.websecurityscanner.v1.ScanConfigError; + + /** + * Verifies a ScanConfigError message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ScanConfigError message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ScanConfigError + */ + public static fromObject(object: { [k: string]: any }): google.cloud.websecurityscanner.v1.ScanConfigError; + + /** + * Creates a plain object from a ScanConfigError message. Also converts values to other types if specified. + * @param message ScanConfigError + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.websecurityscanner.v1.ScanConfigError, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ScanConfigError to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ScanConfigError + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace ScanConfigError { + + /** Code enum. */ + enum Code { + CODE_UNSPECIFIED = 0, + OK = 0, + INTERNAL_ERROR = 1, + APPENGINE_API_BACKEND_ERROR = 2, + APPENGINE_API_NOT_ACCESSIBLE = 3, + APPENGINE_DEFAULT_HOST_MISSING = 4, + CANNOT_USE_GOOGLE_COM_ACCOUNT = 6, + CANNOT_USE_OWNER_ACCOUNT = 7, + COMPUTE_API_BACKEND_ERROR = 8, + COMPUTE_API_NOT_ACCESSIBLE = 9, + CUSTOM_LOGIN_URL_DOES_NOT_BELONG_TO_CURRENT_PROJECT = 10, + CUSTOM_LOGIN_URL_MALFORMED = 11, + CUSTOM_LOGIN_URL_MAPPED_TO_NON_ROUTABLE_ADDRESS = 12, + CUSTOM_LOGIN_URL_MAPPED_TO_UNRESERVED_ADDRESS = 13, + CUSTOM_LOGIN_URL_HAS_NON_ROUTABLE_IP_ADDRESS = 14, + CUSTOM_LOGIN_URL_HAS_UNRESERVED_IP_ADDRESS = 15, + DUPLICATE_SCAN_NAME = 16, + INVALID_FIELD_VALUE = 18, + FAILED_TO_AUTHENTICATE_TO_TARGET = 19, + FINDING_TYPE_UNSPECIFIED = 20, + FORBIDDEN_TO_SCAN_COMPUTE = 21, + FORBIDDEN_UPDATE_TO_MANAGED_SCAN = 43, + MALFORMED_FILTER = 22, + MALFORMED_RESOURCE_NAME = 23, + PROJECT_INACTIVE = 24, + REQUIRED_FIELD = 25, + RESOURCE_NAME_INCONSISTENT = 26, + SCAN_ALREADY_RUNNING = 27, + SCAN_NOT_RUNNING = 28, + SEED_URL_DOES_NOT_BELONG_TO_CURRENT_PROJECT = 29, + SEED_URL_MALFORMED = 30, + SEED_URL_MAPPED_TO_NON_ROUTABLE_ADDRESS = 31, + SEED_URL_MAPPED_TO_UNRESERVED_ADDRESS = 32, + SEED_URL_HAS_NON_ROUTABLE_IP_ADDRESS = 33, + SEED_URL_HAS_UNRESERVED_IP_ADDRESS = 35, + SERVICE_ACCOUNT_NOT_CONFIGURED = 36, + TOO_MANY_SCANS = 37, + UNABLE_TO_RESOLVE_PROJECT_INFO = 38, + UNSUPPORTED_BLACKLIST_PATTERN_FORMAT = 39, + UNSUPPORTED_FILTER = 40, + UNSUPPORTED_FINDING_TYPE = 41, + UNSUPPORTED_URL_SCHEME = 42 + } + } + + /** Properties of a ScanRun. */ + interface IScanRun { + + /** ScanRun name */ + name?: (string|null); + + /** ScanRun executionState */ + executionState?: (google.cloud.websecurityscanner.v1.ScanRun.ExecutionState|keyof typeof google.cloud.websecurityscanner.v1.ScanRun.ExecutionState|null); + + /** ScanRun resultState */ + resultState?: (google.cloud.websecurityscanner.v1.ScanRun.ResultState|keyof typeof google.cloud.websecurityscanner.v1.ScanRun.ResultState|null); + + /** ScanRun startTime */ + startTime?: (google.protobuf.ITimestamp|null); + + /** ScanRun endTime */ + endTime?: (google.protobuf.ITimestamp|null); + + /** ScanRun urlsCrawledCount */ + urlsCrawledCount?: (number|Long|string|null); + + /** ScanRun urlsTestedCount */ + urlsTestedCount?: (number|Long|string|null); + + /** ScanRun hasVulnerabilities */ + hasVulnerabilities?: (boolean|null); + + /** ScanRun progressPercent */ + progressPercent?: (number|null); + + /** ScanRun errorTrace */ + errorTrace?: (google.cloud.websecurityscanner.v1.IScanRunErrorTrace|null); + + /** ScanRun warningTraces */ + warningTraces?: (google.cloud.websecurityscanner.v1.IScanRunWarningTrace[]|null); + } + + /** Represents a ScanRun. */ + class ScanRun implements IScanRun { + + /** + * Constructs a new ScanRun. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.websecurityscanner.v1.IScanRun); + + /** ScanRun name. */ + public name: string; + + /** ScanRun executionState. */ + public executionState: (google.cloud.websecurityscanner.v1.ScanRun.ExecutionState|keyof typeof google.cloud.websecurityscanner.v1.ScanRun.ExecutionState); + + /** ScanRun resultState. */ + public resultState: (google.cloud.websecurityscanner.v1.ScanRun.ResultState|keyof typeof google.cloud.websecurityscanner.v1.ScanRun.ResultState); + + /** ScanRun startTime. */ + public startTime?: (google.protobuf.ITimestamp|null); + + /** ScanRun endTime. */ + public endTime?: (google.protobuf.ITimestamp|null); + + /** ScanRun urlsCrawledCount. */ + public urlsCrawledCount: (number|Long|string); + + /** ScanRun urlsTestedCount. */ + public urlsTestedCount: (number|Long|string); + + /** ScanRun hasVulnerabilities. */ + public hasVulnerabilities: boolean; + + /** ScanRun progressPercent. */ + public progressPercent: number; + + /** ScanRun errorTrace. */ + public errorTrace?: (google.cloud.websecurityscanner.v1.IScanRunErrorTrace|null); + + /** ScanRun warningTraces. */ + public warningTraces: google.cloud.websecurityscanner.v1.IScanRunWarningTrace[]; + + /** + * Creates a new ScanRun instance using the specified properties. + * @param [properties] Properties to set + * @returns ScanRun instance + */ + public static create(properties?: google.cloud.websecurityscanner.v1.IScanRun): google.cloud.websecurityscanner.v1.ScanRun; + + /** + * Encodes the specified ScanRun message. Does not implicitly {@link google.cloud.websecurityscanner.v1.ScanRun.verify|verify} messages. + * @param message ScanRun message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.websecurityscanner.v1.IScanRun, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ScanRun message, length delimited. Does not implicitly {@link google.cloud.websecurityscanner.v1.ScanRun.verify|verify} messages. + * @param message ScanRun message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.websecurityscanner.v1.IScanRun, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ScanRun message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ScanRun + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.websecurityscanner.v1.ScanRun; + + /** + * Decodes a ScanRun message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ScanRun + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.websecurityscanner.v1.ScanRun; + + /** + * Verifies a ScanRun message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ScanRun message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ScanRun + */ + public static fromObject(object: { [k: string]: any }): google.cloud.websecurityscanner.v1.ScanRun; + + /** + * Creates a plain object from a ScanRun message. Also converts values to other types if specified. + * @param message ScanRun + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.websecurityscanner.v1.ScanRun, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ScanRun to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ScanRun + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace ScanRun { + + /** ExecutionState enum. */ + enum ExecutionState { + EXECUTION_STATE_UNSPECIFIED = 0, + QUEUED = 1, + SCANNING = 2, + FINISHED = 3 + } + + /** ResultState enum. */ + enum ResultState { + RESULT_STATE_UNSPECIFIED = 0, + SUCCESS = 1, + ERROR = 2, + KILLED = 3 + } + } + + /** Properties of a ScanRunErrorTrace. */ + interface IScanRunErrorTrace { + + /** ScanRunErrorTrace code */ + code?: (google.cloud.websecurityscanner.v1.ScanRunErrorTrace.Code|keyof typeof google.cloud.websecurityscanner.v1.ScanRunErrorTrace.Code|null); + + /** ScanRunErrorTrace scanConfigError */ + scanConfigError?: (google.cloud.websecurityscanner.v1.IScanConfigError|null); + + /** ScanRunErrorTrace mostCommonHttpErrorCode */ + mostCommonHttpErrorCode?: (number|null); + } + + /** Represents a ScanRunErrorTrace. */ + class ScanRunErrorTrace implements IScanRunErrorTrace { + + /** + * Constructs a new ScanRunErrorTrace. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.websecurityscanner.v1.IScanRunErrorTrace); + + /** ScanRunErrorTrace code. */ + public code: (google.cloud.websecurityscanner.v1.ScanRunErrorTrace.Code|keyof typeof google.cloud.websecurityscanner.v1.ScanRunErrorTrace.Code); + + /** ScanRunErrorTrace scanConfigError. */ + public scanConfigError?: (google.cloud.websecurityscanner.v1.IScanConfigError|null); + + /** ScanRunErrorTrace mostCommonHttpErrorCode. */ + public mostCommonHttpErrorCode: number; + + /** + * Creates a new ScanRunErrorTrace instance using the specified properties. + * @param [properties] Properties to set + * @returns ScanRunErrorTrace instance + */ + public static create(properties?: google.cloud.websecurityscanner.v1.IScanRunErrorTrace): google.cloud.websecurityscanner.v1.ScanRunErrorTrace; + + /** + * Encodes the specified ScanRunErrorTrace message. Does not implicitly {@link google.cloud.websecurityscanner.v1.ScanRunErrorTrace.verify|verify} messages. + * @param message ScanRunErrorTrace message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.websecurityscanner.v1.IScanRunErrorTrace, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ScanRunErrorTrace message, length delimited. Does not implicitly {@link google.cloud.websecurityscanner.v1.ScanRunErrorTrace.verify|verify} messages. + * @param message ScanRunErrorTrace message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.websecurityscanner.v1.IScanRunErrorTrace, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ScanRunErrorTrace message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ScanRunErrorTrace + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.websecurityscanner.v1.ScanRunErrorTrace; + + /** + * Decodes a ScanRunErrorTrace message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ScanRunErrorTrace + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.websecurityscanner.v1.ScanRunErrorTrace; + + /** + * Verifies a ScanRunErrorTrace message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ScanRunErrorTrace message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ScanRunErrorTrace + */ + public static fromObject(object: { [k: string]: any }): google.cloud.websecurityscanner.v1.ScanRunErrorTrace; + + /** + * Creates a plain object from a ScanRunErrorTrace message. Also converts values to other types if specified. + * @param message ScanRunErrorTrace + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.websecurityscanner.v1.ScanRunErrorTrace, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ScanRunErrorTrace to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ScanRunErrorTrace + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace ScanRunErrorTrace { + + /** Code enum. */ + enum Code { + CODE_UNSPECIFIED = 0, + INTERNAL_ERROR = 1, + SCAN_CONFIG_ISSUE = 2, + AUTHENTICATION_CONFIG_ISSUE = 3, + TIMED_OUT_WHILE_SCANNING = 4, + TOO_MANY_REDIRECTS = 5, + TOO_MANY_HTTP_ERRORS = 6 + } + } + + /** Properties of a ScanRunWarningTrace. */ + interface IScanRunWarningTrace { + + /** ScanRunWarningTrace code */ + code?: (google.cloud.websecurityscanner.v1.ScanRunWarningTrace.Code|keyof typeof google.cloud.websecurityscanner.v1.ScanRunWarningTrace.Code|null); + } + + /** Represents a ScanRunWarningTrace. */ + class ScanRunWarningTrace implements IScanRunWarningTrace { + + /** + * Constructs a new ScanRunWarningTrace. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.websecurityscanner.v1.IScanRunWarningTrace); + + /** ScanRunWarningTrace code. */ + public code: (google.cloud.websecurityscanner.v1.ScanRunWarningTrace.Code|keyof typeof google.cloud.websecurityscanner.v1.ScanRunWarningTrace.Code); + + /** + * Creates a new ScanRunWarningTrace instance using the specified properties. + * @param [properties] Properties to set + * @returns ScanRunWarningTrace instance + */ + public static create(properties?: google.cloud.websecurityscanner.v1.IScanRunWarningTrace): google.cloud.websecurityscanner.v1.ScanRunWarningTrace; + + /** + * Encodes the specified ScanRunWarningTrace message. Does not implicitly {@link google.cloud.websecurityscanner.v1.ScanRunWarningTrace.verify|verify} messages. + * @param message ScanRunWarningTrace message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.websecurityscanner.v1.IScanRunWarningTrace, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ScanRunWarningTrace message, length delimited. Does not implicitly {@link google.cloud.websecurityscanner.v1.ScanRunWarningTrace.verify|verify} messages. + * @param message ScanRunWarningTrace message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.websecurityscanner.v1.IScanRunWarningTrace, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ScanRunWarningTrace message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ScanRunWarningTrace + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.websecurityscanner.v1.ScanRunWarningTrace; + + /** + * Decodes a ScanRunWarningTrace message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ScanRunWarningTrace + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.websecurityscanner.v1.ScanRunWarningTrace; + + /** + * Verifies a ScanRunWarningTrace message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ScanRunWarningTrace message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ScanRunWarningTrace + */ + public static fromObject(object: { [k: string]: any }): google.cloud.websecurityscanner.v1.ScanRunWarningTrace; + + /** + * Creates a plain object from a ScanRunWarningTrace message. Also converts values to other types if specified. + * @param message ScanRunWarningTrace + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.websecurityscanner.v1.ScanRunWarningTrace, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ScanRunWarningTrace to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ScanRunWarningTrace + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace ScanRunWarningTrace { + + /** Code enum. */ + enum Code { + CODE_UNSPECIFIED = 0, + INSUFFICIENT_CRAWL_RESULTS = 1, + TOO_MANY_CRAWL_RESULTS = 2, + TOO_MANY_FUZZ_TASKS = 3, + BLOCKED_BY_IAP = 4, + NO_STARTING_URL_FOUND_FOR_MANAGED_SCAN = 5 + } + } + + /** Properties of a ScanRunLog. */ + interface IScanRunLog { + + /** ScanRunLog summary */ + summary?: (string|null); + + /** ScanRunLog name */ + name?: (string|null); + + /** ScanRunLog executionState */ + executionState?: (google.cloud.websecurityscanner.v1.ScanRun.ExecutionState|keyof typeof google.cloud.websecurityscanner.v1.ScanRun.ExecutionState|null); + + /** ScanRunLog resultState */ + resultState?: (google.cloud.websecurityscanner.v1.ScanRun.ResultState|keyof typeof google.cloud.websecurityscanner.v1.ScanRun.ResultState|null); + + /** ScanRunLog urlsCrawledCount */ + urlsCrawledCount?: (number|Long|string|null); + + /** ScanRunLog urlsTestedCount */ + urlsTestedCount?: (number|Long|string|null); + + /** ScanRunLog hasFindings */ + hasFindings?: (boolean|null); + + /** ScanRunLog errorTrace */ + errorTrace?: (google.cloud.websecurityscanner.v1.IScanRunErrorTrace|null); + } + + /** Represents a ScanRunLog. */ + class ScanRunLog implements IScanRunLog { + + /** + * Constructs a new ScanRunLog. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.websecurityscanner.v1.IScanRunLog); + + /** ScanRunLog summary. */ + public summary: string; + + /** ScanRunLog name. */ + public name: string; + + /** ScanRunLog executionState. */ + public executionState: (google.cloud.websecurityscanner.v1.ScanRun.ExecutionState|keyof typeof google.cloud.websecurityscanner.v1.ScanRun.ExecutionState); + + /** ScanRunLog resultState. */ + public resultState: (google.cloud.websecurityscanner.v1.ScanRun.ResultState|keyof typeof google.cloud.websecurityscanner.v1.ScanRun.ResultState); + + /** ScanRunLog urlsCrawledCount. */ + public urlsCrawledCount: (number|Long|string); + + /** ScanRunLog urlsTestedCount. */ + public urlsTestedCount: (number|Long|string); + + /** ScanRunLog hasFindings. */ + public hasFindings: boolean; + + /** ScanRunLog errorTrace. */ + public errorTrace?: (google.cloud.websecurityscanner.v1.IScanRunErrorTrace|null); + + /** + * Creates a new ScanRunLog instance using the specified properties. + * @param [properties] Properties to set + * @returns ScanRunLog instance + */ + public static create(properties?: google.cloud.websecurityscanner.v1.IScanRunLog): google.cloud.websecurityscanner.v1.ScanRunLog; + + /** + * Encodes the specified ScanRunLog message. Does not implicitly {@link google.cloud.websecurityscanner.v1.ScanRunLog.verify|verify} messages. + * @param message ScanRunLog message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.websecurityscanner.v1.IScanRunLog, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ScanRunLog message, length delimited. Does not implicitly {@link google.cloud.websecurityscanner.v1.ScanRunLog.verify|verify} messages. + * @param message ScanRunLog message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.websecurityscanner.v1.IScanRunLog, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ScanRunLog message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ScanRunLog + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.websecurityscanner.v1.ScanRunLog; + + /** + * Decodes a ScanRunLog message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ScanRunLog + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.websecurityscanner.v1.ScanRunLog; + + /** + * Verifies a ScanRunLog message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ScanRunLog message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ScanRunLog + */ + public static fromObject(object: { [k: string]: any }): google.cloud.websecurityscanner.v1.ScanRunLog; + + /** + * Creates a plain object from a ScanRunLog message. Also converts values to other types if specified. + * @param message ScanRunLog + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.websecurityscanner.v1.ScanRunLog, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ScanRunLog to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ScanRunLog + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Represents a WebSecurityScanner */ + class WebSecurityScanner extends $protobuf.rpc.Service { + + /** + * Constructs a new WebSecurityScanner 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 WebSecurityScanner 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): WebSecurityScanner; + + /** + * Calls CreateScanConfig. + * @param request CreateScanConfigRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ScanConfig + */ + public createScanConfig(request: google.cloud.websecurityscanner.v1.ICreateScanConfigRequest, callback: google.cloud.websecurityscanner.v1.WebSecurityScanner.CreateScanConfigCallback): void; + + /** + * Calls CreateScanConfig. + * @param request CreateScanConfigRequest message or plain object + * @returns Promise + */ + public createScanConfig(request: google.cloud.websecurityscanner.v1.ICreateScanConfigRequest): Promise; + + /** + * Calls DeleteScanConfig. + * @param request DeleteScanConfigRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Empty + */ + public deleteScanConfig(request: google.cloud.websecurityscanner.v1.IDeleteScanConfigRequest, callback: google.cloud.websecurityscanner.v1.WebSecurityScanner.DeleteScanConfigCallback): void; + + /** + * Calls DeleteScanConfig. + * @param request DeleteScanConfigRequest message or plain object + * @returns Promise + */ + public deleteScanConfig(request: google.cloud.websecurityscanner.v1.IDeleteScanConfigRequest): Promise; + + /** + * Calls GetScanConfig. + * @param request GetScanConfigRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ScanConfig + */ + public getScanConfig(request: google.cloud.websecurityscanner.v1.IGetScanConfigRequest, callback: google.cloud.websecurityscanner.v1.WebSecurityScanner.GetScanConfigCallback): void; + + /** + * Calls GetScanConfig. + * @param request GetScanConfigRequest message or plain object + * @returns Promise + */ + public getScanConfig(request: google.cloud.websecurityscanner.v1.IGetScanConfigRequest): Promise; + + /** + * Calls ListScanConfigs. + * @param request ListScanConfigsRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ListScanConfigsResponse + */ + public listScanConfigs(request: google.cloud.websecurityscanner.v1.IListScanConfigsRequest, callback: google.cloud.websecurityscanner.v1.WebSecurityScanner.ListScanConfigsCallback): void; + + /** + * Calls ListScanConfigs. + * @param request ListScanConfigsRequest message or plain object + * @returns Promise + */ + public listScanConfigs(request: google.cloud.websecurityscanner.v1.IListScanConfigsRequest): Promise; + + /** + * Calls UpdateScanConfig. + * @param request UpdateScanConfigRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ScanConfig + */ + public updateScanConfig(request: google.cloud.websecurityscanner.v1.IUpdateScanConfigRequest, callback: google.cloud.websecurityscanner.v1.WebSecurityScanner.UpdateScanConfigCallback): void; + + /** + * Calls UpdateScanConfig. + * @param request UpdateScanConfigRequest message or plain object + * @returns Promise + */ + public updateScanConfig(request: google.cloud.websecurityscanner.v1.IUpdateScanConfigRequest): Promise; + + /** + * Calls StartScanRun. + * @param request StartScanRunRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ScanRun + */ + public startScanRun(request: google.cloud.websecurityscanner.v1.IStartScanRunRequest, callback: google.cloud.websecurityscanner.v1.WebSecurityScanner.StartScanRunCallback): void; + + /** + * Calls StartScanRun. + * @param request StartScanRunRequest message or plain object + * @returns Promise + */ + public startScanRun(request: google.cloud.websecurityscanner.v1.IStartScanRunRequest): Promise; + + /** + * Calls GetScanRun. + * @param request GetScanRunRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ScanRun + */ + public getScanRun(request: google.cloud.websecurityscanner.v1.IGetScanRunRequest, callback: google.cloud.websecurityscanner.v1.WebSecurityScanner.GetScanRunCallback): void; + + /** + * Calls GetScanRun. + * @param request GetScanRunRequest message or plain object + * @returns Promise + */ + public getScanRun(request: google.cloud.websecurityscanner.v1.IGetScanRunRequest): Promise; + + /** + * Calls ListScanRuns. + * @param request ListScanRunsRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ListScanRunsResponse + */ + public listScanRuns(request: google.cloud.websecurityscanner.v1.IListScanRunsRequest, callback: google.cloud.websecurityscanner.v1.WebSecurityScanner.ListScanRunsCallback): void; + + /** + * Calls ListScanRuns. + * @param request ListScanRunsRequest message or plain object + * @returns Promise + */ + public listScanRuns(request: google.cloud.websecurityscanner.v1.IListScanRunsRequest): Promise; + + /** + * Calls StopScanRun. + * @param request StopScanRunRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ScanRun + */ + public stopScanRun(request: google.cloud.websecurityscanner.v1.IStopScanRunRequest, callback: google.cloud.websecurityscanner.v1.WebSecurityScanner.StopScanRunCallback): void; + + /** + * Calls StopScanRun. + * @param request StopScanRunRequest message or plain object + * @returns Promise + */ + public stopScanRun(request: google.cloud.websecurityscanner.v1.IStopScanRunRequest): Promise; + + /** + * Calls ListCrawledUrls. + * @param request ListCrawledUrlsRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ListCrawledUrlsResponse + */ + public listCrawledUrls(request: google.cloud.websecurityscanner.v1.IListCrawledUrlsRequest, callback: google.cloud.websecurityscanner.v1.WebSecurityScanner.ListCrawledUrlsCallback): void; + + /** + * Calls ListCrawledUrls. + * @param request ListCrawledUrlsRequest message or plain object + * @returns Promise + */ + public listCrawledUrls(request: google.cloud.websecurityscanner.v1.IListCrawledUrlsRequest): Promise; + + /** + * Calls GetFinding. + * @param request GetFindingRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Finding + */ + public getFinding(request: google.cloud.websecurityscanner.v1.IGetFindingRequest, callback: google.cloud.websecurityscanner.v1.WebSecurityScanner.GetFindingCallback): void; + + /** + * Calls GetFinding. + * @param request GetFindingRequest message or plain object + * @returns Promise + */ + public getFinding(request: google.cloud.websecurityscanner.v1.IGetFindingRequest): Promise; + + /** + * Calls ListFindings. + * @param request ListFindingsRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ListFindingsResponse + */ + public listFindings(request: google.cloud.websecurityscanner.v1.IListFindingsRequest, callback: google.cloud.websecurityscanner.v1.WebSecurityScanner.ListFindingsCallback): void; + + /** + * Calls ListFindings. + * @param request ListFindingsRequest message or plain object + * @returns Promise + */ + public listFindings(request: google.cloud.websecurityscanner.v1.IListFindingsRequest): Promise; + + /** + * Calls ListFindingTypeStats. + * @param request ListFindingTypeStatsRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ListFindingTypeStatsResponse + */ + public listFindingTypeStats(request: google.cloud.websecurityscanner.v1.IListFindingTypeStatsRequest, callback: google.cloud.websecurityscanner.v1.WebSecurityScanner.ListFindingTypeStatsCallback): void; + + /** + * Calls ListFindingTypeStats. + * @param request ListFindingTypeStatsRequest message or plain object + * @returns Promise + */ + public listFindingTypeStats(request: google.cloud.websecurityscanner.v1.IListFindingTypeStatsRequest): Promise; + } + + namespace WebSecurityScanner { + + /** + * Callback as used by {@link google.cloud.websecurityscanner.v1.WebSecurityScanner|createScanConfig}. + * @param error Error, if any + * @param [response] ScanConfig + */ + type CreateScanConfigCallback = (error: (Error|null), response?: google.cloud.websecurityscanner.v1.ScanConfig) => void; + + /** + * Callback as used by {@link google.cloud.websecurityscanner.v1.WebSecurityScanner|deleteScanConfig}. + * @param error Error, if any + * @param [response] Empty + */ + type DeleteScanConfigCallback = (error: (Error|null), response?: google.protobuf.Empty) => void; + + /** + * Callback as used by {@link google.cloud.websecurityscanner.v1.WebSecurityScanner|getScanConfig}. + * @param error Error, if any + * @param [response] ScanConfig + */ + type GetScanConfigCallback = (error: (Error|null), response?: google.cloud.websecurityscanner.v1.ScanConfig) => void; + + /** + * Callback as used by {@link google.cloud.websecurityscanner.v1.WebSecurityScanner|listScanConfigs}. + * @param error Error, if any + * @param [response] ListScanConfigsResponse + */ + type ListScanConfigsCallback = (error: (Error|null), response?: google.cloud.websecurityscanner.v1.ListScanConfigsResponse) => void; + + /** + * Callback as used by {@link google.cloud.websecurityscanner.v1.WebSecurityScanner|updateScanConfig}. + * @param error Error, if any + * @param [response] ScanConfig + */ + type UpdateScanConfigCallback = (error: (Error|null), response?: google.cloud.websecurityscanner.v1.ScanConfig) => void; + + /** + * Callback as used by {@link google.cloud.websecurityscanner.v1.WebSecurityScanner|startScanRun}. + * @param error Error, if any + * @param [response] ScanRun + */ + type StartScanRunCallback = (error: (Error|null), response?: google.cloud.websecurityscanner.v1.ScanRun) => void; + + /** + * Callback as used by {@link google.cloud.websecurityscanner.v1.WebSecurityScanner|getScanRun}. + * @param error Error, if any + * @param [response] ScanRun + */ + type GetScanRunCallback = (error: (Error|null), response?: google.cloud.websecurityscanner.v1.ScanRun) => void; + + /** + * Callback as used by {@link google.cloud.websecurityscanner.v1.WebSecurityScanner|listScanRuns}. + * @param error Error, if any + * @param [response] ListScanRunsResponse + */ + type ListScanRunsCallback = (error: (Error|null), response?: google.cloud.websecurityscanner.v1.ListScanRunsResponse) => void; + + /** + * Callback as used by {@link google.cloud.websecurityscanner.v1.WebSecurityScanner|stopScanRun}. + * @param error Error, if any + * @param [response] ScanRun + */ + type StopScanRunCallback = (error: (Error|null), response?: google.cloud.websecurityscanner.v1.ScanRun) => void; + + /** + * Callback as used by {@link google.cloud.websecurityscanner.v1.WebSecurityScanner|listCrawledUrls}. + * @param error Error, if any + * @param [response] ListCrawledUrlsResponse + */ + type ListCrawledUrlsCallback = (error: (Error|null), response?: google.cloud.websecurityscanner.v1.ListCrawledUrlsResponse) => void; + + /** + * Callback as used by {@link google.cloud.websecurityscanner.v1.WebSecurityScanner|getFinding}. + * @param error Error, if any + * @param [response] Finding + */ + type GetFindingCallback = (error: (Error|null), response?: google.cloud.websecurityscanner.v1.Finding) => void; + + /** + * Callback as used by {@link google.cloud.websecurityscanner.v1.WebSecurityScanner|listFindings}. + * @param error Error, if any + * @param [response] ListFindingsResponse + */ + type ListFindingsCallback = (error: (Error|null), response?: google.cloud.websecurityscanner.v1.ListFindingsResponse) => void; + + /** + * Callback as used by {@link google.cloud.websecurityscanner.v1.WebSecurityScanner|listFindingTypeStats}. + * @param error Error, if any + * @param [response] ListFindingTypeStatsResponse + */ + type ListFindingTypeStatsCallback = (error: (Error|null), response?: google.cloud.websecurityscanner.v1.ListFindingTypeStatsResponse) => void; + } + + /** Properties of a CreateScanConfigRequest. */ + interface ICreateScanConfigRequest { + + /** CreateScanConfigRequest parent */ + parent?: (string|null); + + /** CreateScanConfigRequest scanConfig */ + scanConfig?: (google.cloud.websecurityscanner.v1.IScanConfig|null); + } + + /** Represents a CreateScanConfigRequest. */ + class CreateScanConfigRequest implements ICreateScanConfigRequest { + + /** + * Constructs a new CreateScanConfigRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.websecurityscanner.v1.ICreateScanConfigRequest); + + /** CreateScanConfigRequest parent. */ + public parent: string; + + /** CreateScanConfigRequest scanConfig. */ + public scanConfig?: (google.cloud.websecurityscanner.v1.IScanConfig|null); + + /** + * Creates a new CreateScanConfigRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns CreateScanConfigRequest instance + */ + public static create(properties?: google.cloud.websecurityscanner.v1.ICreateScanConfigRequest): google.cloud.websecurityscanner.v1.CreateScanConfigRequest; + + /** + * Encodes the specified CreateScanConfigRequest message. Does not implicitly {@link google.cloud.websecurityscanner.v1.CreateScanConfigRequest.verify|verify} messages. + * @param message CreateScanConfigRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.websecurityscanner.v1.ICreateScanConfigRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CreateScanConfigRequest message, length delimited. Does not implicitly {@link google.cloud.websecurityscanner.v1.CreateScanConfigRequest.verify|verify} messages. + * @param message CreateScanConfigRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.websecurityscanner.v1.ICreateScanConfigRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CreateScanConfigRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CreateScanConfigRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.websecurityscanner.v1.CreateScanConfigRequest; + + /** + * Decodes a CreateScanConfigRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CreateScanConfigRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.websecurityscanner.v1.CreateScanConfigRequest; + + /** + * Verifies a CreateScanConfigRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a CreateScanConfigRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CreateScanConfigRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.websecurityscanner.v1.CreateScanConfigRequest; + + /** + * Creates a plain object from a CreateScanConfigRequest message. Also converts values to other types if specified. + * @param message CreateScanConfigRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.websecurityscanner.v1.CreateScanConfigRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CreateScanConfigRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CreateScanConfigRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a DeleteScanConfigRequest. */ + interface IDeleteScanConfigRequest { + + /** DeleteScanConfigRequest name */ + name?: (string|null); + } + + /** Represents a DeleteScanConfigRequest. */ + class DeleteScanConfigRequest implements IDeleteScanConfigRequest { + + /** + * Constructs a new DeleteScanConfigRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.websecurityscanner.v1.IDeleteScanConfigRequest); + + /** DeleteScanConfigRequest name. */ + public name: string; + + /** + * Creates a new DeleteScanConfigRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns DeleteScanConfigRequest instance + */ + public static create(properties?: google.cloud.websecurityscanner.v1.IDeleteScanConfigRequest): google.cloud.websecurityscanner.v1.DeleteScanConfigRequest; + + /** + * Encodes the specified DeleteScanConfigRequest message. Does not implicitly {@link google.cloud.websecurityscanner.v1.DeleteScanConfigRequest.verify|verify} messages. + * @param message DeleteScanConfigRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.websecurityscanner.v1.IDeleteScanConfigRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DeleteScanConfigRequest message, length delimited. Does not implicitly {@link google.cloud.websecurityscanner.v1.DeleteScanConfigRequest.verify|verify} messages. + * @param message DeleteScanConfigRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.websecurityscanner.v1.IDeleteScanConfigRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DeleteScanConfigRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DeleteScanConfigRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.websecurityscanner.v1.DeleteScanConfigRequest; + + /** + * Decodes a DeleteScanConfigRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DeleteScanConfigRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.websecurityscanner.v1.DeleteScanConfigRequest; + + /** + * Verifies a DeleteScanConfigRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a DeleteScanConfigRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DeleteScanConfigRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.websecurityscanner.v1.DeleteScanConfigRequest; + + /** + * Creates a plain object from a DeleteScanConfigRequest message. Also converts values to other types if specified. + * @param message DeleteScanConfigRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.websecurityscanner.v1.DeleteScanConfigRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DeleteScanConfigRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DeleteScanConfigRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a GetScanConfigRequest. */ + interface IGetScanConfigRequest { + + /** GetScanConfigRequest name */ + name?: (string|null); + } + + /** Represents a GetScanConfigRequest. */ + class GetScanConfigRequest implements IGetScanConfigRequest { + + /** + * Constructs a new GetScanConfigRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.websecurityscanner.v1.IGetScanConfigRequest); + + /** GetScanConfigRequest name. */ + public name: string; + + /** + * Creates a new GetScanConfigRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns GetScanConfigRequest instance + */ + public static create(properties?: google.cloud.websecurityscanner.v1.IGetScanConfigRequest): google.cloud.websecurityscanner.v1.GetScanConfigRequest; + + /** + * Encodes the specified GetScanConfigRequest message. Does not implicitly {@link google.cloud.websecurityscanner.v1.GetScanConfigRequest.verify|verify} messages. + * @param message GetScanConfigRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.websecurityscanner.v1.IGetScanConfigRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GetScanConfigRequest message, length delimited. Does not implicitly {@link google.cloud.websecurityscanner.v1.GetScanConfigRequest.verify|verify} messages. + * @param message GetScanConfigRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.websecurityscanner.v1.IGetScanConfigRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GetScanConfigRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GetScanConfigRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.websecurityscanner.v1.GetScanConfigRequest; + + /** + * Decodes a GetScanConfigRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GetScanConfigRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.websecurityscanner.v1.GetScanConfigRequest; + + /** + * Verifies a GetScanConfigRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GetScanConfigRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GetScanConfigRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.websecurityscanner.v1.GetScanConfigRequest; + + /** + * Creates a plain object from a GetScanConfigRequest message. Also converts values to other types if specified. + * @param message GetScanConfigRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.websecurityscanner.v1.GetScanConfigRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GetScanConfigRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GetScanConfigRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListScanConfigsRequest. */ + interface IListScanConfigsRequest { + + /** ListScanConfigsRequest parent */ + parent?: (string|null); + + /** ListScanConfigsRequest pageToken */ + pageToken?: (string|null); + + /** ListScanConfigsRequest pageSize */ + pageSize?: (number|null); + } + + /** Represents a ListScanConfigsRequest. */ + class ListScanConfigsRequest implements IListScanConfigsRequest { + + /** + * Constructs a new ListScanConfigsRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.websecurityscanner.v1.IListScanConfigsRequest); + + /** ListScanConfigsRequest parent. */ + public parent: string; + + /** ListScanConfigsRequest pageToken. */ + public pageToken: string; + + /** ListScanConfigsRequest pageSize. */ + public pageSize: number; + + /** + * Creates a new ListScanConfigsRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ListScanConfigsRequest instance + */ + public static create(properties?: google.cloud.websecurityscanner.v1.IListScanConfigsRequest): google.cloud.websecurityscanner.v1.ListScanConfigsRequest; + + /** + * Encodes the specified ListScanConfigsRequest message. Does not implicitly {@link google.cloud.websecurityscanner.v1.ListScanConfigsRequest.verify|verify} messages. + * @param message ListScanConfigsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.websecurityscanner.v1.IListScanConfigsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListScanConfigsRequest message, length delimited. Does not implicitly {@link google.cloud.websecurityscanner.v1.ListScanConfigsRequest.verify|verify} messages. + * @param message ListScanConfigsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.websecurityscanner.v1.IListScanConfigsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListScanConfigsRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListScanConfigsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.websecurityscanner.v1.ListScanConfigsRequest; + + /** + * Decodes a ListScanConfigsRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListScanConfigsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.websecurityscanner.v1.ListScanConfigsRequest; + + /** + * Verifies a ListScanConfigsRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListScanConfigsRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListScanConfigsRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.websecurityscanner.v1.ListScanConfigsRequest; + + /** + * Creates a plain object from a ListScanConfigsRequest message. Also converts values to other types if specified. + * @param message ListScanConfigsRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.websecurityscanner.v1.ListScanConfigsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListScanConfigsRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListScanConfigsRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an UpdateScanConfigRequest. */ + interface IUpdateScanConfigRequest { + + /** UpdateScanConfigRequest scanConfig */ + scanConfig?: (google.cloud.websecurityscanner.v1.IScanConfig|null); + + /** UpdateScanConfigRequest updateMask */ + updateMask?: (google.protobuf.IFieldMask|null); + } + + /** Represents an UpdateScanConfigRequest. */ + class UpdateScanConfigRequest implements IUpdateScanConfigRequest { + + /** + * Constructs a new UpdateScanConfigRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.websecurityscanner.v1.IUpdateScanConfigRequest); + + /** UpdateScanConfigRequest scanConfig. */ + public scanConfig?: (google.cloud.websecurityscanner.v1.IScanConfig|null); + + /** UpdateScanConfigRequest updateMask. */ + public updateMask?: (google.protobuf.IFieldMask|null); + + /** + * Creates a new UpdateScanConfigRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns UpdateScanConfigRequest instance + */ + public static create(properties?: google.cloud.websecurityscanner.v1.IUpdateScanConfigRequest): google.cloud.websecurityscanner.v1.UpdateScanConfigRequest; + + /** + * Encodes the specified UpdateScanConfigRequest message. Does not implicitly {@link google.cloud.websecurityscanner.v1.UpdateScanConfigRequest.verify|verify} messages. + * @param message UpdateScanConfigRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.websecurityscanner.v1.IUpdateScanConfigRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified UpdateScanConfigRequest message, length delimited. Does not implicitly {@link google.cloud.websecurityscanner.v1.UpdateScanConfigRequest.verify|verify} messages. + * @param message UpdateScanConfigRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.websecurityscanner.v1.IUpdateScanConfigRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an UpdateScanConfigRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns UpdateScanConfigRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.websecurityscanner.v1.UpdateScanConfigRequest; + + /** + * Decodes an UpdateScanConfigRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns UpdateScanConfigRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.websecurityscanner.v1.UpdateScanConfigRequest; + + /** + * Verifies an UpdateScanConfigRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an UpdateScanConfigRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns UpdateScanConfigRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.websecurityscanner.v1.UpdateScanConfigRequest; + + /** + * Creates a plain object from an UpdateScanConfigRequest message. Also converts values to other types if specified. + * @param message UpdateScanConfigRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.websecurityscanner.v1.UpdateScanConfigRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this UpdateScanConfigRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for UpdateScanConfigRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListScanConfigsResponse. */ + interface IListScanConfigsResponse { + + /** ListScanConfigsResponse scanConfigs */ + scanConfigs?: (google.cloud.websecurityscanner.v1.IScanConfig[]|null); + + /** ListScanConfigsResponse nextPageToken */ + nextPageToken?: (string|null); + } + + /** Represents a ListScanConfigsResponse. */ + class ListScanConfigsResponse implements IListScanConfigsResponse { + + /** + * Constructs a new ListScanConfigsResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.websecurityscanner.v1.IListScanConfigsResponse); + + /** ListScanConfigsResponse scanConfigs. */ + public scanConfigs: google.cloud.websecurityscanner.v1.IScanConfig[]; + + /** ListScanConfigsResponse nextPageToken. */ + public nextPageToken: string; + + /** + * Creates a new ListScanConfigsResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns ListScanConfigsResponse instance + */ + public static create(properties?: google.cloud.websecurityscanner.v1.IListScanConfigsResponse): google.cloud.websecurityscanner.v1.ListScanConfigsResponse; + + /** + * Encodes the specified ListScanConfigsResponse message. Does not implicitly {@link google.cloud.websecurityscanner.v1.ListScanConfigsResponse.verify|verify} messages. + * @param message ListScanConfigsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.websecurityscanner.v1.IListScanConfigsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListScanConfigsResponse message, length delimited. Does not implicitly {@link google.cloud.websecurityscanner.v1.ListScanConfigsResponse.verify|verify} messages. + * @param message ListScanConfigsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.websecurityscanner.v1.IListScanConfigsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListScanConfigsResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListScanConfigsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.websecurityscanner.v1.ListScanConfigsResponse; + + /** + * Decodes a ListScanConfigsResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListScanConfigsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.websecurityscanner.v1.ListScanConfigsResponse; + + /** + * Verifies a ListScanConfigsResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListScanConfigsResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListScanConfigsResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.websecurityscanner.v1.ListScanConfigsResponse; + + /** + * Creates a plain object from a ListScanConfigsResponse message. Also converts values to other types if specified. + * @param message ListScanConfigsResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.websecurityscanner.v1.ListScanConfigsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListScanConfigsResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListScanConfigsResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a StartScanRunRequest. */ + interface IStartScanRunRequest { + + /** StartScanRunRequest name */ + name?: (string|null); + } + + /** Represents a StartScanRunRequest. */ + class StartScanRunRequest implements IStartScanRunRequest { + + /** + * Constructs a new StartScanRunRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.websecurityscanner.v1.IStartScanRunRequest); + + /** StartScanRunRequest name. */ + public name: string; + + /** + * Creates a new StartScanRunRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns StartScanRunRequest instance + */ + public static create(properties?: google.cloud.websecurityscanner.v1.IStartScanRunRequest): google.cloud.websecurityscanner.v1.StartScanRunRequest; + + /** + * Encodes the specified StartScanRunRequest message. Does not implicitly {@link google.cloud.websecurityscanner.v1.StartScanRunRequest.verify|verify} messages. + * @param message StartScanRunRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.websecurityscanner.v1.IStartScanRunRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified StartScanRunRequest message, length delimited. Does not implicitly {@link google.cloud.websecurityscanner.v1.StartScanRunRequest.verify|verify} messages. + * @param message StartScanRunRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.websecurityscanner.v1.IStartScanRunRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a StartScanRunRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns StartScanRunRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.websecurityscanner.v1.StartScanRunRequest; + + /** + * Decodes a StartScanRunRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns StartScanRunRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.websecurityscanner.v1.StartScanRunRequest; + + /** + * Verifies a StartScanRunRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a StartScanRunRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns StartScanRunRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.websecurityscanner.v1.StartScanRunRequest; + + /** + * Creates a plain object from a StartScanRunRequest message. Also converts values to other types if specified. + * @param message StartScanRunRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.websecurityscanner.v1.StartScanRunRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this StartScanRunRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for StartScanRunRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a GetScanRunRequest. */ + interface IGetScanRunRequest { + + /** GetScanRunRequest name */ + name?: (string|null); + } + + /** Represents a GetScanRunRequest. */ + class GetScanRunRequest implements IGetScanRunRequest { + + /** + * Constructs a new GetScanRunRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.websecurityscanner.v1.IGetScanRunRequest); + + /** GetScanRunRequest name. */ + public name: string; + + /** + * Creates a new GetScanRunRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns GetScanRunRequest instance + */ + public static create(properties?: google.cloud.websecurityscanner.v1.IGetScanRunRequest): google.cloud.websecurityscanner.v1.GetScanRunRequest; + + /** + * Encodes the specified GetScanRunRequest message. Does not implicitly {@link google.cloud.websecurityscanner.v1.GetScanRunRequest.verify|verify} messages. + * @param message GetScanRunRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.websecurityscanner.v1.IGetScanRunRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GetScanRunRequest message, length delimited. Does not implicitly {@link google.cloud.websecurityscanner.v1.GetScanRunRequest.verify|verify} messages. + * @param message GetScanRunRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.websecurityscanner.v1.IGetScanRunRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GetScanRunRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GetScanRunRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.websecurityscanner.v1.GetScanRunRequest; + + /** + * Decodes a GetScanRunRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GetScanRunRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.websecurityscanner.v1.GetScanRunRequest; + + /** + * Verifies a GetScanRunRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GetScanRunRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GetScanRunRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.websecurityscanner.v1.GetScanRunRequest; + + /** + * Creates a plain object from a GetScanRunRequest message. Also converts values to other types if specified. + * @param message GetScanRunRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.websecurityscanner.v1.GetScanRunRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GetScanRunRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GetScanRunRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListScanRunsRequest. */ + interface IListScanRunsRequest { + + /** ListScanRunsRequest parent */ + parent?: (string|null); + + /** ListScanRunsRequest pageToken */ + pageToken?: (string|null); + + /** ListScanRunsRequest pageSize */ + pageSize?: (number|null); + } + + /** Represents a ListScanRunsRequest. */ + class ListScanRunsRequest implements IListScanRunsRequest { + + /** + * Constructs a new ListScanRunsRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.websecurityscanner.v1.IListScanRunsRequest); + + /** ListScanRunsRequest parent. */ + public parent: string; + + /** ListScanRunsRequest pageToken. */ + public pageToken: string; + + /** ListScanRunsRequest pageSize. */ + public pageSize: number; + + /** + * Creates a new ListScanRunsRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ListScanRunsRequest instance + */ + public static create(properties?: google.cloud.websecurityscanner.v1.IListScanRunsRequest): google.cloud.websecurityscanner.v1.ListScanRunsRequest; + + /** + * Encodes the specified ListScanRunsRequest message. Does not implicitly {@link google.cloud.websecurityscanner.v1.ListScanRunsRequest.verify|verify} messages. + * @param message ListScanRunsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.websecurityscanner.v1.IListScanRunsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListScanRunsRequest message, length delimited. Does not implicitly {@link google.cloud.websecurityscanner.v1.ListScanRunsRequest.verify|verify} messages. + * @param message ListScanRunsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.websecurityscanner.v1.IListScanRunsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListScanRunsRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListScanRunsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.websecurityscanner.v1.ListScanRunsRequest; + + /** + * Decodes a ListScanRunsRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListScanRunsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.websecurityscanner.v1.ListScanRunsRequest; + + /** + * Verifies a ListScanRunsRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListScanRunsRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListScanRunsRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.websecurityscanner.v1.ListScanRunsRequest; + + /** + * Creates a plain object from a ListScanRunsRequest message. Also converts values to other types if specified. + * @param message ListScanRunsRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.websecurityscanner.v1.ListScanRunsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListScanRunsRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListScanRunsRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListScanRunsResponse. */ + interface IListScanRunsResponse { + + /** ListScanRunsResponse scanRuns */ + scanRuns?: (google.cloud.websecurityscanner.v1.IScanRun[]|null); + + /** ListScanRunsResponse nextPageToken */ + nextPageToken?: (string|null); + } + + /** Represents a ListScanRunsResponse. */ + class ListScanRunsResponse implements IListScanRunsResponse { + + /** + * Constructs a new ListScanRunsResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.websecurityscanner.v1.IListScanRunsResponse); + + /** ListScanRunsResponse scanRuns. */ + public scanRuns: google.cloud.websecurityscanner.v1.IScanRun[]; + + /** ListScanRunsResponse nextPageToken. */ + public nextPageToken: string; + + /** + * Creates a new ListScanRunsResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns ListScanRunsResponse instance + */ + public static create(properties?: google.cloud.websecurityscanner.v1.IListScanRunsResponse): google.cloud.websecurityscanner.v1.ListScanRunsResponse; + + /** + * Encodes the specified ListScanRunsResponse message. Does not implicitly {@link google.cloud.websecurityscanner.v1.ListScanRunsResponse.verify|verify} messages. + * @param message ListScanRunsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.websecurityscanner.v1.IListScanRunsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListScanRunsResponse message, length delimited. Does not implicitly {@link google.cloud.websecurityscanner.v1.ListScanRunsResponse.verify|verify} messages. + * @param message ListScanRunsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.websecurityscanner.v1.IListScanRunsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListScanRunsResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListScanRunsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.websecurityscanner.v1.ListScanRunsResponse; + + /** + * Decodes a ListScanRunsResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListScanRunsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.websecurityscanner.v1.ListScanRunsResponse; + + /** + * Verifies a ListScanRunsResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListScanRunsResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListScanRunsResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.websecurityscanner.v1.ListScanRunsResponse; + + /** + * Creates a plain object from a ListScanRunsResponse message. Also converts values to other types if specified. + * @param message ListScanRunsResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.websecurityscanner.v1.ListScanRunsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListScanRunsResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListScanRunsResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a StopScanRunRequest. */ + interface IStopScanRunRequest { + + /** StopScanRunRequest name */ + name?: (string|null); + } + + /** Represents a StopScanRunRequest. */ + class StopScanRunRequest implements IStopScanRunRequest { + + /** + * Constructs a new StopScanRunRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.websecurityscanner.v1.IStopScanRunRequest); + + /** StopScanRunRequest name. */ + public name: string; + + /** + * Creates a new StopScanRunRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns StopScanRunRequest instance + */ + public static create(properties?: google.cloud.websecurityscanner.v1.IStopScanRunRequest): google.cloud.websecurityscanner.v1.StopScanRunRequest; + + /** + * Encodes the specified StopScanRunRequest message. Does not implicitly {@link google.cloud.websecurityscanner.v1.StopScanRunRequest.verify|verify} messages. + * @param message StopScanRunRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.websecurityscanner.v1.IStopScanRunRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified StopScanRunRequest message, length delimited. Does not implicitly {@link google.cloud.websecurityscanner.v1.StopScanRunRequest.verify|verify} messages. + * @param message StopScanRunRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.websecurityscanner.v1.IStopScanRunRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a StopScanRunRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns StopScanRunRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.websecurityscanner.v1.StopScanRunRequest; + + /** + * Decodes a StopScanRunRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns StopScanRunRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.websecurityscanner.v1.StopScanRunRequest; + + /** + * Verifies a StopScanRunRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a StopScanRunRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns StopScanRunRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.websecurityscanner.v1.StopScanRunRequest; + + /** + * Creates a plain object from a StopScanRunRequest message. Also converts values to other types if specified. + * @param message StopScanRunRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.websecurityscanner.v1.StopScanRunRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this StopScanRunRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for StopScanRunRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListCrawledUrlsRequest. */ + interface IListCrawledUrlsRequest { + + /** ListCrawledUrlsRequest parent */ + parent?: (string|null); + + /** ListCrawledUrlsRequest pageToken */ + pageToken?: (string|null); + + /** ListCrawledUrlsRequest pageSize */ + pageSize?: (number|null); + } + + /** Represents a ListCrawledUrlsRequest. */ + class ListCrawledUrlsRequest implements IListCrawledUrlsRequest { + + /** + * Constructs a new ListCrawledUrlsRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.websecurityscanner.v1.IListCrawledUrlsRequest); + + /** ListCrawledUrlsRequest parent. */ + public parent: string; + + /** ListCrawledUrlsRequest pageToken. */ + public pageToken: string; + + /** ListCrawledUrlsRequest pageSize. */ + public pageSize: number; + + /** + * Creates a new ListCrawledUrlsRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ListCrawledUrlsRequest instance + */ + public static create(properties?: google.cloud.websecurityscanner.v1.IListCrawledUrlsRequest): google.cloud.websecurityscanner.v1.ListCrawledUrlsRequest; + + /** + * Encodes the specified ListCrawledUrlsRequest message. Does not implicitly {@link google.cloud.websecurityscanner.v1.ListCrawledUrlsRequest.verify|verify} messages. + * @param message ListCrawledUrlsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.websecurityscanner.v1.IListCrawledUrlsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListCrawledUrlsRequest message, length delimited. Does not implicitly {@link google.cloud.websecurityscanner.v1.ListCrawledUrlsRequest.verify|verify} messages. + * @param message ListCrawledUrlsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.websecurityscanner.v1.IListCrawledUrlsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListCrawledUrlsRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListCrawledUrlsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.websecurityscanner.v1.ListCrawledUrlsRequest; + + /** + * Decodes a ListCrawledUrlsRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListCrawledUrlsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.websecurityscanner.v1.ListCrawledUrlsRequest; + + /** + * Verifies a ListCrawledUrlsRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListCrawledUrlsRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListCrawledUrlsRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.websecurityscanner.v1.ListCrawledUrlsRequest; + + /** + * Creates a plain object from a ListCrawledUrlsRequest message. Also converts values to other types if specified. + * @param message ListCrawledUrlsRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.websecurityscanner.v1.ListCrawledUrlsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListCrawledUrlsRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListCrawledUrlsRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListCrawledUrlsResponse. */ + interface IListCrawledUrlsResponse { + + /** ListCrawledUrlsResponse crawledUrls */ + crawledUrls?: (google.cloud.websecurityscanner.v1.ICrawledUrl[]|null); + + /** ListCrawledUrlsResponse nextPageToken */ + nextPageToken?: (string|null); + } + + /** Represents a ListCrawledUrlsResponse. */ + class ListCrawledUrlsResponse implements IListCrawledUrlsResponse { + + /** + * Constructs a new ListCrawledUrlsResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.websecurityscanner.v1.IListCrawledUrlsResponse); + + /** ListCrawledUrlsResponse crawledUrls. */ + public crawledUrls: google.cloud.websecurityscanner.v1.ICrawledUrl[]; + + /** ListCrawledUrlsResponse nextPageToken. */ + public nextPageToken: string; + + /** + * Creates a new ListCrawledUrlsResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns ListCrawledUrlsResponse instance + */ + public static create(properties?: google.cloud.websecurityscanner.v1.IListCrawledUrlsResponse): google.cloud.websecurityscanner.v1.ListCrawledUrlsResponse; + + /** + * Encodes the specified ListCrawledUrlsResponse message. Does not implicitly {@link google.cloud.websecurityscanner.v1.ListCrawledUrlsResponse.verify|verify} messages. + * @param message ListCrawledUrlsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.websecurityscanner.v1.IListCrawledUrlsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListCrawledUrlsResponse message, length delimited. Does not implicitly {@link google.cloud.websecurityscanner.v1.ListCrawledUrlsResponse.verify|verify} messages. + * @param message ListCrawledUrlsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.websecurityscanner.v1.IListCrawledUrlsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListCrawledUrlsResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListCrawledUrlsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.websecurityscanner.v1.ListCrawledUrlsResponse; + + /** + * Decodes a ListCrawledUrlsResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListCrawledUrlsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.websecurityscanner.v1.ListCrawledUrlsResponse; + + /** + * Verifies a ListCrawledUrlsResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListCrawledUrlsResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListCrawledUrlsResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.websecurityscanner.v1.ListCrawledUrlsResponse; + + /** + * Creates a plain object from a ListCrawledUrlsResponse message. Also converts values to other types if specified. + * @param message ListCrawledUrlsResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.websecurityscanner.v1.ListCrawledUrlsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListCrawledUrlsResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListCrawledUrlsResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a GetFindingRequest. */ + interface IGetFindingRequest { + + /** GetFindingRequest name */ + name?: (string|null); + } + + /** Represents a GetFindingRequest. */ + class GetFindingRequest implements IGetFindingRequest { + + /** + * Constructs a new GetFindingRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.websecurityscanner.v1.IGetFindingRequest); + + /** GetFindingRequest name. */ + public name: string; + + /** + * Creates a new GetFindingRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns GetFindingRequest instance + */ + public static create(properties?: google.cloud.websecurityscanner.v1.IGetFindingRequest): google.cloud.websecurityscanner.v1.GetFindingRequest; + + /** + * Encodes the specified GetFindingRequest message. Does not implicitly {@link google.cloud.websecurityscanner.v1.GetFindingRequest.verify|verify} messages. + * @param message GetFindingRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.websecurityscanner.v1.IGetFindingRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GetFindingRequest message, length delimited. Does not implicitly {@link google.cloud.websecurityscanner.v1.GetFindingRequest.verify|verify} messages. + * @param message GetFindingRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.websecurityscanner.v1.IGetFindingRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GetFindingRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GetFindingRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.websecurityscanner.v1.GetFindingRequest; + + /** + * Decodes a GetFindingRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GetFindingRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.websecurityscanner.v1.GetFindingRequest; + + /** + * Verifies a GetFindingRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GetFindingRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GetFindingRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.websecurityscanner.v1.GetFindingRequest; + + /** + * Creates a plain object from a GetFindingRequest message. Also converts values to other types if specified. + * @param message GetFindingRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.websecurityscanner.v1.GetFindingRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GetFindingRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GetFindingRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListFindingsRequest. */ + interface IListFindingsRequest { + + /** ListFindingsRequest parent */ + parent?: (string|null); + + /** ListFindingsRequest filter */ + filter?: (string|null); + + /** ListFindingsRequest pageToken */ + pageToken?: (string|null); + + /** ListFindingsRequest pageSize */ + pageSize?: (number|null); + } + + /** Represents a ListFindingsRequest. */ + class ListFindingsRequest implements IListFindingsRequest { + + /** + * Constructs a new ListFindingsRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.websecurityscanner.v1.IListFindingsRequest); + + /** ListFindingsRequest parent. */ + public parent: string; + + /** ListFindingsRequest filter. */ + public filter: string; + + /** ListFindingsRequest pageToken. */ + public pageToken: string; + + /** ListFindingsRequest pageSize. */ + public pageSize: number; + + /** + * Creates a new ListFindingsRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ListFindingsRequest instance + */ + public static create(properties?: google.cloud.websecurityscanner.v1.IListFindingsRequest): google.cloud.websecurityscanner.v1.ListFindingsRequest; + + /** + * Encodes the specified ListFindingsRequest message. Does not implicitly {@link google.cloud.websecurityscanner.v1.ListFindingsRequest.verify|verify} messages. + * @param message ListFindingsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.websecurityscanner.v1.IListFindingsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListFindingsRequest message, length delimited. Does not implicitly {@link google.cloud.websecurityscanner.v1.ListFindingsRequest.verify|verify} messages. + * @param message ListFindingsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.websecurityscanner.v1.IListFindingsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListFindingsRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListFindingsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.websecurityscanner.v1.ListFindingsRequest; + + /** + * Decodes a ListFindingsRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListFindingsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.websecurityscanner.v1.ListFindingsRequest; + + /** + * Verifies a ListFindingsRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListFindingsRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListFindingsRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.websecurityscanner.v1.ListFindingsRequest; + + /** + * Creates a plain object from a ListFindingsRequest message. Also converts values to other types if specified. + * @param message ListFindingsRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.websecurityscanner.v1.ListFindingsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListFindingsRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListFindingsRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListFindingsResponse. */ + interface IListFindingsResponse { + + /** ListFindingsResponse findings */ + findings?: (google.cloud.websecurityscanner.v1.IFinding[]|null); + + /** ListFindingsResponse nextPageToken */ + nextPageToken?: (string|null); + } + + /** Represents a ListFindingsResponse. */ + class ListFindingsResponse implements IListFindingsResponse { + + /** + * Constructs a new ListFindingsResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.websecurityscanner.v1.IListFindingsResponse); + + /** ListFindingsResponse findings. */ + public findings: google.cloud.websecurityscanner.v1.IFinding[]; + + /** ListFindingsResponse nextPageToken. */ + public nextPageToken: string; + + /** + * Creates a new ListFindingsResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns ListFindingsResponse instance + */ + public static create(properties?: google.cloud.websecurityscanner.v1.IListFindingsResponse): google.cloud.websecurityscanner.v1.ListFindingsResponse; + + /** + * Encodes the specified ListFindingsResponse message. Does not implicitly {@link google.cloud.websecurityscanner.v1.ListFindingsResponse.verify|verify} messages. + * @param message ListFindingsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.websecurityscanner.v1.IListFindingsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListFindingsResponse message, length delimited. Does not implicitly {@link google.cloud.websecurityscanner.v1.ListFindingsResponse.verify|verify} messages. + * @param message ListFindingsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.websecurityscanner.v1.IListFindingsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListFindingsResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListFindingsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.websecurityscanner.v1.ListFindingsResponse; + + /** + * Decodes a ListFindingsResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListFindingsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.websecurityscanner.v1.ListFindingsResponse; + + /** + * Verifies a ListFindingsResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListFindingsResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListFindingsResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.websecurityscanner.v1.ListFindingsResponse; + + /** + * Creates a plain object from a ListFindingsResponse message. Also converts values to other types if specified. + * @param message ListFindingsResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.websecurityscanner.v1.ListFindingsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListFindingsResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListFindingsResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListFindingTypeStatsRequest. */ + interface IListFindingTypeStatsRequest { + + /** ListFindingTypeStatsRequest parent */ + parent?: (string|null); + } + + /** Represents a ListFindingTypeStatsRequest. */ + class ListFindingTypeStatsRequest implements IListFindingTypeStatsRequest { + + /** + * Constructs a new ListFindingTypeStatsRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.websecurityscanner.v1.IListFindingTypeStatsRequest); + + /** ListFindingTypeStatsRequest parent. */ + public parent: string; + + /** + * Creates a new ListFindingTypeStatsRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ListFindingTypeStatsRequest instance + */ + public static create(properties?: google.cloud.websecurityscanner.v1.IListFindingTypeStatsRequest): google.cloud.websecurityscanner.v1.ListFindingTypeStatsRequest; + + /** + * Encodes the specified ListFindingTypeStatsRequest message. Does not implicitly {@link google.cloud.websecurityscanner.v1.ListFindingTypeStatsRequest.verify|verify} messages. + * @param message ListFindingTypeStatsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.websecurityscanner.v1.IListFindingTypeStatsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListFindingTypeStatsRequest message, length delimited. Does not implicitly {@link google.cloud.websecurityscanner.v1.ListFindingTypeStatsRequest.verify|verify} messages. + * @param message ListFindingTypeStatsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.websecurityscanner.v1.IListFindingTypeStatsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListFindingTypeStatsRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListFindingTypeStatsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.websecurityscanner.v1.ListFindingTypeStatsRequest; + + /** + * Decodes a ListFindingTypeStatsRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListFindingTypeStatsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.websecurityscanner.v1.ListFindingTypeStatsRequest; + + /** + * Verifies a ListFindingTypeStatsRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListFindingTypeStatsRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListFindingTypeStatsRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.websecurityscanner.v1.ListFindingTypeStatsRequest; + + /** + * Creates a plain object from a ListFindingTypeStatsRequest message. Also converts values to other types if specified. + * @param message ListFindingTypeStatsRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.websecurityscanner.v1.ListFindingTypeStatsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListFindingTypeStatsRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListFindingTypeStatsRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListFindingTypeStatsResponse. */ + interface IListFindingTypeStatsResponse { + + /** ListFindingTypeStatsResponse findingTypeStats */ + findingTypeStats?: (google.cloud.websecurityscanner.v1.IFindingTypeStats[]|null); + } + + /** Represents a ListFindingTypeStatsResponse. */ + class ListFindingTypeStatsResponse implements IListFindingTypeStatsResponse { + + /** + * Constructs a new ListFindingTypeStatsResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.websecurityscanner.v1.IListFindingTypeStatsResponse); + + /** ListFindingTypeStatsResponse findingTypeStats. */ + public findingTypeStats: google.cloud.websecurityscanner.v1.IFindingTypeStats[]; + + /** + * Creates a new ListFindingTypeStatsResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns ListFindingTypeStatsResponse instance + */ + public static create(properties?: google.cloud.websecurityscanner.v1.IListFindingTypeStatsResponse): google.cloud.websecurityscanner.v1.ListFindingTypeStatsResponse; + + /** + * Encodes the specified ListFindingTypeStatsResponse message. Does not implicitly {@link google.cloud.websecurityscanner.v1.ListFindingTypeStatsResponse.verify|verify} messages. + * @param message ListFindingTypeStatsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.websecurityscanner.v1.IListFindingTypeStatsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListFindingTypeStatsResponse message, length delimited. Does not implicitly {@link google.cloud.websecurityscanner.v1.ListFindingTypeStatsResponse.verify|verify} messages. + * @param message ListFindingTypeStatsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.websecurityscanner.v1.IListFindingTypeStatsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListFindingTypeStatsResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListFindingTypeStatsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.websecurityscanner.v1.ListFindingTypeStatsResponse; + + /** + * Decodes a ListFindingTypeStatsResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListFindingTypeStatsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.websecurityscanner.v1.ListFindingTypeStatsResponse; + + /** + * Verifies a ListFindingTypeStatsResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListFindingTypeStatsResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListFindingTypeStatsResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.websecurityscanner.v1.ListFindingTypeStatsResponse; + + /** + * Creates a plain object from a ListFindingTypeStatsResponse message. Also converts values to other types if specified. + * @param message ListFindingTypeStatsResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.websecurityscanner.v1.ListFindingTypeStatsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListFindingTypeStatsResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListFindingTypeStatsResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Namespace v1alpha. */ + namespace v1alpha { + + /** Properties of a CrawledUrl. */ + interface ICrawledUrl { + + /** CrawledUrl httpMethod */ + httpMethod?: (string|null); + + /** CrawledUrl url */ + url?: (string|null); + + /** CrawledUrl body */ + body?: (string|null); + } + + /** Represents a CrawledUrl. */ + class CrawledUrl implements ICrawledUrl { + + /** + * Constructs a new CrawledUrl. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.websecurityscanner.v1alpha.ICrawledUrl); + + /** CrawledUrl httpMethod. */ + public httpMethod: string; + + /** CrawledUrl url. */ + public url: string; + + /** CrawledUrl body. */ + public body: string; + + /** + * Creates a new CrawledUrl instance using the specified properties. + * @param [properties] Properties to set + * @returns CrawledUrl instance + */ + public static create(properties?: google.cloud.websecurityscanner.v1alpha.ICrawledUrl): google.cloud.websecurityscanner.v1alpha.CrawledUrl; + + /** + * Encodes the specified CrawledUrl message. Does not implicitly {@link google.cloud.websecurityscanner.v1alpha.CrawledUrl.verify|verify} messages. + * @param message CrawledUrl message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.websecurityscanner.v1alpha.ICrawledUrl, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CrawledUrl message, length delimited. Does not implicitly {@link google.cloud.websecurityscanner.v1alpha.CrawledUrl.verify|verify} messages. + * @param message CrawledUrl message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.websecurityscanner.v1alpha.ICrawledUrl, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CrawledUrl message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CrawledUrl + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.websecurityscanner.v1alpha.CrawledUrl; + + /** + * Decodes a CrawledUrl message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CrawledUrl + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.websecurityscanner.v1alpha.CrawledUrl; + + /** + * Verifies a CrawledUrl message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a CrawledUrl message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CrawledUrl + */ + public static fromObject(object: { [k: string]: any }): google.cloud.websecurityscanner.v1alpha.CrawledUrl; + + /** + * Creates a plain object from a CrawledUrl message. Also converts values to other types if specified. + * @param message CrawledUrl + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.websecurityscanner.v1alpha.CrawledUrl, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CrawledUrl to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CrawledUrl + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a Finding. */ + interface IFinding { + + /** Finding name */ + name?: (string|null); + + /** Finding findingType */ + findingType?: (google.cloud.websecurityscanner.v1alpha.Finding.FindingType|keyof typeof google.cloud.websecurityscanner.v1alpha.Finding.FindingType|null); + + /** Finding httpMethod */ + httpMethod?: (string|null); + + /** Finding fuzzedUrl */ + fuzzedUrl?: (string|null); + + /** Finding body */ + body?: (string|null); + + /** Finding description */ + description?: (string|null); + + /** Finding reproductionUrl */ + reproductionUrl?: (string|null); + + /** Finding frameUrl */ + frameUrl?: (string|null); + + /** Finding finalUrl */ + finalUrl?: (string|null); + + /** Finding trackingId */ + trackingId?: (string|null); + + /** Finding outdatedLibrary */ + outdatedLibrary?: (google.cloud.websecurityscanner.v1alpha.IOutdatedLibrary|null); + + /** Finding violatingResource */ + violatingResource?: (google.cloud.websecurityscanner.v1alpha.IViolatingResource|null); + + /** Finding vulnerableHeaders */ + vulnerableHeaders?: (google.cloud.websecurityscanner.v1alpha.IVulnerableHeaders|null); + + /** Finding vulnerableParameters */ + vulnerableParameters?: (google.cloud.websecurityscanner.v1alpha.IVulnerableParameters|null); + + /** Finding xss */ + xss?: (google.cloud.websecurityscanner.v1alpha.IXss|null); + } + + /** Represents a Finding. */ + class Finding implements IFinding { + + /** + * Constructs a new Finding. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.websecurityscanner.v1alpha.IFinding); + + /** Finding name. */ + public name: string; + + /** Finding findingType. */ + public findingType: (google.cloud.websecurityscanner.v1alpha.Finding.FindingType|keyof typeof google.cloud.websecurityscanner.v1alpha.Finding.FindingType); + + /** Finding httpMethod. */ + public httpMethod: string; + + /** Finding fuzzedUrl. */ + public fuzzedUrl: string; + + /** Finding body. */ + public body: string; + + /** Finding description. */ + public description: string; + + /** Finding reproductionUrl. */ + public reproductionUrl: string; + + /** Finding frameUrl. */ + public frameUrl: string; + + /** Finding finalUrl. */ + public finalUrl: string; + + /** Finding trackingId. */ + public trackingId: string; + + /** Finding outdatedLibrary. */ + public outdatedLibrary?: (google.cloud.websecurityscanner.v1alpha.IOutdatedLibrary|null); + + /** Finding violatingResource. */ + public violatingResource?: (google.cloud.websecurityscanner.v1alpha.IViolatingResource|null); + + /** Finding vulnerableHeaders. */ + public vulnerableHeaders?: (google.cloud.websecurityscanner.v1alpha.IVulnerableHeaders|null); + + /** Finding vulnerableParameters. */ + public vulnerableParameters?: (google.cloud.websecurityscanner.v1alpha.IVulnerableParameters|null); + + /** Finding xss. */ + public xss?: (google.cloud.websecurityscanner.v1alpha.IXss|null); + + /** + * Creates a new Finding instance using the specified properties. + * @param [properties] Properties to set + * @returns Finding instance + */ + public static create(properties?: google.cloud.websecurityscanner.v1alpha.IFinding): google.cloud.websecurityscanner.v1alpha.Finding; + + /** + * Encodes the specified Finding message. Does not implicitly {@link google.cloud.websecurityscanner.v1alpha.Finding.verify|verify} messages. + * @param message Finding message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.websecurityscanner.v1alpha.IFinding, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Finding message, length delimited. Does not implicitly {@link google.cloud.websecurityscanner.v1alpha.Finding.verify|verify} messages. + * @param message Finding message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.websecurityscanner.v1alpha.IFinding, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Finding message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Finding + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.websecurityscanner.v1alpha.Finding; + + /** + * Decodes a Finding message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Finding + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.websecurityscanner.v1alpha.Finding; + + /** + * Verifies a Finding message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Finding message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Finding + */ + public static fromObject(object: { [k: string]: any }): google.cloud.websecurityscanner.v1alpha.Finding; + + /** + * Creates a plain object from a Finding message. Also converts values to other types if specified. + * @param message Finding + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.websecurityscanner.v1alpha.Finding, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Finding to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Finding + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace Finding { + + /** FindingType enum. */ + enum FindingType { + FINDING_TYPE_UNSPECIFIED = 0, + MIXED_CONTENT = 1, + OUTDATED_LIBRARY = 2, + ROSETTA_FLASH = 5, + XSS_CALLBACK = 3, + XSS_ERROR = 4, + CLEAR_TEXT_PASSWORD = 6, + INVALID_CONTENT_TYPE = 7, + XSS_ANGULAR_CALLBACK = 8, + INVALID_HEADER = 9, + MISSPELLED_SECURITY_HEADER_NAME = 10, + MISMATCHING_SECURITY_HEADER_VALUES = 11 + } + } + + /** Properties of an OutdatedLibrary. */ + interface IOutdatedLibrary { + + /** OutdatedLibrary libraryName */ + libraryName?: (string|null); + + /** OutdatedLibrary version */ + version?: (string|null); + + /** OutdatedLibrary learnMoreUrls */ + learnMoreUrls?: (string[]|null); + } + + /** Represents an OutdatedLibrary. */ + class OutdatedLibrary implements IOutdatedLibrary { + + /** + * Constructs a new OutdatedLibrary. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.websecurityscanner.v1alpha.IOutdatedLibrary); + + /** OutdatedLibrary libraryName. */ + public libraryName: string; + + /** OutdatedLibrary version. */ + public version: string; + + /** OutdatedLibrary learnMoreUrls. */ + public learnMoreUrls: string[]; + + /** + * Creates a new OutdatedLibrary instance using the specified properties. + * @param [properties] Properties to set + * @returns OutdatedLibrary instance + */ + public static create(properties?: google.cloud.websecurityscanner.v1alpha.IOutdatedLibrary): google.cloud.websecurityscanner.v1alpha.OutdatedLibrary; + + /** + * Encodes the specified OutdatedLibrary message. Does not implicitly {@link google.cloud.websecurityscanner.v1alpha.OutdatedLibrary.verify|verify} messages. + * @param message OutdatedLibrary message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.websecurityscanner.v1alpha.IOutdatedLibrary, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified OutdatedLibrary message, length delimited. Does not implicitly {@link google.cloud.websecurityscanner.v1alpha.OutdatedLibrary.verify|verify} messages. + * @param message OutdatedLibrary message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.websecurityscanner.v1alpha.IOutdatedLibrary, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an OutdatedLibrary message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns OutdatedLibrary + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.websecurityscanner.v1alpha.OutdatedLibrary; + + /** + * Decodes an OutdatedLibrary message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns OutdatedLibrary + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.websecurityscanner.v1alpha.OutdatedLibrary; + + /** + * Verifies an OutdatedLibrary message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an OutdatedLibrary message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns OutdatedLibrary + */ + public static fromObject(object: { [k: string]: any }): google.cloud.websecurityscanner.v1alpha.OutdatedLibrary; + + /** + * Creates a plain object from an OutdatedLibrary message. Also converts values to other types if specified. + * @param message OutdatedLibrary + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.websecurityscanner.v1alpha.OutdatedLibrary, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this OutdatedLibrary to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for OutdatedLibrary + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ViolatingResource. */ + interface IViolatingResource { + + /** ViolatingResource contentType */ + contentType?: (string|null); + + /** ViolatingResource resourceUrl */ + resourceUrl?: (string|null); + } + + /** Represents a ViolatingResource. */ + class ViolatingResource implements IViolatingResource { + + /** + * Constructs a new ViolatingResource. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.websecurityscanner.v1alpha.IViolatingResource); + + /** ViolatingResource contentType. */ + public contentType: string; + + /** ViolatingResource resourceUrl. */ + public resourceUrl: string; + + /** + * Creates a new ViolatingResource instance using the specified properties. + * @param [properties] Properties to set + * @returns ViolatingResource instance + */ + public static create(properties?: google.cloud.websecurityscanner.v1alpha.IViolatingResource): google.cloud.websecurityscanner.v1alpha.ViolatingResource; + + /** + * Encodes the specified ViolatingResource message. Does not implicitly {@link google.cloud.websecurityscanner.v1alpha.ViolatingResource.verify|verify} messages. + * @param message ViolatingResource message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.websecurityscanner.v1alpha.IViolatingResource, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ViolatingResource message, length delimited. Does not implicitly {@link google.cloud.websecurityscanner.v1alpha.ViolatingResource.verify|verify} messages. + * @param message ViolatingResource message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.websecurityscanner.v1alpha.IViolatingResource, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ViolatingResource message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ViolatingResource + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.websecurityscanner.v1alpha.ViolatingResource; + + /** + * Decodes a ViolatingResource message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ViolatingResource + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.websecurityscanner.v1alpha.ViolatingResource; + + /** + * Verifies a ViolatingResource message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ViolatingResource message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ViolatingResource + */ + public static fromObject(object: { [k: string]: any }): google.cloud.websecurityscanner.v1alpha.ViolatingResource; + + /** + * Creates a plain object from a ViolatingResource message. Also converts values to other types if specified. + * @param message ViolatingResource + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.websecurityscanner.v1alpha.ViolatingResource, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ViolatingResource to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ViolatingResource + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a VulnerableParameters. */ + interface IVulnerableParameters { + + /** VulnerableParameters parameterNames */ + parameterNames?: (string[]|null); + } + + /** Represents a VulnerableParameters. */ + class VulnerableParameters implements IVulnerableParameters { + + /** + * Constructs a new VulnerableParameters. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.websecurityscanner.v1alpha.IVulnerableParameters); + + /** VulnerableParameters parameterNames. */ + public parameterNames: string[]; + + /** + * Creates a new VulnerableParameters instance using the specified properties. + * @param [properties] Properties to set + * @returns VulnerableParameters instance + */ + public static create(properties?: google.cloud.websecurityscanner.v1alpha.IVulnerableParameters): google.cloud.websecurityscanner.v1alpha.VulnerableParameters; + + /** + * Encodes the specified VulnerableParameters message. Does not implicitly {@link google.cloud.websecurityscanner.v1alpha.VulnerableParameters.verify|verify} messages. + * @param message VulnerableParameters message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.websecurityscanner.v1alpha.IVulnerableParameters, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified VulnerableParameters message, length delimited. Does not implicitly {@link google.cloud.websecurityscanner.v1alpha.VulnerableParameters.verify|verify} messages. + * @param message VulnerableParameters message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.websecurityscanner.v1alpha.IVulnerableParameters, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a VulnerableParameters message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns VulnerableParameters + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.websecurityscanner.v1alpha.VulnerableParameters; + + /** + * Decodes a VulnerableParameters message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns VulnerableParameters + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.websecurityscanner.v1alpha.VulnerableParameters; + + /** + * Verifies a VulnerableParameters message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a VulnerableParameters message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns VulnerableParameters + */ + public static fromObject(object: { [k: string]: any }): google.cloud.websecurityscanner.v1alpha.VulnerableParameters; + + /** + * Creates a plain object from a VulnerableParameters message. Also converts values to other types if specified. + * @param message VulnerableParameters + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.websecurityscanner.v1alpha.VulnerableParameters, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this VulnerableParameters to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for VulnerableParameters + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a VulnerableHeaders. */ + interface IVulnerableHeaders { + + /** VulnerableHeaders headers */ + headers?: (google.cloud.websecurityscanner.v1alpha.VulnerableHeaders.IHeader[]|null); + + /** VulnerableHeaders missingHeaders */ + missingHeaders?: (google.cloud.websecurityscanner.v1alpha.VulnerableHeaders.IHeader[]|null); + } + + /** Represents a VulnerableHeaders. */ + class VulnerableHeaders implements IVulnerableHeaders { + + /** + * Constructs a new VulnerableHeaders. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.websecurityscanner.v1alpha.IVulnerableHeaders); + + /** VulnerableHeaders headers. */ + public headers: google.cloud.websecurityscanner.v1alpha.VulnerableHeaders.IHeader[]; + + /** VulnerableHeaders missingHeaders. */ + public missingHeaders: google.cloud.websecurityscanner.v1alpha.VulnerableHeaders.IHeader[]; + + /** + * Creates a new VulnerableHeaders instance using the specified properties. + * @param [properties] Properties to set + * @returns VulnerableHeaders instance + */ + public static create(properties?: google.cloud.websecurityscanner.v1alpha.IVulnerableHeaders): google.cloud.websecurityscanner.v1alpha.VulnerableHeaders; + + /** + * Encodes the specified VulnerableHeaders message. Does not implicitly {@link google.cloud.websecurityscanner.v1alpha.VulnerableHeaders.verify|verify} messages. + * @param message VulnerableHeaders message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.websecurityscanner.v1alpha.IVulnerableHeaders, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified VulnerableHeaders message, length delimited. Does not implicitly {@link google.cloud.websecurityscanner.v1alpha.VulnerableHeaders.verify|verify} messages. + * @param message VulnerableHeaders message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.websecurityscanner.v1alpha.IVulnerableHeaders, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a VulnerableHeaders message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns VulnerableHeaders + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.websecurityscanner.v1alpha.VulnerableHeaders; + + /** + * Decodes a VulnerableHeaders message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns VulnerableHeaders + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.websecurityscanner.v1alpha.VulnerableHeaders; + + /** + * Verifies a VulnerableHeaders message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a VulnerableHeaders message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns VulnerableHeaders + */ + public static fromObject(object: { [k: string]: any }): google.cloud.websecurityscanner.v1alpha.VulnerableHeaders; + + /** + * Creates a plain object from a VulnerableHeaders message. Also converts values to other types if specified. + * @param message VulnerableHeaders + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.websecurityscanner.v1alpha.VulnerableHeaders, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this VulnerableHeaders to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for VulnerableHeaders + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace VulnerableHeaders { + + /** Properties of a Header. */ + interface IHeader { + + /** Header name */ + name?: (string|null); + + /** Header value */ + value?: (string|null); + } + + /** Represents a Header. */ + class Header implements IHeader { + + /** + * Constructs a new Header. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.websecurityscanner.v1alpha.VulnerableHeaders.IHeader); + + /** Header name. */ + public name: string; + + /** Header value. */ + public value: string; + + /** + * Creates a new Header instance using the specified properties. + * @param [properties] Properties to set + * @returns Header instance + */ + public static create(properties?: google.cloud.websecurityscanner.v1alpha.VulnerableHeaders.IHeader): google.cloud.websecurityscanner.v1alpha.VulnerableHeaders.Header; + + /** + * Encodes the specified Header message. Does not implicitly {@link google.cloud.websecurityscanner.v1alpha.VulnerableHeaders.Header.verify|verify} messages. + * @param message Header message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.websecurityscanner.v1alpha.VulnerableHeaders.IHeader, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Header message, length delimited. Does not implicitly {@link google.cloud.websecurityscanner.v1alpha.VulnerableHeaders.Header.verify|verify} messages. + * @param message Header message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.websecurityscanner.v1alpha.VulnerableHeaders.IHeader, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Header message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Header + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.websecurityscanner.v1alpha.VulnerableHeaders.Header; + + /** + * Decodes a Header message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Header + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.websecurityscanner.v1alpha.VulnerableHeaders.Header; + + /** + * Verifies a Header message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Header message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Header + */ + public static fromObject(object: { [k: string]: any }): google.cloud.websecurityscanner.v1alpha.VulnerableHeaders.Header; + + /** + * Creates a plain object from a Header message. Also converts values to other types if specified. + * @param message Header + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.websecurityscanner.v1alpha.VulnerableHeaders.Header, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Header to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Header + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Properties of a Xss. */ + interface IXss { + + /** Xss stackTraces */ + stackTraces?: (string[]|null); + + /** Xss errorMessage */ + errorMessage?: (string|null); + } + + /** Represents a Xss. */ + class Xss implements IXss { + + /** + * Constructs a new Xss. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.websecurityscanner.v1alpha.IXss); + + /** Xss stackTraces. */ + public stackTraces: string[]; + + /** Xss errorMessage. */ + public errorMessage: string; + + /** + * Creates a new Xss instance using the specified properties. + * @param [properties] Properties to set + * @returns Xss instance + */ + public static create(properties?: google.cloud.websecurityscanner.v1alpha.IXss): google.cloud.websecurityscanner.v1alpha.Xss; + + /** + * Encodes the specified Xss message. Does not implicitly {@link google.cloud.websecurityscanner.v1alpha.Xss.verify|verify} messages. + * @param message Xss message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.websecurityscanner.v1alpha.IXss, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Xss message, length delimited. Does not implicitly {@link google.cloud.websecurityscanner.v1alpha.Xss.verify|verify} messages. + * @param message Xss message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.websecurityscanner.v1alpha.IXss, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Xss message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Xss + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.websecurityscanner.v1alpha.Xss; + + /** + * Decodes a Xss message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Xss + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.websecurityscanner.v1alpha.Xss; + + /** + * Verifies a Xss message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Xss message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Xss + */ + public static fromObject(object: { [k: string]: any }): google.cloud.websecurityscanner.v1alpha.Xss; + + /** + * Creates a plain object from a Xss message. Also converts values to other types if specified. + * @param message Xss + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.websecurityscanner.v1alpha.Xss, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Xss to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Xss + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a FindingTypeStats. */ + interface IFindingTypeStats { + + /** FindingTypeStats findingType */ + findingType?: (google.cloud.websecurityscanner.v1alpha.Finding.FindingType|keyof typeof google.cloud.websecurityscanner.v1alpha.Finding.FindingType|null); + + /** FindingTypeStats findingCount */ + findingCount?: (number|null); + } + + /** Represents a FindingTypeStats. */ + class FindingTypeStats implements IFindingTypeStats { + + /** + * Constructs a new FindingTypeStats. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.websecurityscanner.v1alpha.IFindingTypeStats); + + /** FindingTypeStats findingType. */ + public findingType: (google.cloud.websecurityscanner.v1alpha.Finding.FindingType|keyof typeof google.cloud.websecurityscanner.v1alpha.Finding.FindingType); + + /** FindingTypeStats findingCount. */ + public findingCount: number; + + /** + * Creates a new FindingTypeStats instance using the specified properties. + * @param [properties] Properties to set + * @returns FindingTypeStats instance + */ + public static create(properties?: google.cloud.websecurityscanner.v1alpha.IFindingTypeStats): google.cloud.websecurityscanner.v1alpha.FindingTypeStats; + + /** + * Encodes the specified FindingTypeStats message. Does not implicitly {@link google.cloud.websecurityscanner.v1alpha.FindingTypeStats.verify|verify} messages. + * @param message FindingTypeStats message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.websecurityscanner.v1alpha.IFindingTypeStats, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified FindingTypeStats message, length delimited. Does not implicitly {@link google.cloud.websecurityscanner.v1alpha.FindingTypeStats.verify|verify} messages. + * @param message FindingTypeStats message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.websecurityscanner.v1alpha.IFindingTypeStats, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FindingTypeStats message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns FindingTypeStats + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.websecurityscanner.v1alpha.FindingTypeStats; + + /** + * Decodes a FindingTypeStats message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns FindingTypeStats + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.websecurityscanner.v1alpha.FindingTypeStats; + + /** + * Verifies a FindingTypeStats message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a FindingTypeStats message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns FindingTypeStats + */ + public static fromObject(object: { [k: string]: any }): google.cloud.websecurityscanner.v1alpha.FindingTypeStats; + + /** + * Creates a plain object from a FindingTypeStats message. Also converts values to other types if specified. + * @param message FindingTypeStats + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.websecurityscanner.v1alpha.FindingTypeStats, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this FindingTypeStats to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for FindingTypeStats + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ScanConfig. */ + interface IScanConfig { + + /** ScanConfig name */ + name?: (string|null); + + /** ScanConfig displayName */ + displayName?: (string|null); + + /** ScanConfig maxQps */ + maxQps?: (number|null); + + /** ScanConfig startingUrls */ + startingUrls?: (string[]|null); + + /** ScanConfig authentication */ + authentication?: (google.cloud.websecurityscanner.v1alpha.ScanConfig.IAuthentication|null); + + /** ScanConfig userAgent */ + userAgent?: (google.cloud.websecurityscanner.v1alpha.ScanConfig.UserAgent|keyof typeof google.cloud.websecurityscanner.v1alpha.ScanConfig.UserAgent|null); + + /** ScanConfig blacklistPatterns */ + blacklistPatterns?: (string[]|null); + + /** ScanConfig schedule */ + schedule?: (google.cloud.websecurityscanner.v1alpha.ScanConfig.ISchedule|null); + + /** ScanConfig targetPlatforms */ + targetPlatforms?: (google.cloud.websecurityscanner.v1alpha.ScanConfig.TargetPlatform[]|null); + + /** ScanConfig latestRun */ + latestRun?: (google.cloud.websecurityscanner.v1alpha.IScanRun|null); + } + + /** Represents a ScanConfig. */ + class ScanConfig implements IScanConfig { + + /** + * Constructs a new ScanConfig. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.websecurityscanner.v1alpha.IScanConfig); + + /** ScanConfig name. */ + public name: string; + + /** ScanConfig displayName. */ + public displayName: string; + + /** ScanConfig maxQps. */ + public maxQps: number; + + /** ScanConfig startingUrls. */ + public startingUrls: string[]; + + /** ScanConfig authentication. */ + public authentication?: (google.cloud.websecurityscanner.v1alpha.ScanConfig.IAuthentication|null); + + /** ScanConfig userAgent. */ + public userAgent: (google.cloud.websecurityscanner.v1alpha.ScanConfig.UserAgent|keyof typeof google.cloud.websecurityscanner.v1alpha.ScanConfig.UserAgent); + + /** ScanConfig blacklistPatterns. */ + public blacklistPatterns: string[]; + + /** ScanConfig schedule. */ + public schedule?: (google.cloud.websecurityscanner.v1alpha.ScanConfig.ISchedule|null); + + /** ScanConfig targetPlatforms. */ + public targetPlatforms: google.cloud.websecurityscanner.v1alpha.ScanConfig.TargetPlatform[]; + + /** ScanConfig latestRun. */ + public latestRun?: (google.cloud.websecurityscanner.v1alpha.IScanRun|null); + + /** + * Creates a new ScanConfig instance using the specified properties. + * @param [properties] Properties to set + * @returns ScanConfig instance + */ + public static create(properties?: google.cloud.websecurityscanner.v1alpha.IScanConfig): google.cloud.websecurityscanner.v1alpha.ScanConfig; + + /** + * Encodes the specified ScanConfig message. Does not implicitly {@link google.cloud.websecurityscanner.v1alpha.ScanConfig.verify|verify} messages. + * @param message ScanConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.websecurityscanner.v1alpha.IScanConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ScanConfig message, length delimited. Does not implicitly {@link google.cloud.websecurityscanner.v1alpha.ScanConfig.verify|verify} messages. + * @param message ScanConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.websecurityscanner.v1alpha.IScanConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ScanConfig message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ScanConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.websecurityscanner.v1alpha.ScanConfig; + + /** + * Decodes a ScanConfig message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ScanConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.websecurityscanner.v1alpha.ScanConfig; + + /** + * Verifies a ScanConfig message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ScanConfig message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ScanConfig + */ + public static fromObject(object: { [k: string]: any }): google.cloud.websecurityscanner.v1alpha.ScanConfig; + + /** + * Creates a plain object from a ScanConfig message. Also converts values to other types if specified. + * @param message ScanConfig + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.websecurityscanner.v1alpha.ScanConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ScanConfig to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ScanConfig + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace ScanConfig { + + /** Properties of an Authentication. */ + interface IAuthentication { + + /** Authentication googleAccount */ + googleAccount?: (google.cloud.websecurityscanner.v1alpha.ScanConfig.Authentication.IGoogleAccount|null); + + /** Authentication customAccount */ + customAccount?: (google.cloud.websecurityscanner.v1alpha.ScanConfig.Authentication.ICustomAccount|null); + } + + /** Represents an Authentication. */ + class Authentication implements IAuthentication { + + /** + * Constructs a new Authentication. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.websecurityscanner.v1alpha.ScanConfig.IAuthentication); + + /** Authentication googleAccount. */ + public googleAccount?: (google.cloud.websecurityscanner.v1alpha.ScanConfig.Authentication.IGoogleAccount|null); + + /** Authentication customAccount. */ + public customAccount?: (google.cloud.websecurityscanner.v1alpha.ScanConfig.Authentication.ICustomAccount|null); + + /** Authentication authentication. */ + public authentication?: ("googleAccount"|"customAccount"); + + /** + * Creates a new Authentication instance using the specified properties. + * @param [properties] Properties to set + * @returns Authentication instance + */ + public static create(properties?: google.cloud.websecurityscanner.v1alpha.ScanConfig.IAuthentication): google.cloud.websecurityscanner.v1alpha.ScanConfig.Authentication; + + /** + * Encodes the specified Authentication message. Does not implicitly {@link google.cloud.websecurityscanner.v1alpha.ScanConfig.Authentication.verify|verify} messages. + * @param message Authentication message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.websecurityscanner.v1alpha.ScanConfig.IAuthentication, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Authentication message, length delimited. Does not implicitly {@link google.cloud.websecurityscanner.v1alpha.ScanConfig.Authentication.verify|verify} messages. + * @param message Authentication message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.websecurityscanner.v1alpha.ScanConfig.IAuthentication, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an Authentication message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Authentication + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.websecurityscanner.v1alpha.ScanConfig.Authentication; + + /** + * Decodes an Authentication message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Authentication + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.websecurityscanner.v1alpha.ScanConfig.Authentication; + + /** + * Verifies an Authentication message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an Authentication message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Authentication + */ + public static fromObject(object: { [k: string]: any }): google.cloud.websecurityscanner.v1alpha.ScanConfig.Authentication; + + /** + * Creates a plain object from an Authentication message. Also converts values to other types if specified. + * @param message Authentication + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.websecurityscanner.v1alpha.ScanConfig.Authentication, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Authentication to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Authentication + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace Authentication { + + /** Properties of a GoogleAccount. */ + interface IGoogleAccount { + + /** GoogleAccount username */ + username?: (string|null); + + /** GoogleAccount password */ + password?: (string|null); + } + + /** Represents a GoogleAccount. */ + class GoogleAccount implements IGoogleAccount { + + /** + * Constructs a new GoogleAccount. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.websecurityscanner.v1alpha.ScanConfig.Authentication.IGoogleAccount); + + /** GoogleAccount username. */ + public username: string; + + /** GoogleAccount password. */ + public password: string; + + /** + * Creates a new GoogleAccount instance using the specified properties. + * @param [properties] Properties to set + * @returns GoogleAccount instance + */ + public static create(properties?: google.cloud.websecurityscanner.v1alpha.ScanConfig.Authentication.IGoogleAccount): google.cloud.websecurityscanner.v1alpha.ScanConfig.Authentication.GoogleAccount; + + /** + * Encodes the specified GoogleAccount message. Does not implicitly {@link google.cloud.websecurityscanner.v1alpha.ScanConfig.Authentication.GoogleAccount.verify|verify} messages. + * @param message GoogleAccount message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.websecurityscanner.v1alpha.ScanConfig.Authentication.IGoogleAccount, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GoogleAccount message, length delimited. Does not implicitly {@link google.cloud.websecurityscanner.v1alpha.ScanConfig.Authentication.GoogleAccount.verify|verify} messages. + * @param message GoogleAccount message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.websecurityscanner.v1alpha.ScanConfig.Authentication.IGoogleAccount, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GoogleAccount message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GoogleAccount + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.websecurityscanner.v1alpha.ScanConfig.Authentication.GoogleAccount; + + /** + * Decodes a GoogleAccount message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GoogleAccount + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.websecurityscanner.v1alpha.ScanConfig.Authentication.GoogleAccount; + + /** + * Verifies a GoogleAccount message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GoogleAccount message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GoogleAccount + */ + public static fromObject(object: { [k: string]: any }): google.cloud.websecurityscanner.v1alpha.ScanConfig.Authentication.GoogleAccount; + + /** + * Creates a plain object from a GoogleAccount message. Also converts values to other types if specified. + * @param message GoogleAccount + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.websecurityscanner.v1alpha.ScanConfig.Authentication.GoogleAccount, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GoogleAccount to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GoogleAccount + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a CustomAccount. */ + interface ICustomAccount { + + /** CustomAccount username */ + username?: (string|null); + + /** CustomAccount password */ + password?: (string|null); + + /** CustomAccount loginUrl */ + loginUrl?: (string|null); + } + + /** Represents a CustomAccount. */ + class CustomAccount implements ICustomAccount { + + /** + * Constructs a new CustomAccount. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.websecurityscanner.v1alpha.ScanConfig.Authentication.ICustomAccount); + + /** CustomAccount username. */ + public username: string; + + /** CustomAccount password. */ + public password: string; + + /** CustomAccount loginUrl. */ + public loginUrl: string; + + /** + * Creates a new CustomAccount instance using the specified properties. + * @param [properties] Properties to set + * @returns CustomAccount instance + */ + public static create(properties?: google.cloud.websecurityscanner.v1alpha.ScanConfig.Authentication.ICustomAccount): google.cloud.websecurityscanner.v1alpha.ScanConfig.Authentication.CustomAccount; + + /** + * Encodes the specified CustomAccount message. Does not implicitly {@link google.cloud.websecurityscanner.v1alpha.ScanConfig.Authentication.CustomAccount.verify|verify} messages. + * @param message CustomAccount message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.websecurityscanner.v1alpha.ScanConfig.Authentication.ICustomAccount, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CustomAccount message, length delimited. Does not implicitly {@link google.cloud.websecurityscanner.v1alpha.ScanConfig.Authentication.CustomAccount.verify|verify} messages. + * @param message CustomAccount message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.websecurityscanner.v1alpha.ScanConfig.Authentication.ICustomAccount, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CustomAccount message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CustomAccount + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.websecurityscanner.v1alpha.ScanConfig.Authentication.CustomAccount; + + /** + * Decodes a CustomAccount message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CustomAccount + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.websecurityscanner.v1alpha.ScanConfig.Authentication.CustomAccount; + + /** + * Verifies a CustomAccount message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a CustomAccount message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CustomAccount + */ + public static fromObject(object: { [k: string]: any }): google.cloud.websecurityscanner.v1alpha.ScanConfig.Authentication.CustomAccount; + + /** + * Creates a plain object from a CustomAccount message. Also converts values to other types if specified. + * @param message CustomAccount + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.websecurityscanner.v1alpha.ScanConfig.Authentication.CustomAccount, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CustomAccount to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CustomAccount + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Properties of a Schedule. */ + interface ISchedule { + + /** Schedule scheduleTime */ + scheduleTime?: (google.protobuf.ITimestamp|null); + + /** Schedule intervalDurationDays */ + intervalDurationDays?: (number|null); + } + + /** Represents a Schedule. */ + class Schedule implements ISchedule { + + /** + * Constructs a new Schedule. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.websecurityscanner.v1alpha.ScanConfig.ISchedule); + + /** Schedule scheduleTime. */ + public scheduleTime?: (google.protobuf.ITimestamp|null); + + /** Schedule intervalDurationDays. */ + public intervalDurationDays: number; + + /** + * Creates a new Schedule instance using the specified properties. + * @param [properties] Properties to set + * @returns Schedule instance + */ + public static create(properties?: google.cloud.websecurityscanner.v1alpha.ScanConfig.ISchedule): google.cloud.websecurityscanner.v1alpha.ScanConfig.Schedule; + + /** + * Encodes the specified Schedule message. Does not implicitly {@link google.cloud.websecurityscanner.v1alpha.ScanConfig.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.websecurityscanner.v1alpha.ScanConfig.ISchedule, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Schedule message, length delimited. Does not implicitly {@link google.cloud.websecurityscanner.v1alpha.ScanConfig.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.websecurityscanner.v1alpha.ScanConfig.ISchedule, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * 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.websecurityscanner.v1alpha.ScanConfig.Schedule; + + /** + * 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.websecurityscanner.v1alpha.ScanConfig.Schedule; + + /** + * 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 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.websecurityscanner.v1alpha.ScanConfig.Schedule; + + /** + * 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.websecurityscanner.v1alpha.ScanConfig.Schedule, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Schedule to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * 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; + } + + /** UserAgent enum. */ + enum UserAgent { + USER_AGENT_UNSPECIFIED = 0, + CHROME_LINUX = 1, + CHROME_ANDROID = 2, + SAFARI_IPHONE = 3 + } + + /** TargetPlatform enum. */ + enum TargetPlatform { + TARGET_PLATFORM_UNSPECIFIED = 0, + APP_ENGINE = 1, + COMPUTE = 2 + } + } + + /** Properties of a ScanRun. */ + interface IScanRun { + + /** ScanRun name */ + name?: (string|null); + + /** ScanRun executionState */ + executionState?: (google.cloud.websecurityscanner.v1alpha.ScanRun.ExecutionState|keyof typeof google.cloud.websecurityscanner.v1alpha.ScanRun.ExecutionState|null); + + /** ScanRun resultState */ + resultState?: (google.cloud.websecurityscanner.v1alpha.ScanRun.ResultState|keyof typeof google.cloud.websecurityscanner.v1alpha.ScanRun.ResultState|null); + + /** ScanRun startTime */ + startTime?: (google.protobuf.ITimestamp|null); + + /** ScanRun endTime */ + endTime?: (google.protobuf.ITimestamp|null); + + /** ScanRun urlsCrawledCount */ + urlsCrawledCount?: (number|Long|string|null); + + /** ScanRun urlsTestedCount */ + urlsTestedCount?: (number|Long|string|null); + + /** ScanRun hasVulnerabilities */ + hasVulnerabilities?: (boolean|null); + + /** ScanRun progressPercent */ + progressPercent?: (number|null); + } + + /** Represents a ScanRun. */ + class ScanRun implements IScanRun { + + /** + * Constructs a new ScanRun. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.websecurityscanner.v1alpha.IScanRun); + + /** ScanRun name. */ + public name: string; + + /** ScanRun executionState. */ + public executionState: (google.cloud.websecurityscanner.v1alpha.ScanRun.ExecutionState|keyof typeof google.cloud.websecurityscanner.v1alpha.ScanRun.ExecutionState); + + /** ScanRun resultState. */ + public resultState: (google.cloud.websecurityscanner.v1alpha.ScanRun.ResultState|keyof typeof google.cloud.websecurityscanner.v1alpha.ScanRun.ResultState); + + /** ScanRun startTime. */ + public startTime?: (google.protobuf.ITimestamp|null); + + /** ScanRun endTime. */ + public endTime?: (google.protobuf.ITimestamp|null); + + /** ScanRun urlsCrawledCount. */ + public urlsCrawledCount: (number|Long|string); + + /** ScanRun urlsTestedCount. */ + public urlsTestedCount: (number|Long|string); + + /** ScanRun hasVulnerabilities. */ + public hasVulnerabilities: boolean; + + /** ScanRun progressPercent. */ + public progressPercent: number; + + /** + * Creates a new ScanRun instance using the specified properties. + * @param [properties] Properties to set + * @returns ScanRun instance + */ + public static create(properties?: google.cloud.websecurityscanner.v1alpha.IScanRun): google.cloud.websecurityscanner.v1alpha.ScanRun; + + /** + * Encodes the specified ScanRun message. Does not implicitly {@link google.cloud.websecurityscanner.v1alpha.ScanRun.verify|verify} messages. + * @param message ScanRun message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.websecurityscanner.v1alpha.IScanRun, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ScanRun message, length delimited. Does not implicitly {@link google.cloud.websecurityscanner.v1alpha.ScanRun.verify|verify} messages. + * @param message ScanRun message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.websecurityscanner.v1alpha.IScanRun, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ScanRun message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ScanRun + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.websecurityscanner.v1alpha.ScanRun; + + /** + * Decodes a ScanRun message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ScanRun + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.websecurityscanner.v1alpha.ScanRun; + + /** + * Verifies a ScanRun message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ScanRun message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ScanRun + */ + public static fromObject(object: { [k: string]: any }): google.cloud.websecurityscanner.v1alpha.ScanRun; + + /** + * Creates a plain object from a ScanRun message. Also converts values to other types if specified. + * @param message ScanRun + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.websecurityscanner.v1alpha.ScanRun, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ScanRun to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ScanRun + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace ScanRun { + + /** ExecutionState enum. */ + enum ExecutionState { + EXECUTION_STATE_UNSPECIFIED = 0, + QUEUED = 1, + SCANNING = 2, + FINISHED = 3 + } + + /** ResultState enum. */ + enum ResultState { + RESULT_STATE_UNSPECIFIED = 0, + SUCCESS = 1, + ERROR = 2, + KILLED = 3 + } + } + + /** Represents a WebSecurityScanner */ + class WebSecurityScanner extends $protobuf.rpc.Service { + + /** + * Constructs a new WebSecurityScanner 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 WebSecurityScanner 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): WebSecurityScanner; + + /** + * Calls CreateScanConfig. + * @param request CreateScanConfigRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ScanConfig + */ + public createScanConfig(request: google.cloud.websecurityscanner.v1alpha.ICreateScanConfigRequest, callback: google.cloud.websecurityscanner.v1alpha.WebSecurityScanner.CreateScanConfigCallback): void; + + /** + * Calls CreateScanConfig. + * @param request CreateScanConfigRequest message or plain object + * @returns Promise + */ + public createScanConfig(request: google.cloud.websecurityscanner.v1alpha.ICreateScanConfigRequest): Promise; + + /** + * Calls DeleteScanConfig. + * @param request DeleteScanConfigRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Empty + */ + public deleteScanConfig(request: google.cloud.websecurityscanner.v1alpha.IDeleteScanConfigRequest, callback: google.cloud.websecurityscanner.v1alpha.WebSecurityScanner.DeleteScanConfigCallback): void; + + /** + * Calls DeleteScanConfig. + * @param request DeleteScanConfigRequest message or plain object + * @returns Promise + */ + public deleteScanConfig(request: google.cloud.websecurityscanner.v1alpha.IDeleteScanConfigRequest): Promise; + + /** + * Calls GetScanConfig. + * @param request GetScanConfigRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ScanConfig + */ + public getScanConfig(request: google.cloud.websecurityscanner.v1alpha.IGetScanConfigRequest, callback: google.cloud.websecurityscanner.v1alpha.WebSecurityScanner.GetScanConfigCallback): void; + + /** + * Calls GetScanConfig. + * @param request GetScanConfigRequest message or plain object + * @returns Promise + */ + public getScanConfig(request: google.cloud.websecurityscanner.v1alpha.IGetScanConfigRequest): Promise; + + /** + * Calls ListScanConfigs. + * @param request ListScanConfigsRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ListScanConfigsResponse + */ + public listScanConfigs(request: google.cloud.websecurityscanner.v1alpha.IListScanConfigsRequest, callback: google.cloud.websecurityscanner.v1alpha.WebSecurityScanner.ListScanConfigsCallback): void; + + /** + * Calls ListScanConfigs. + * @param request ListScanConfigsRequest message or plain object + * @returns Promise + */ + public listScanConfigs(request: google.cloud.websecurityscanner.v1alpha.IListScanConfigsRequest): Promise; + + /** + * Calls UpdateScanConfig. + * @param request UpdateScanConfigRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ScanConfig + */ + public updateScanConfig(request: google.cloud.websecurityscanner.v1alpha.IUpdateScanConfigRequest, callback: google.cloud.websecurityscanner.v1alpha.WebSecurityScanner.UpdateScanConfigCallback): void; + + /** + * Calls UpdateScanConfig. + * @param request UpdateScanConfigRequest message or plain object + * @returns Promise + */ + public updateScanConfig(request: google.cloud.websecurityscanner.v1alpha.IUpdateScanConfigRequest): Promise; + + /** + * Calls StartScanRun. + * @param request StartScanRunRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ScanRun + */ + public startScanRun(request: google.cloud.websecurityscanner.v1alpha.IStartScanRunRequest, callback: google.cloud.websecurityscanner.v1alpha.WebSecurityScanner.StartScanRunCallback): void; + + /** + * Calls StartScanRun. + * @param request StartScanRunRequest message or plain object + * @returns Promise + */ + public startScanRun(request: google.cloud.websecurityscanner.v1alpha.IStartScanRunRequest): Promise; + + /** + * Calls GetScanRun. + * @param request GetScanRunRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ScanRun + */ + public getScanRun(request: google.cloud.websecurityscanner.v1alpha.IGetScanRunRequest, callback: google.cloud.websecurityscanner.v1alpha.WebSecurityScanner.GetScanRunCallback): void; + + /** + * Calls GetScanRun. + * @param request GetScanRunRequest message or plain object + * @returns Promise + */ + public getScanRun(request: google.cloud.websecurityscanner.v1alpha.IGetScanRunRequest): Promise; + + /** + * Calls ListScanRuns. + * @param request ListScanRunsRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ListScanRunsResponse + */ + public listScanRuns(request: google.cloud.websecurityscanner.v1alpha.IListScanRunsRequest, callback: google.cloud.websecurityscanner.v1alpha.WebSecurityScanner.ListScanRunsCallback): void; + + /** + * Calls ListScanRuns. + * @param request ListScanRunsRequest message or plain object + * @returns Promise + */ + public listScanRuns(request: google.cloud.websecurityscanner.v1alpha.IListScanRunsRequest): Promise; + + /** + * Calls StopScanRun. + * @param request StopScanRunRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ScanRun + */ + public stopScanRun(request: google.cloud.websecurityscanner.v1alpha.IStopScanRunRequest, callback: google.cloud.websecurityscanner.v1alpha.WebSecurityScanner.StopScanRunCallback): void; + + /** + * Calls StopScanRun. + * @param request StopScanRunRequest message or plain object + * @returns Promise + */ + public stopScanRun(request: google.cloud.websecurityscanner.v1alpha.IStopScanRunRequest): Promise; + + /** + * Calls ListCrawledUrls. + * @param request ListCrawledUrlsRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ListCrawledUrlsResponse + */ + public listCrawledUrls(request: google.cloud.websecurityscanner.v1alpha.IListCrawledUrlsRequest, callback: google.cloud.websecurityscanner.v1alpha.WebSecurityScanner.ListCrawledUrlsCallback): void; + + /** + * Calls ListCrawledUrls. + * @param request ListCrawledUrlsRequest message or plain object + * @returns Promise + */ + public listCrawledUrls(request: google.cloud.websecurityscanner.v1alpha.IListCrawledUrlsRequest): Promise; + + /** + * Calls GetFinding. + * @param request GetFindingRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Finding + */ + public getFinding(request: google.cloud.websecurityscanner.v1alpha.IGetFindingRequest, callback: google.cloud.websecurityscanner.v1alpha.WebSecurityScanner.GetFindingCallback): void; + + /** + * Calls GetFinding. + * @param request GetFindingRequest message or plain object + * @returns Promise + */ + public getFinding(request: google.cloud.websecurityscanner.v1alpha.IGetFindingRequest): Promise; + + /** + * Calls ListFindings. + * @param request ListFindingsRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ListFindingsResponse + */ + public listFindings(request: google.cloud.websecurityscanner.v1alpha.IListFindingsRequest, callback: google.cloud.websecurityscanner.v1alpha.WebSecurityScanner.ListFindingsCallback): void; + + /** + * Calls ListFindings. + * @param request ListFindingsRequest message or plain object + * @returns Promise + */ + public listFindings(request: google.cloud.websecurityscanner.v1alpha.IListFindingsRequest): Promise; + + /** + * Calls ListFindingTypeStats. + * @param request ListFindingTypeStatsRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ListFindingTypeStatsResponse + */ + public listFindingTypeStats(request: google.cloud.websecurityscanner.v1alpha.IListFindingTypeStatsRequest, callback: google.cloud.websecurityscanner.v1alpha.WebSecurityScanner.ListFindingTypeStatsCallback): void; + + /** + * Calls ListFindingTypeStats. + * @param request ListFindingTypeStatsRequest message or plain object + * @returns Promise + */ + public listFindingTypeStats(request: google.cloud.websecurityscanner.v1alpha.IListFindingTypeStatsRequest): Promise; + } + + namespace WebSecurityScanner { + + /** + * Callback as used by {@link google.cloud.websecurityscanner.v1alpha.WebSecurityScanner|createScanConfig}. + * @param error Error, if any + * @param [response] ScanConfig + */ + type CreateScanConfigCallback = (error: (Error|null), response?: google.cloud.websecurityscanner.v1alpha.ScanConfig) => void; + + /** + * Callback as used by {@link google.cloud.websecurityscanner.v1alpha.WebSecurityScanner|deleteScanConfig}. + * @param error Error, if any + * @param [response] Empty + */ + type DeleteScanConfigCallback = (error: (Error|null), response?: google.protobuf.Empty) => void; + + /** + * Callback as used by {@link google.cloud.websecurityscanner.v1alpha.WebSecurityScanner|getScanConfig}. + * @param error Error, if any + * @param [response] ScanConfig + */ + type GetScanConfigCallback = (error: (Error|null), response?: google.cloud.websecurityscanner.v1alpha.ScanConfig) => void; + + /** + * Callback as used by {@link google.cloud.websecurityscanner.v1alpha.WebSecurityScanner|listScanConfigs}. + * @param error Error, if any + * @param [response] ListScanConfigsResponse + */ + type ListScanConfigsCallback = (error: (Error|null), response?: google.cloud.websecurityscanner.v1alpha.ListScanConfigsResponse) => void; + + /** + * Callback as used by {@link google.cloud.websecurityscanner.v1alpha.WebSecurityScanner|updateScanConfig}. + * @param error Error, if any + * @param [response] ScanConfig + */ + type UpdateScanConfigCallback = (error: (Error|null), response?: google.cloud.websecurityscanner.v1alpha.ScanConfig) => void; + + /** + * Callback as used by {@link google.cloud.websecurityscanner.v1alpha.WebSecurityScanner|startScanRun}. + * @param error Error, if any + * @param [response] ScanRun + */ + type StartScanRunCallback = (error: (Error|null), response?: google.cloud.websecurityscanner.v1alpha.ScanRun) => void; + + /** + * Callback as used by {@link google.cloud.websecurityscanner.v1alpha.WebSecurityScanner|getScanRun}. + * @param error Error, if any + * @param [response] ScanRun + */ + type GetScanRunCallback = (error: (Error|null), response?: google.cloud.websecurityscanner.v1alpha.ScanRun) => void; + + /** + * Callback as used by {@link google.cloud.websecurityscanner.v1alpha.WebSecurityScanner|listScanRuns}. + * @param error Error, if any + * @param [response] ListScanRunsResponse + */ + type ListScanRunsCallback = (error: (Error|null), response?: google.cloud.websecurityscanner.v1alpha.ListScanRunsResponse) => void; + + /** + * Callback as used by {@link google.cloud.websecurityscanner.v1alpha.WebSecurityScanner|stopScanRun}. + * @param error Error, if any + * @param [response] ScanRun + */ + type StopScanRunCallback = (error: (Error|null), response?: google.cloud.websecurityscanner.v1alpha.ScanRun) => void; + + /** + * Callback as used by {@link google.cloud.websecurityscanner.v1alpha.WebSecurityScanner|listCrawledUrls}. + * @param error Error, if any + * @param [response] ListCrawledUrlsResponse + */ + type ListCrawledUrlsCallback = (error: (Error|null), response?: google.cloud.websecurityscanner.v1alpha.ListCrawledUrlsResponse) => void; + + /** + * Callback as used by {@link google.cloud.websecurityscanner.v1alpha.WebSecurityScanner|getFinding}. + * @param error Error, if any + * @param [response] Finding + */ + type GetFindingCallback = (error: (Error|null), response?: google.cloud.websecurityscanner.v1alpha.Finding) => void; + + /** + * Callback as used by {@link google.cloud.websecurityscanner.v1alpha.WebSecurityScanner|listFindings}. + * @param error Error, if any + * @param [response] ListFindingsResponse + */ + type ListFindingsCallback = (error: (Error|null), response?: google.cloud.websecurityscanner.v1alpha.ListFindingsResponse) => void; + + /** + * Callback as used by {@link google.cloud.websecurityscanner.v1alpha.WebSecurityScanner|listFindingTypeStats}. + * @param error Error, if any + * @param [response] ListFindingTypeStatsResponse + */ + type ListFindingTypeStatsCallback = (error: (Error|null), response?: google.cloud.websecurityscanner.v1alpha.ListFindingTypeStatsResponse) => void; + } + + /** Properties of a CreateScanConfigRequest. */ + interface ICreateScanConfigRequest { + + /** CreateScanConfigRequest parent */ + parent?: (string|null); + + /** CreateScanConfigRequest scanConfig */ + scanConfig?: (google.cloud.websecurityscanner.v1alpha.IScanConfig|null); + } + + /** Represents a CreateScanConfigRequest. */ + class CreateScanConfigRequest implements ICreateScanConfigRequest { + + /** + * Constructs a new CreateScanConfigRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.websecurityscanner.v1alpha.ICreateScanConfigRequest); + + /** CreateScanConfigRequest parent. */ + public parent: string; + + /** CreateScanConfigRequest scanConfig. */ + public scanConfig?: (google.cloud.websecurityscanner.v1alpha.IScanConfig|null); + + /** + * Creates a new CreateScanConfigRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns CreateScanConfigRequest instance + */ + public static create(properties?: google.cloud.websecurityscanner.v1alpha.ICreateScanConfigRequest): google.cloud.websecurityscanner.v1alpha.CreateScanConfigRequest; + + /** + * Encodes the specified CreateScanConfigRequest message. Does not implicitly {@link google.cloud.websecurityscanner.v1alpha.CreateScanConfigRequest.verify|verify} messages. + * @param message CreateScanConfigRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.websecurityscanner.v1alpha.ICreateScanConfigRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CreateScanConfigRequest message, length delimited. Does not implicitly {@link google.cloud.websecurityscanner.v1alpha.CreateScanConfigRequest.verify|verify} messages. + * @param message CreateScanConfigRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.websecurityscanner.v1alpha.ICreateScanConfigRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CreateScanConfigRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CreateScanConfigRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.websecurityscanner.v1alpha.CreateScanConfigRequest; + + /** + * Decodes a CreateScanConfigRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CreateScanConfigRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.websecurityscanner.v1alpha.CreateScanConfigRequest; + + /** + * Verifies a CreateScanConfigRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a CreateScanConfigRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CreateScanConfigRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.websecurityscanner.v1alpha.CreateScanConfigRequest; + + /** + * Creates a plain object from a CreateScanConfigRequest message. Also converts values to other types if specified. + * @param message CreateScanConfigRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.websecurityscanner.v1alpha.CreateScanConfigRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CreateScanConfigRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CreateScanConfigRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a DeleteScanConfigRequest. */ + interface IDeleteScanConfigRequest { + + /** DeleteScanConfigRequest name */ + name?: (string|null); + } + + /** Represents a DeleteScanConfigRequest. */ + class DeleteScanConfigRequest implements IDeleteScanConfigRequest { + + /** + * Constructs a new DeleteScanConfigRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.websecurityscanner.v1alpha.IDeleteScanConfigRequest); + + /** DeleteScanConfigRequest name. */ + public name: string; + + /** + * Creates a new DeleteScanConfigRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns DeleteScanConfigRequest instance + */ + public static create(properties?: google.cloud.websecurityscanner.v1alpha.IDeleteScanConfigRequest): google.cloud.websecurityscanner.v1alpha.DeleteScanConfigRequest; + + /** + * Encodes the specified DeleteScanConfigRequest message. Does not implicitly {@link google.cloud.websecurityscanner.v1alpha.DeleteScanConfigRequest.verify|verify} messages. + * @param message DeleteScanConfigRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.websecurityscanner.v1alpha.IDeleteScanConfigRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DeleteScanConfigRequest message, length delimited. Does not implicitly {@link google.cloud.websecurityscanner.v1alpha.DeleteScanConfigRequest.verify|verify} messages. + * @param message DeleteScanConfigRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.websecurityscanner.v1alpha.IDeleteScanConfigRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DeleteScanConfigRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DeleteScanConfigRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.websecurityscanner.v1alpha.DeleteScanConfigRequest; + + /** + * Decodes a DeleteScanConfigRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DeleteScanConfigRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.websecurityscanner.v1alpha.DeleteScanConfigRequest; + + /** + * Verifies a DeleteScanConfigRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a DeleteScanConfigRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DeleteScanConfigRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.websecurityscanner.v1alpha.DeleteScanConfigRequest; + + /** + * Creates a plain object from a DeleteScanConfigRequest message. Also converts values to other types if specified. + * @param message DeleteScanConfigRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.websecurityscanner.v1alpha.DeleteScanConfigRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DeleteScanConfigRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DeleteScanConfigRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a GetScanConfigRequest. */ + interface IGetScanConfigRequest { + + /** GetScanConfigRequest name */ + name?: (string|null); + } + + /** Represents a GetScanConfigRequest. */ + class GetScanConfigRequest implements IGetScanConfigRequest { + + /** + * Constructs a new GetScanConfigRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.websecurityscanner.v1alpha.IGetScanConfigRequest); + + /** GetScanConfigRequest name. */ + public name: string; + + /** + * Creates a new GetScanConfigRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns GetScanConfigRequest instance + */ + public static create(properties?: google.cloud.websecurityscanner.v1alpha.IGetScanConfigRequest): google.cloud.websecurityscanner.v1alpha.GetScanConfigRequest; + + /** + * Encodes the specified GetScanConfigRequest message. Does not implicitly {@link google.cloud.websecurityscanner.v1alpha.GetScanConfigRequest.verify|verify} messages. + * @param message GetScanConfigRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.websecurityscanner.v1alpha.IGetScanConfigRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GetScanConfigRequest message, length delimited. Does not implicitly {@link google.cloud.websecurityscanner.v1alpha.GetScanConfigRequest.verify|verify} messages. + * @param message GetScanConfigRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.websecurityscanner.v1alpha.IGetScanConfigRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GetScanConfigRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GetScanConfigRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.websecurityscanner.v1alpha.GetScanConfigRequest; + + /** + * Decodes a GetScanConfigRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GetScanConfigRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.websecurityscanner.v1alpha.GetScanConfigRequest; + + /** + * Verifies a GetScanConfigRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GetScanConfigRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GetScanConfigRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.websecurityscanner.v1alpha.GetScanConfigRequest; + + /** + * Creates a plain object from a GetScanConfigRequest message. Also converts values to other types if specified. + * @param message GetScanConfigRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.websecurityscanner.v1alpha.GetScanConfigRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GetScanConfigRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GetScanConfigRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListScanConfigsRequest. */ + interface IListScanConfigsRequest { + + /** ListScanConfigsRequest parent */ + parent?: (string|null); + + /** ListScanConfigsRequest pageToken */ + pageToken?: (string|null); + + /** ListScanConfigsRequest pageSize */ + pageSize?: (number|null); + } + + /** Represents a ListScanConfigsRequest. */ + class ListScanConfigsRequest implements IListScanConfigsRequest { + + /** + * Constructs a new ListScanConfigsRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.websecurityscanner.v1alpha.IListScanConfigsRequest); + + /** ListScanConfigsRequest parent. */ + public parent: string; + + /** ListScanConfigsRequest pageToken. */ + public pageToken: string; + + /** ListScanConfigsRequest pageSize. */ + public pageSize: number; + + /** + * Creates a new ListScanConfigsRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ListScanConfigsRequest instance + */ + public static create(properties?: google.cloud.websecurityscanner.v1alpha.IListScanConfigsRequest): google.cloud.websecurityscanner.v1alpha.ListScanConfigsRequest; + + /** + * Encodes the specified ListScanConfigsRequest message. Does not implicitly {@link google.cloud.websecurityscanner.v1alpha.ListScanConfigsRequest.verify|verify} messages. + * @param message ListScanConfigsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.websecurityscanner.v1alpha.IListScanConfigsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListScanConfigsRequest message, length delimited. Does not implicitly {@link google.cloud.websecurityscanner.v1alpha.ListScanConfigsRequest.verify|verify} messages. + * @param message ListScanConfigsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.websecurityscanner.v1alpha.IListScanConfigsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListScanConfigsRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListScanConfigsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.websecurityscanner.v1alpha.ListScanConfigsRequest; + + /** + * Decodes a ListScanConfigsRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListScanConfigsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.websecurityscanner.v1alpha.ListScanConfigsRequest; + + /** + * Verifies a ListScanConfigsRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListScanConfigsRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListScanConfigsRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.websecurityscanner.v1alpha.ListScanConfigsRequest; + + /** + * Creates a plain object from a ListScanConfigsRequest message. Also converts values to other types if specified. + * @param message ListScanConfigsRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.websecurityscanner.v1alpha.ListScanConfigsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListScanConfigsRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListScanConfigsRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an UpdateScanConfigRequest. */ + interface IUpdateScanConfigRequest { + + /** UpdateScanConfigRequest scanConfig */ + scanConfig?: (google.cloud.websecurityscanner.v1alpha.IScanConfig|null); + + /** UpdateScanConfigRequest updateMask */ + updateMask?: (google.protobuf.IFieldMask|null); + } + + /** Represents an UpdateScanConfigRequest. */ + class UpdateScanConfigRequest implements IUpdateScanConfigRequest { + + /** + * Constructs a new UpdateScanConfigRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.websecurityscanner.v1alpha.IUpdateScanConfigRequest); + + /** UpdateScanConfigRequest scanConfig. */ + public scanConfig?: (google.cloud.websecurityscanner.v1alpha.IScanConfig|null); + + /** UpdateScanConfigRequest updateMask. */ + public updateMask?: (google.protobuf.IFieldMask|null); + + /** + * Creates a new UpdateScanConfigRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns UpdateScanConfigRequest instance + */ + public static create(properties?: google.cloud.websecurityscanner.v1alpha.IUpdateScanConfigRequest): google.cloud.websecurityscanner.v1alpha.UpdateScanConfigRequest; + + /** + * Encodes the specified UpdateScanConfigRequest message. Does not implicitly {@link google.cloud.websecurityscanner.v1alpha.UpdateScanConfigRequest.verify|verify} messages. + * @param message UpdateScanConfigRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.websecurityscanner.v1alpha.IUpdateScanConfigRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified UpdateScanConfigRequest message, length delimited. Does not implicitly {@link google.cloud.websecurityscanner.v1alpha.UpdateScanConfigRequest.verify|verify} messages. + * @param message UpdateScanConfigRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.websecurityscanner.v1alpha.IUpdateScanConfigRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an UpdateScanConfigRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns UpdateScanConfigRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.websecurityscanner.v1alpha.UpdateScanConfigRequest; + + /** + * Decodes an UpdateScanConfigRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns UpdateScanConfigRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.websecurityscanner.v1alpha.UpdateScanConfigRequest; + + /** + * Verifies an UpdateScanConfigRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an UpdateScanConfigRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns UpdateScanConfigRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.websecurityscanner.v1alpha.UpdateScanConfigRequest; + + /** + * Creates a plain object from an UpdateScanConfigRequest message. Also converts values to other types if specified. + * @param message UpdateScanConfigRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.websecurityscanner.v1alpha.UpdateScanConfigRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this UpdateScanConfigRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for UpdateScanConfigRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListScanConfigsResponse. */ + interface IListScanConfigsResponse { + + /** ListScanConfigsResponse scanConfigs */ + scanConfigs?: (google.cloud.websecurityscanner.v1alpha.IScanConfig[]|null); + + /** ListScanConfigsResponse nextPageToken */ + nextPageToken?: (string|null); + } + + /** Represents a ListScanConfigsResponse. */ + class ListScanConfigsResponse implements IListScanConfigsResponse { + + /** + * Constructs a new ListScanConfigsResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.websecurityscanner.v1alpha.IListScanConfigsResponse); + + /** ListScanConfigsResponse scanConfigs. */ + public scanConfigs: google.cloud.websecurityscanner.v1alpha.IScanConfig[]; + + /** ListScanConfigsResponse nextPageToken. */ + public nextPageToken: string; + + /** + * Creates a new ListScanConfigsResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns ListScanConfigsResponse instance + */ + public static create(properties?: google.cloud.websecurityscanner.v1alpha.IListScanConfigsResponse): google.cloud.websecurityscanner.v1alpha.ListScanConfigsResponse; + + /** + * Encodes the specified ListScanConfigsResponse message. Does not implicitly {@link google.cloud.websecurityscanner.v1alpha.ListScanConfigsResponse.verify|verify} messages. + * @param message ListScanConfigsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.websecurityscanner.v1alpha.IListScanConfigsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListScanConfigsResponse message, length delimited. Does not implicitly {@link google.cloud.websecurityscanner.v1alpha.ListScanConfigsResponse.verify|verify} messages. + * @param message ListScanConfigsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.websecurityscanner.v1alpha.IListScanConfigsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListScanConfigsResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListScanConfigsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.websecurityscanner.v1alpha.ListScanConfigsResponse; + + /** + * Decodes a ListScanConfigsResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListScanConfigsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.websecurityscanner.v1alpha.ListScanConfigsResponse; + + /** + * Verifies a ListScanConfigsResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListScanConfigsResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListScanConfigsResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.websecurityscanner.v1alpha.ListScanConfigsResponse; + + /** + * Creates a plain object from a ListScanConfigsResponse message. Also converts values to other types if specified. + * @param message ListScanConfigsResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.websecurityscanner.v1alpha.ListScanConfigsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListScanConfigsResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListScanConfigsResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a StartScanRunRequest. */ + interface IStartScanRunRequest { + + /** StartScanRunRequest name */ + name?: (string|null); + } + + /** Represents a StartScanRunRequest. */ + class StartScanRunRequest implements IStartScanRunRequest { + + /** + * Constructs a new StartScanRunRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.websecurityscanner.v1alpha.IStartScanRunRequest); + + /** StartScanRunRequest name. */ + public name: string; + + /** + * Creates a new StartScanRunRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns StartScanRunRequest instance + */ + public static create(properties?: google.cloud.websecurityscanner.v1alpha.IStartScanRunRequest): google.cloud.websecurityscanner.v1alpha.StartScanRunRequest; + + /** + * Encodes the specified StartScanRunRequest message. Does not implicitly {@link google.cloud.websecurityscanner.v1alpha.StartScanRunRequest.verify|verify} messages. + * @param message StartScanRunRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.websecurityscanner.v1alpha.IStartScanRunRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified StartScanRunRequest message, length delimited. Does not implicitly {@link google.cloud.websecurityscanner.v1alpha.StartScanRunRequest.verify|verify} messages. + * @param message StartScanRunRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.websecurityscanner.v1alpha.IStartScanRunRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a StartScanRunRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns StartScanRunRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.websecurityscanner.v1alpha.StartScanRunRequest; + + /** + * Decodes a StartScanRunRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns StartScanRunRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.websecurityscanner.v1alpha.StartScanRunRequest; + + /** + * Verifies a StartScanRunRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a StartScanRunRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns StartScanRunRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.websecurityscanner.v1alpha.StartScanRunRequest; + + /** + * Creates a plain object from a StartScanRunRequest message. Also converts values to other types if specified. + * @param message StartScanRunRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.websecurityscanner.v1alpha.StartScanRunRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this StartScanRunRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for StartScanRunRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a GetScanRunRequest. */ + interface IGetScanRunRequest { + + /** GetScanRunRequest name */ + name?: (string|null); + } + + /** Represents a GetScanRunRequest. */ + class GetScanRunRequest implements IGetScanRunRequest { + + /** + * Constructs a new GetScanRunRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.websecurityscanner.v1alpha.IGetScanRunRequest); + + /** GetScanRunRequest name. */ + public name: string; + + /** + * Creates a new GetScanRunRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns GetScanRunRequest instance + */ + public static create(properties?: google.cloud.websecurityscanner.v1alpha.IGetScanRunRequest): google.cloud.websecurityscanner.v1alpha.GetScanRunRequest; + + /** + * Encodes the specified GetScanRunRequest message. Does not implicitly {@link google.cloud.websecurityscanner.v1alpha.GetScanRunRequest.verify|verify} messages. + * @param message GetScanRunRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.websecurityscanner.v1alpha.IGetScanRunRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GetScanRunRequest message, length delimited. Does not implicitly {@link google.cloud.websecurityscanner.v1alpha.GetScanRunRequest.verify|verify} messages. + * @param message GetScanRunRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.websecurityscanner.v1alpha.IGetScanRunRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GetScanRunRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GetScanRunRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.websecurityscanner.v1alpha.GetScanRunRequest; + + /** + * Decodes a GetScanRunRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GetScanRunRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.websecurityscanner.v1alpha.GetScanRunRequest; + + /** + * Verifies a GetScanRunRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GetScanRunRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GetScanRunRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.websecurityscanner.v1alpha.GetScanRunRequest; + + /** + * Creates a plain object from a GetScanRunRequest message. Also converts values to other types if specified. + * @param message GetScanRunRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.websecurityscanner.v1alpha.GetScanRunRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GetScanRunRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GetScanRunRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListScanRunsRequest. */ + interface IListScanRunsRequest { + + /** ListScanRunsRequest parent */ + parent?: (string|null); + + /** ListScanRunsRequest pageToken */ + pageToken?: (string|null); + + /** ListScanRunsRequest pageSize */ + pageSize?: (number|null); + } + + /** Represents a ListScanRunsRequest. */ + class ListScanRunsRequest implements IListScanRunsRequest { + + /** + * Constructs a new ListScanRunsRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.websecurityscanner.v1alpha.IListScanRunsRequest); + + /** ListScanRunsRequest parent. */ + public parent: string; + + /** ListScanRunsRequest pageToken. */ + public pageToken: string; + + /** ListScanRunsRequest pageSize. */ + public pageSize: number; + + /** + * Creates a new ListScanRunsRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ListScanRunsRequest instance + */ + public static create(properties?: google.cloud.websecurityscanner.v1alpha.IListScanRunsRequest): google.cloud.websecurityscanner.v1alpha.ListScanRunsRequest; + + /** + * Encodes the specified ListScanRunsRequest message. Does not implicitly {@link google.cloud.websecurityscanner.v1alpha.ListScanRunsRequest.verify|verify} messages. + * @param message ListScanRunsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.websecurityscanner.v1alpha.IListScanRunsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListScanRunsRequest message, length delimited. Does not implicitly {@link google.cloud.websecurityscanner.v1alpha.ListScanRunsRequest.verify|verify} messages. + * @param message ListScanRunsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.websecurityscanner.v1alpha.IListScanRunsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListScanRunsRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListScanRunsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.websecurityscanner.v1alpha.ListScanRunsRequest; + + /** + * Decodes a ListScanRunsRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListScanRunsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.websecurityscanner.v1alpha.ListScanRunsRequest; + + /** + * Verifies a ListScanRunsRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListScanRunsRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListScanRunsRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.websecurityscanner.v1alpha.ListScanRunsRequest; + + /** + * Creates a plain object from a ListScanRunsRequest message. Also converts values to other types if specified. + * @param message ListScanRunsRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.websecurityscanner.v1alpha.ListScanRunsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListScanRunsRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListScanRunsRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListScanRunsResponse. */ + interface IListScanRunsResponse { + + /** ListScanRunsResponse scanRuns */ + scanRuns?: (google.cloud.websecurityscanner.v1alpha.IScanRun[]|null); + + /** ListScanRunsResponse nextPageToken */ + nextPageToken?: (string|null); + } + + /** Represents a ListScanRunsResponse. */ + class ListScanRunsResponse implements IListScanRunsResponse { + + /** + * Constructs a new ListScanRunsResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.websecurityscanner.v1alpha.IListScanRunsResponse); + + /** ListScanRunsResponse scanRuns. */ + public scanRuns: google.cloud.websecurityscanner.v1alpha.IScanRun[]; + + /** ListScanRunsResponse nextPageToken. */ + public nextPageToken: string; + + /** + * Creates a new ListScanRunsResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns ListScanRunsResponse instance + */ + public static create(properties?: google.cloud.websecurityscanner.v1alpha.IListScanRunsResponse): google.cloud.websecurityscanner.v1alpha.ListScanRunsResponse; + + /** + * Encodes the specified ListScanRunsResponse message. Does not implicitly {@link google.cloud.websecurityscanner.v1alpha.ListScanRunsResponse.verify|verify} messages. + * @param message ListScanRunsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.websecurityscanner.v1alpha.IListScanRunsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListScanRunsResponse message, length delimited. Does not implicitly {@link google.cloud.websecurityscanner.v1alpha.ListScanRunsResponse.verify|verify} messages. + * @param message ListScanRunsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.websecurityscanner.v1alpha.IListScanRunsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListScanRunsResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListScanRunsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.websecurityscanner.v1alpha.ListScanRunsResponse; + + /** + * Decodes a ListScanRunsResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListScanRunsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.websecurityscanner.v1alpha.ListScanRunsResponse; + + /** + * Verifies a ListScanRunsResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListScanRunsResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListScanRunsResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.websecurityscanner.v1alpha.ListScanRunsResponse; + + /** + * Creates a plain object from a ListScanRunsResponse message. Also converts values to other types if specified. + * @param message ListScanRunsResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.websecurityscanner.v1alpha.ListScanRunsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListScanRunsResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListScanRunsResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a StopScanRunRequest. */ + interface IStopScanRunRequest { + + /** StopScanRunRequest name */ + name?: (string|null); + } + + /** Represents a StopScanRunRequest. */ + class StopScanRunRequest implements IStopScanRunRequest { + + /** + * Constructs a new StopScanRunRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.websecurityscanner.v1alpha.IStopScanRunRequest); + + /** StopScanRunRequest name. */ + public name: string; + + /** + * Creates a new StopScanRunRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns StopScanRunRequest instance + */ + public static create(properties?: google.cloud.websecurityscanner.v1alpha.IStopScanRunRequest): google.cloud.websecurityscanner.v1alpha.StopScanRunRequest; + + /** + * Encodes the specified StopScanRunRequest message. Does not implicitly {@link google.cloud.websecurityscanner.v1alpha.StopScanRunRequest.verify|verify} messages. + * @param message StopScanRunRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.websecurityscanner.v1alpha.IStopScanRunRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified StopScanRunRequest message, length delimited. Does not implicitly {@link google.cloud.websecurityscanner.v1alpha.StopScanRunRequest.verify|verify} messages. + * @param message StopScanRunRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.websecurityscanner.v1alpha.IStopScanRunRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a StopScanRunRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns StopScanRunRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.websecurityscanner.v1alpha.StopScanRunRequest; + + /** + * Decodes a StopScanRunRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns StopScanRunRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.websecurityscanner.v1alpha.StopScanRunRequest; + + /** + * Verifies a StopScanRunRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a StopScanRunRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns StopScanRunRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.websecurityscanner.v1alpha.StopScanRunRequest; + + /** + * Creates a plain object from a StopScanRunRequest message. Also converts values to other types if specified. + * @param message StopScanRunRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.websecurityscanner.v1alpha.StopScanRunRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this StopScanRunRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for StopScanRunRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListCrawledUrlsRequest. */ + interface IListCrawledUrlsRequest { + + /** ListCrawledUrlsRequest parent */ + parent?: (string|null); + + /** ListCrawledUrlsRequest pageToken */ + pageToken?: (string|null); + + /** ListCrawledUrlsRequest pageSize */ + pageSize?: (number|null); + } + + /** Represents a ListCrawledUrlsRequest. */ + class ListCrawledUrlsRequest implements IListCrawledUrlsRequest { + + /** + * Constructs a new ListCrawledUrlsRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.websecurityscanner.v1alpha.IListCrawledUrlsRequest); + + /** ListCrawledUrlsRequest parent. */ + public parent: string; + + /** ListCrawledUrlsRequest pageToken. */ + public pageToken: string; + + /** ListCrawledUrlsRequest pageSize. */ + public pageSize: number; + + /** + * Creates a new ListCrawledUrlsRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ListCrawledUrlsRequest instance + */ + public static create(properties?: google.cloud.websecurityscanner.v1alpha.IListCrawledUrlsRequest): google.cloud.websecurityscanner.v1alpha.ListCrawledUrlsRequest; + + /** + * Encodes the specified ListCrawledUrlsRequest message. Does not implicitly {@link google.cloud.websecurityscanner.v1alpha.ListCrawledUrlsRequest.verify|verify} messages. + * @param message ListCrawledUrlsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.websecurityscanner.v1alpha.IListCrawledUrlsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListCrawledUrlsRequest message, length delimited. Does not implicitly {@link google.cloud.websecurityscanner.v1alpha.ListCrawledUrlsRequest.verify|verify} messages. + * @param message ListCrawledUrlsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.websecurityscanner.v1alpha.IListCrawledUrlsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListCrawledUrlsRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListCrawledUrlsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.websecurityscanner.v1alpha.ListCrawledUrlsRequest; + + /** + * Decodes a ListCrawledUrlsRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListCrawledUrlsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.websecurityscanner.v1alpha.ListCrawledUrlsRequest; + + /** + * Verifies a ListCrawledUrlsRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListCrawledUrlsRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListCrawledUrlsRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.websecurityscanner.v1alpha.ListCrawledUrlsRequest; + + /** + * Creates a plain object from a ListCrawledUrlsRequest message. Also converts values to other types if specified. + * @param message ListCrawledUrlsRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.websecurityscanner.v1alpha.ListCrawledUrlsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListCrawledUrlsRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListCrawledUrlsRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListCrawledUrlsResponse. */ + interface IListCrawledUrlsResponse { + + /** ListCrawledUrlsResponse crawledUrls */ + crawledUrls?: (google.cloud.websecurityscanner.v1alpha.ICrawledUrl[]|null); + + /** ListCrawledUrlsResponse nextPageToken */ + nextPageToken?: (string|null); + } + + /** Represents a ListCrawledUrlsResponse. */ + class ListCrawledUrlsResponse implements IListCrawledUrlsResponse { + + /** + * Constructs a new ListCrawledUrlsResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.websecurityscanner.v1alpha.IListCrawledUrlsResponse); + + /** ListCrawledUrlsResponse crawledUrls. */ + public crawledUrls: google.cloud.websecurityscanner.v1alpha.ICrawledUrl[]; + + /** ListCrawledUrlsResponse nextPageToken. */ + public nextPageToken: string; + + /** + * Creates a new ListCrawledUrlsResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns ListCrawledUrlsResponse instance + */ + public static create(properties?: google.cloud.websecurityscanner.v1alpha.IListCrawledUrlsResponse): google.cloud.websecurityscanner.v1alpha.ListCrawledUrlsResponse; + + /** + * Encodes the specified ListCrawledUrlsResponse message. Does not implicitly {@link google.cloud.websecurityscanner.v1alpha.ListCrawledUrlsResponse.verify|verify} messages. + * @param message ListCrawledUrlsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.websecurityscanner.v1alpha.IListCrawledUrlsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListCrawledUrlsResponse message, length delimited. Does not implicitly {@link google.cloud.websecurityscanner.v1alpha.ListCrawledUrlsResponse.verify|verify} messages. + * @param message ListCrawledUrlsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.websecurityscanner.v1alpha.IListCrawledUrlsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListCrawledUrlsResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListCrawledUrlsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.websecurityscanner.v1alpha.ListCrawledUrlsResponse; + + /** + * Decodes a ListCrawledUrlsResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListCrawledUrlsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.websecurityscanner.v1alpha.ListCrawledUrlsResponse; + + /** + * Verifies a ListCrawledUrlsResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListCrawledUrlsResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListCrawledUrlsResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.websecurityscanner.v1alpha.ListCrawledUrlsResponse; + + /** + * Creates a plain object from a ListCrawledUrlsResponse message. Also converts values to other types if specified. + * @param message ListCrawledUrlsResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.websecurityscanner.v1alpha.ListCrawledUrlsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListCrawledUrlsResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListCrawledUrlsResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a GetFindingRequest. */ + interface IGetFindingRequest { + + /** GetFindingRequest name */ + name?: (string|null); + } + + /** Represents a GetFindingRequest. */ + class GetFindingRequest implements IGetFindingRequest { + + /** + * Constructs a new GetFindingRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.websecurityscanner.v1alpha.IGetFindingRequest); + + /** GetFindingRequest name. */ + public name: string; + + /** + * Creates a new GetFindingRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns GetFindingRequest instance + */ + public static create(properties?: google.cloud.websecurityscanner.v1alpha.IGetFindingRequest): google.cloud.websecurityscanner.v1alpha.GetFindingRequest; + + /** + * Encodes the specified GetFindingRequest message. Does not implicitly {@link google.cloud.websecurityscanner.v1alpha.GetFindingRequest.verify|verify} messages. + * @param message GetFindingRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.websecurityscanner.v1alpha.IGetFindingRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GetFindingRequest message, length delimited. Does not implicitly {@link google.cloud.websecurityscanner.v1alpha.GetFindingRequest.verify|verify} messages. + * @param message GetFindingRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.websecurityscanner.v1alpha.IGetFindingRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GetFindingRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GetFindingRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.websecurityscanner.v1alpha.GetFindingRequest; + + /** + * Decodes a GetFindingRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GetFindingRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.websecurityscanner.v1alpha.GetFindingRequest; + + /** + * Verifies a GetFindingRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GetFindingRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GetFindingRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.websecurityscanner.v1alpha.GetFindingRequest; + + /** + * Creates a plain object from a GetFindingRequest message. Also converts values to other types if specified. + * @param message GetFindingRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.websecurityscanner.v1alpha.GetFindingRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GetFindingRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GetFindingRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListFindingsRequest. */ + interface IListFindingsRequest { + + /** ListFindingsRequest parent */ + parent?: (string|null); + + /** ListFindingsRequest filter */ + filter?: (string|null); + + /** ListFindingsRequest pageToken */ + pageToken?: (string|null); + + /** ListFindingsRequest pageSize */ + pageSize?: (number|null); + } + + /** Represents a ListFindingsRequest. */ + class ListFindingsRequest implements IListFindingsRequest { + + /** + * Constructs a new ListFindingsRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.websecurityscanner.v1alpha.IListFindingsRequest); + + /** ListFindingsRequest parent. */ + public parent: string; + + /** ListFindingsRequest filter. */ + public filter: string; + + /** ListFindingsRequest pageToken. */ + public pageToken: string; + + /** ListFindingsRequest pageSize. */ + public pageSize: number; + + /** + * Creates a new ListFindingsRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ListFindingsRequest instance + */ + public static create(properties?: google.cloud.websecurityscanner.v1alpha.IListFindingsRequest): google.cloud.websecurityscanner.v1alpha.ListFindingsRequest; + + /** + * Encodes the specified ListFindingsRequest message. Does not implicitly {@link google.cloud.websecurityscanner.v1alpha.ListFindingsRequest.verify|verify} messages. + * @param message ListFindingsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.websecurityscanner.v1alpha.IListFindingsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListFindingsRequest message, length delimited. Does not implicitly {@link google.cloud.websecurityscanner.v1alpha.ListFindingsRequest.verify|verify} messages. + * @param message ListFindingsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.websecurityscanner.v1alpha.IListFindingsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListFindingsRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListFindingsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.websecurityscanner.v1alpha.ListFindingsRequest; + + /** + * Decodes a ListFindingsRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListFindingsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.websecurityscanner.v1alpha.ListFindingsRequest; + + /** + * Verifies a ListFindingsRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListFindingsRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListFindingsRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.websecurityscanner.v1alpha.ListFindingsRequest; + + /** + * Creates a plain object from a ListFindingsRequest message. Also converts values to other types if specified. + * @param message ListFindingsRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.websecurityscanner.v1alpha.ListFindingsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListFindingsRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListFindingsRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListFindingsResponse. */ + interface IListFindingsResponse { + + /** ListFindingsResponse findings */ + findings?: (google.cloud.websecurityscanner.v1alpha.IFinding[]|null); + + /** ListFindingsResponse nextPageToken */ + nextPageToken?: (string|null); + } + + /** Represents a ListFindingsResponse. */ + class ListFindingsResponse implements IListFindingsResponse { + + /** + * Constructs a new ListFindingsResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.websecurityscanner.v1alpha.IListFindingsResponse); + + /** ListFindingsResponse findings. */ + public findings: google.cloud.websecurityscanner.v1alpha.IFinding[]; + + /** ListFindingsResponse nextPageToken. */ + public nextPageToken: string; + + /** + * Creates a new ListFindingsResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns ListFindingsResponse instance + */ + public static create(properties?: google.cloud.websecurityscanner.v1alpha.IListFindingsResponse): google.cloud.websecurityscanner.v1alpha.ListFindingsResponse; + + /** + * Encodes the specified ListFindingsResponse message. Does not implicitly {@link google.cloud.websecurityscanner.v1alpha.ListFindingsResponse.verify|verify} messages. + * @param message ListFindingsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.websecurityscanner.v1alpha.IListFindingsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListFindingsResponse message, length delimited. Does not implicitly {@link google.cloud.websecurityscanner.v1alpha.ListFindingsResponse.verify|verify} messages. + * @param message ListFindingsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.websecurityscanner.v1alpha.IListFindingsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListFindingsResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListFindingsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.websecurityscanner.v1alpha.ListFindingsResponse; + + /** + * Decodes a ListFindingsResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListFindingsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.websecurityscanner.v1alpha.ListFindingsResponse; + + /** + * Verifies a ListFindingsResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListFindingsResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListFindingsResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.websecurityscanner.v1alpha.ListFindingsResponse; + + /** + * Creates a plain object from a ListFindingsResponse message. Also converts values to other types if specified. + * @param message ListFindingsResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.websecurityscanner.v1alpha.ListFindingsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListFindingsResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListFindingsResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListFindingTypeStatsRequest. */ + interface IListFindingTypeStatsRequest { + + /** ListFindingTypeStatsRequest parent */ + parent?: (string|null); + } + + /** Represents a ListFindingTypeStatsRequest. */ + class ListFindingTypeStatsRequest implements IListFindingTypeStatsRequest { + + /** + * Constructs a new ListFindingTypeStatsRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.websecurityscanner.v1alpha.IListFindingTypeStatsRequest); + + /** ListFindingTypeStatsRequest parent. */ + public parent: string; + + /** + * Creates a new ListFindingTypeStatsRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ListFindingTypeStatsRequest instance + */ + public static create(properties?: google.cloud.websecurityscanner.v1alpha.IListFindingTypeStatsRequest): google.cloud.websecurityscanner.v1alpha.ListFindingTypeStatsRequest; + + /** + * Encodes the specified ListFindingTypeStatsRequest message. Does not implicitly {@link google.cloud.websecurityscanner.v1alpha.ListFindingTypeStatsRequest.verify|verify} messages. + * @param message ListFindingTypeStatsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.websecurityscanner.v1alpha.IListFindingTypeStatsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListFindingTypeStatsRequest message, length delimited. Does not implicitly {@link google.cloud.websecurityscanner.v1alpha.ListFindingTypeStatsRequest.verify|verify} messages. + * @param message ListFindingTypeStatsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.websecurityscanner.v1alpha.IListFindingTypeStatsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListFindingTypeStatsRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListFindingTypeStatsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.websecurityscanner.v1alpha.ListFindingTypeStatsRequest; + + /** + * Decodes a ListFindingTypeStatsRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListFindingTypeStatsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.websecurityscanner.v1alpha.ListFindingTypeStatsRequest; + + /** + * Verifies a ListFindingTypeStatsRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListFindingTypeStatsRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListFindingTypeStatsRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.websecurityscanner.v1alpha.ListFindingTypeStatsRequest; + + /** + * Creates a plain object from a ListFindingTypeStatsRequest message. Also converts values to other types if specified. + * @param message ListFindingTypeStatsRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.websecurityscanner.v1alpha.ListFindingTypeStatsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListFindingTypeStatsRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListFindingTypeStatsRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListFindingTypeStatsResponse. */ + interface IListFindingTypeStatsResponse { + + /** ListFindingTypeStatsResponse findingTypeStats */ + findingTypeStats?: (google.cloud.websecurityscanner.v1alpha.IFindingTypeStats[]|null); + } + + /** Represents a ListFindingTypeStatsResponse. */ + class ListFindingTypeStatsResponse implements IListFindingTypeStatsResponse { + + /** + * Constructs a new ListFindingTypeStatsResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.websecurityscanner.v1alpha.IListFindingTypeStatsResponse); + + /** ListFindingTypeStatsResponse findingTypeStats. */ + public findingTypeStats: google.cloud.websecurityscanner.v1alpha.IFindingTypeStats[]; + + /** + * Creates a new ListFindingTypeStatsResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns ListFindingTypeStatsResponse instance + */ + public static create(properties?: google.cloud.websecurityscanner.v1alpha.IListFindingTypeStatsResponse): google.cloud.websecurityscanner.v1alpha.ListFindingTypeStatsResponse; + + /** + * Encodes the specified ListFindingTypeStatsResponse message. Does not implicitly {@link google.cloud.websecurityscanner.v1alpha.ListFindingTypeStatsResponse.verify|verify} messages. + * @param message ListFindingTypeStatsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.websecurityscanner.v1alpha.IListFindingTypeStatsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListFindingTypeStatsResponse message, length delimited. Does not implicitly {@link google.cloud.websecurityscanner.v1alpha.ListFindingTypeStatsResponse.verify|verify} messages. + * @param message ListFindingTypeStatsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.websecurityscanner.v1alpha.IListFindingTypeStatsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListFindingTypeStatsResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListFindingTypeStatsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.websecurityscanner.v1alpha.ListFindingTypeStatsResponse; + + /** + * Decodes a ListFindingTypeStatsResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListFindingTypeStatsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.websecurityscanner.v1alpha.ListFindingTypeStatsResponse; + + /** + * Verifies a ListFindingTypeStatsResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListFindingTypeStatsResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListFindingTypeStatsResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.websecurityscanner.v1alpha.ListFindingTypeStatsResponse; + + /** + * Creates a plain object from a ListFindingTypeStatsResponse message. Also converts values to other types if specified. + * @param message ListFindingTypeStatsResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.websecurityscanner.v1alpha.ListFindingTypeStatsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListFindingTypeStatsResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListFindingTypeStatsResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Namespace v1beta. */ + namespace v1beta { + + /** Properties of a CrawledUrl. */ + interface ICrawledUrl { + + /** CrawledUrl httpMethod */ + httpMethod?: (string|null); + + /** CrawledUrl url */ + url?: (string|null); + + /** CrawledUrl body */ + body?: (string|null); + } + + /** Represents a CrawledUrl. */ + class CrawledUrl implements ICrawledUrl { + + /** + * Constructs a new CrawledUrl. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.websecurityscanner.v1beta.ICrawledUrl); + + /** CrawledUrl httpMethod. */ + public httpMethod: string; + + /** CrawledUrl url. */ + public url: string; + + /** CrawledUrl body. */ + public body: string; + + /** + * Creates a new CrawledUrl instance using the specified properties. + * @param [properties] Properties to set + * @returns CrawledUrl instance + */ + public static create(properties?: google.cloud.websecurityscanner.v1beta.ICrawledUrl): google.cloud.websecurityscanner.v1beta.CrawledUrl; + + /** + * Encodes the specified CrawledUrl message. Does not implicitly {@link google.cloud.websecurityscanner.v1beta.CrawledUrl.verify|verify} messages. + * @param message CrawledUrl message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.websecurityscanner.v1beta.ICrawledUrl, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CrawledUrl message, length delimited. Does not implicitly {@link google.cloud.websecurityscanner.v1beta.CrawledUrl.verify|verify} messages. + * @param message CrawledUrl message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.websecurityscanner.v1beta.ICrawledUrl, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CrawledUrl message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CrawledUrl + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.websecurityscanner.v1beta.CrawledUrl; + + /** + * Decodes a CrawledUrl message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CrawledUrl + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.websecurityscanner.v1beta.CrawledUrl; + + /** + * Verifies a CrawledUrl message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a CrawledUrl message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CrawledUrl + */ + public static fromObject(object: { [k: string]: any }): google.cloud.websecurityscanner.v1beta.CrawledUrl; + + /** + * Creates a plain object from a CrawledUrl message. Also converts values to other types if specified. + * @param message CrawledUrl + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.websecurityscanner.v1beta.CrawledUrl, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CrawledUrl to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CrawledUrl + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a Finding. */ + interface IFinding { + + /** Finding name */ + name?: (string|null); + + /** Finding findingType */ + findingType?: (string|null); + + /** Finding httpMethod */ + httpMethod?: (string|null); + + /** Finding fuzzedUrl */ + fuzzedUrl?: (string|null); + + /** Finding body */ + body?: (string|null); + + /** Finding description */ + description?: (string|null); + + /** Finding reproductionUrl */ + reproductionUrl?: (string|null); + + /** Finding frameUrl */ + frameUrl?: (string|null); + + /** Finding finalUrl */ + finalUrl?: (string|null); + + /** Finding trackingId */ + trackingId?: (string|null); + + /** Finding form */ + form?: (google.cloud.websecurityscanner.v1beta.IForm|null); + + /** Finding outdatedLibrary */ + outdatedLibrary?: (google.cloud.websecurityscanner.v1beta.IOutdatedLibrary|null); + + /** Finding violatingResource */ + violatingResource?: (google.cloud.websecurityscanner.v1beta.IViolatingResource|null); + + /** Finding vulnerableHeaders */ + vulnerableHeaders?: (google.cloud.websecurityscanner.v1beta.IVulnerableHeaders|null); + + /** Finding vulnerableParameters */ + vulnerableParameters?: (google.cloud.websecurityscanner.v1beta.IVulnerableParameters|null); + + /** Finding xss */ + xss?: (google.cloud.websecurityscanner.v1beta.IXss|null); + } + + /** Represents a Finding. */ + class Finding implements IFinding { + + /** + * Constructs a new Finding. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.websecurityscanner.v1beta.IFinding); + + /** Finding name. */ + public name: string; + + /** Finding findingType. */ + public findingType: string; + + /** Finding httpMethod. */ + public httpMethod: string; + + /** Finding fuzzedUrl. */ + public fuzzedUrl: string; + + /** Finding body. */ + public body: string; + + /** Finding description. */ + public description: string; + + /** Finding reproductionUrl. */ + public reproductionUrl: string; + + /** Finding frameUrl. */ + public frameUrl: string; + + /** Finding finalUrl. */ + public finalUrl: string; + + /** Finding trackingId. */ + public trackingId: string; + + /** Finding form. */ + public form?: (google.cloud.websecurityscanner.v1beta.IForm|null); + + /** Finding outdatedLibrary. */ + public outdatedLibrary?: (google.cloud.websecurityscanner.v1beta.IOutdatedLibrary|null); + + /** Finding violatingResource. */ + public violatingResource?: (google.cloud.websecurityscanner.v1beta.IViolatingResource|null); + + /** Finding vulnerableHeaders. */ + public vulnerableHeaders?: (google.cloud.websecurityscanner.v1beta.IVulnerableHeaders|null); + + /** Finding vulnerableParameters. */ + public vulnerableParameters?: (google.cloud.websecurityscanner.v1beta.IVulnerableParameters|null); + + /** Finding xss. */ + public xss?: (google.cloud.websecurityscanner.v1beta.IXss|null); + + /** + * Creates a new Finding instance using the specified properties. + * @param [properties] Properties to set + * @returns Finding instance + */ + public static create(properties?: google.cloud.websecurityscanner.v1beta.IFinding): google.cloud.websecurityscanner.v1beta.Finding; + + /** + * Encodes the specified Finding message. Does not implicitly {@link google.cloud.websecurityscanner.v1beta.Finding.verify|verify} messages. + * @param message Finding message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.websecurityscanner.v1beta.IFinding, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Finding message, length delimited. Does not implicitly {@link google.cloud.websecurityscanner.v1beta.Finding.verify|verify} messages. + * @param message Finding message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.websecurityscanner.v1beta.IFinding, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Finding message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Finding + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.websecurityscanner.v1beta.Finding; + + /** + * Decodes a Finding message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Finding + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.websecurityscanner.v1beta.Finding; + + /** + * Verifies a Finding message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Finding message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Finding + */ + public static fromObject(object: { [k: string]: any }): google.cloud.websecurityscanner.v1beta.Finding; + + /** + * Creates a plain object from a Finding message. Also converts values to other types if specified. + * @param message Finding + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.websecurityscanner.v1beta.Finding, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Finding to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Finding + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a Form. */ + interface IForm { + + /** Form actionUri */ + actionUri?: (string|null); + + /** Form fields */ + fields?: (string[]|null); + } + + /** Represents a Form. */ + class Form implements IForm { + + /** + * Constructs a new Form. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.websecurityscanner.v1beta.IForm); + + /** Form actionUri. */ + public actionUri: string; + + /** Form fields. */ + public fields: string[]; + + /** + * Creates a new Form instance using the specified properties. + * @param [properties] Properties to set + * @returns Form instance + */ + public static create(properties?: google.cloud.websecurityscanner.v1beta.IForm): google.cloud.websecurityscanner.v1beta.Form; + + /** + * Encodes the specified Form message. Does not implicitly {@link google.cloud.websecurityscanner.v1beta.Form.verify|verify} messages. + * @param message Form message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.websecurityscanner.v1beta.IForm, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Form message, length delimited. Does not implicitly {@link google.cloud.websecurityscanner.v1beta.Form.verify|verify} messages. + * @param message Form message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.websecurityscanner.v1beta.IForm, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Form message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Form + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.websecurityscanner.v1beta.Form; + + /** + * Decodes a Form message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Form + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.websecurityscanner.v1beta.Form; + + /** + * Verifies a Form message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Form message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Form + */ + public static fromObject(object: { [k: string]: any }): google.cloud.websecurityscanner.v1beta.Form; + + /** + * Creates a plain object from a Form message. Also converts values to other types if specified. + * @param message Form + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.websecurityscanner.v1beta.Form, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Form to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Form + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an OutdatedLibrary. */ + interface IOutdatedLibrary { + + /** OutdatedLibrary libraryName */ + libraryName?: (string|null); + + /** OutdatedLibrary version */ + version?: (string|null); + + /** OutdatedLibrary learnMoreUrls */ + learnMoreUrls?: (string[]|null); + } + + /** Represents an OutdatedLibrary. */ + class OutdatedLibrary implements IOutdatedLibrary { + + /** + * Constructs a new OutdatedLibrary. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.websecurityscanner.v1beta.IOutdatedLibrary); + + /** OutdatedLibrary libraryName. */ + public libraryName: string; + + /** OutdatedLibrary version. */ + public version: string; + + /** OutdatedLibrary learnMoreUrls. */ + public learnMoreUrls: string[]; + + /** + * Creates a new OutdatedLibrary instance using the specified properties. + * @param [properties] Properties to set + * @returns OutdatedLibrary instance + */ + public static create(properties?: google.cloud.websecurityscanner.v1beta.IOutdatedLibrary): google.cloud.websecurityscanner.v1beta.OutdatedLibrary; + + /** + * Encodes the specified OutdatedLibrary message. Does not implicitly {@link google.cloud.websecurityscanner.v1beta.OutdatedLibrary.verify|verify} messages. + * @param message OutdatedLibrary message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.websecurityscanner.v1beta.IOutdatedLibrary, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified OutdatedLibrary message, length delimited. Does not implicitly {@link google.cloud.websecurityscanner.v1beta.OutdatedLibrary.verify|verify} messages. + * @param message OutdatedLibrary message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.websecurityscanner.v1beta.IOutdatedLibrary, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an OutdatedLibrary message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns OutdatedLibrary + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.websecurityscanner.v1beta.OutdatedLibrary; + + /** + * Decodes an OutdatedLibrary message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns OutdatedLibrary + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.websecurityscanner.v1beta.OutdatedLibrary; + + /** + * Verifies an OutdatedLibrary message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an OutdatedLibrary message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns OutdatedLibrary + */ + public static fromObject(object: { [k: string]: any }): google.cloud.websecurityscanner.v1beta.OutdatedLibrary; + + /** + * Creates a plain object from an OutdatedLibrary message. Also converts values to other types if specified. + * @param message OutdatedLibrary + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.websecurityscanner.v1beta.OutdatedLibrary, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this OutdatedLibrary to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for OutdatedLibrary + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ViolatingResource. */ + interface IViolatingResource { + + /** ViolatingResource contentType */ + contentType?: (string|null); + + /** ViolatingResource resourceUrl */ + resourceUrl?: (string|null); + } + + /** Represents a ViolatingResource. */ + class ViolatingResource implements IViolatingResource { + + /** + * Constructs a new ViolatingResource. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.websecurityscanner.v1beta.IViolatingResource); + + /** ViolatingResource contentType. */ + public contentType: string; + + /** ViolatingResource resourceUrl. */ + public resourceUrl: string; + + /** + * Creates a new ViolatingResource instance using the specified properties. + * @param [properties] Properties to set + * @returns ViolatingResource instance + */ + public static create(properties?: google.cloud.websecurityscanner.v1beta.IViolatingResource): google.cloud.websecurityscanner.v1beta.ViolatingResource; + + /** + * Encodes the specified ViolatingResource message. Does not implicitly {@link google.cloud.websecurityscanner.v1beta.ViolatingResource.verify|verify} messages. + * @param message ViolatingResource message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.websecurityscanner.v1beta.IViolatingResource, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ViolatingResource message, length delimited. Does not implicitly {@link google.cloud.websecurityscanner.v1beta.ViolatingResource.verify|verify} messages. + * @param message ViolatingResource message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.websecurityscanner.v1beta.IViolatingResource, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ViolatingResource message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ViolatingResource + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.websecurityscanner.v1beta.ViolatingResource; + + /** + * Decodes a ViolatingResource message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ViolatingResource + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.websecurityscanner.v1beta.ViolatingResource; + + /** + * Verifies a ViolatingResource message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ViolatingResource message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ViolatingResource + */ + public static fromObject(object: { [k: string]: any }): google.cloud.websecurityscanner.v1beta.ViolatingResource; + + /** + * Creates a plain object from a ViolatingResource message. Also converts values to other types if specified. + * @param message ViolatingResource + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.websecurityscanner.v1beta.ViolatingResource, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ViolatingResource to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ViolatingResource + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a VulnerableParameters. */ + interface IVulnerableParameters { + + /** VulnerableParameters parameterNames */ + parameterNames?: (string[]|null); + } + + /** Represents a VulnerableParameters. */ + class VulnerableParameters implements IVulnerableParameters { + + /** + * Constructs a new VulnerableParameters. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.websecurityscanner.v1beta.IVulnerableParameters); + + /** VulnerableParameters parameterNames. */ + public parameterNames: string[]; + + /** + * Creates a new VulnerableParameters instance using the specified properties. + * @param [properties] Properties to set + * @returns VulnerableParameters instance + */ + public static create(properties?: google.cloud.websecurityscanner.v1beta.IVulnerableParameters): google.cloud.websecurityscanner.v1beta.VulnerableParameters; + + /** + * Encodes the specified VulnerableParameters message. Does not implicitly {@link google.cloud.websecurityscanner.v1beta.VulnerableParameters.verify|verify} messages. + * @param message VulnerableParameters message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.websecurityscanner.v1beta.IVulnerableParameters, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified VulnerableParameters message, length delimited. Does not implicitly {@link google.cloud.websecurityscanner.v1beta.VulnerableParameters.verify|verify} messages. + * @param message VulnerableParameters message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.websecurityscanner.v1beta.IVulnerableParameters, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a VulnerableParameters message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns VulnerableParameters + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.websecurityscanner.v1beta.VulnerableParameters; + + /** + * Decodes a VulnerableParameters message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns VulnerableParameters + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.websecurityscanner.v1beta.VulnerableParameters; + + /** + * Verifies a VulnerableParameters message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a VulnerableParameters message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns VulnerableParameters + */ + public static fromObject(object: { [k: string]: any }): google.cloud.websecurityscanner.v1beta.VulnerableParameters; + + /** + * Creates a plain object from a VulnerableParameters message. Also converts values to other types if specified. + * @param message VulnerableParameters + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.websecurityscanner.v1beta.VulnerableParameters, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this VulnerableParameters to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for VulnerableParameters + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a VulnerableHeaders. */ + interface IVulnerableHeaders { + + /** VulnerableHeaders headers */ + headers?: (google.cloud.websecurityscanner.v1beta.VulnerableHeaders.IHeader[]|null); + + /** VulnerableHeaders missingHeaders */ + missingHeaders?: (google.cloud.websecurityscanner.v1beta.VulnerableHeaders.IHeader[]|null); + } + + /** Represents a VulnerableHeaders. */ + class VulnerableHeaders implements IVulnerableHeaders { + + /** + * Constructs a new VulnerableHeaders. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.websecurityscanner.v1beta.IVulnerableHeaders); + + /** VulnerableHeaders headers. */ + public headers: google.cloud.websecurityscanner.v1beta.VulnerableHeaders.IHeader[]; + + /** VulnerableHeaders missingHeaders. */ + public missingHeaders: google.cloud.websecurityscanner.v1beta.VulnerableHeaders.IHeader[]; + + /** + * Creates a new VulnerableHeaders instance using the specified properties. + * @param [properties] Properties to set + * @returns VulnerableHeaders instance + */ + public static create(properties?: google.cloud.websecurityscanner.v1beta.IVulnerableHeaders): google.cloud.websecurityscanner.v1beta.VulnerableHeaders; + + /** + * Encodes the specified VulnerableHeaders message. Does not implicitly {@link google.cloud.websecurityscanner.v1beta.VulnerableHeaders.verify|verify} messages. + * @param message VulnerableHeaders message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.websecurityscanner.v1beta.IVulnerableHeaders, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified VulnerableHeaders message, length delimited. Does not implicitly {@link google.cloud.websecurityscanner.v1beta.VulnerableHeaders.verify|verify} messages. + * @param message VulnerableHeaders message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.websecurityscanner.v1beta.IVulnerableHeaders, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a VulnerableHeaders message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns VulnerableHeaders + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.websecurityscanner.v1beta.VulnerableHeaders; + + /** + * Decodes a VulnerableHeaders message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns VulnerableHeaders + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.websecurityscanner.v1beta.VulnerableHeaders; + + /** + * Verifies a VulnerableHeaders message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a VulnerableHeaders message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns VulnerableHeaders + */ + public static fromObject(object: { [k: string]: any }): google.cloud.websecurityscanner.v1beta.VulnerableHeaders; + + /** + * Creates a plain object from a VulnerableHeaders message. Also converts values to other types if specified. + * @param message VulnerableHeaders + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.websecurityscanner.v1beta.VulnerableHeaders, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this VulnerableHeaders to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for VulnerableHeaders + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace VulnerableHeaders { + + /** Properties of a Header. */ + interface IHeader { + + /** Header name */ + name?: (string|null); + + /** Header value */ + value?: (string|null); + } + + /** Represents a Header. */ + class Header implements IHeader { + + /** + * Constructs a new Header. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.websecurityscanner.v1beta.VulnerableHeaders.IHeader); + + /** Header name. */ + public name: string; + + /** Header value. */ + public value: string; + + /** + * Creates a new Header instance using the specified properties. + * @param [properties] Properties to set + * @returns Header instance + */ + public static create(properties?: google.cloud.websecurityscanner.v1beta.VulnerableHeaders.IHeader): google.cloud.websecurityscanner.v1beta.VulnerableHeaders.Header; + + /** + * Encodes the specified Header message. Does not implicitly {@link google.cloud.websecurityscanner.v1beta.VulnerableHeaders.Header.verify|verify} messages. + * @param message Header message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.websecurityscanner.v1beta.VulnerableHeaders.IHeader, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Header message, length delimited. Does not implicitly {@link google.cloud.websecurityscanner.v1beta.VulnerableHeaders.Header.verify|verify} messages. + * @param message Header message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.websecurityscanner.v1beta.VulnerableHeaders.IHeader, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Header message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Header + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.websecurityscanner.v1beta.VulnerableHeaders.Header; + + /** + * Decodes a Header message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Header + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.websecurityscanner.v1beta.VulnerableHeaders.Header; + + /** + * Verifies a Header message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Header message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Header + */ + public static fromObject(object: { [k: string]: any }): google.cloud.websecurityscanner.v1beta.VulnerableHeaders.Header; + + /** + * Creates a plain object from a Header message. Also converts values to other types if specified. + * @param message Header + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.websecurityscanner.v1beta.VulnerableHeaders.Header, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Header to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Header + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Properties of a Xss. */ + interface IXss { + + /** Xss stackTraces */ + stackTraces?: (string[]|null); + + /** Xss errorMessage */ + errorMessage?: (string|null); + } + + /** Represents a Xss. */ + class Xss implements IXss { + + /** + * Constructs a new Xss. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.websecurityscanner.v1beta.IXss); + + /** Xss stackTraces. */ + public stackTraces: string[]; + + /** Xss errorMessage. */ + public errorMessage: string; + + /** + * Creates a new Xss instance using the specified properties. + * @param [properties] Properties to set + * @returns Xss instance + */ + public static create(properties?: google.cloud.websecurityscanner.v1beta.IXss): google.cloud.websecurityscanner.v1beta.Xss; + + /** + * Encodes the specified Xss message. Does not implicitly {@link google.cloud.websecurityscanner.v1beta.Xss.verify|verify} messages. + * @param message Xss message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.websecurityscanner.v1beta.IXss, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Xss message, length delimited. Does not implicitly {@link google.cloud.websecurityscanner.v1beta.Xss.verify|verify} messages. + * @param message Xss message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.websecurityscanner.v1beta.IXss, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Xss message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Xss + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.websecurityscanner.v1beta.Xss; + + /** + * Decodes a Xss message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Xss + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.websecurityscanner.v1beta.Xss; + + /** + * Verifies a Xss message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Xss message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Xss + */ + public static fromObject(object: { [k: string]: any }): google.cloud.websecurityscanner.v1beta.Xss; + + /** + * Creates a plain object from a Xss message. Also converts values to other types if specified. + * @param message Xss + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.websecurityscanner.v1beta.Xss, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Xss to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Xss + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a FindingTypeStats. */ + interface IFindingTypeStats { + + /** FindingTypeStats findingType */ + findingType?: (string|null); + + /** FindingTypeStats findingCount */ + findingCount?: (number|null); + } + + /** Represents a FindingTypeStats. */ + class FindingTypeStats implements IFindingTypeStats { + + /** + * Constructs a new FindingTypeStats. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.websecurityscanner.v1beta.IFindingTypeStats); + + /** FindingTypeStats findingType. */ + public findingType: string; + + /** FindingTypeStats findingCount. */ + public findingCount: number; + + /** + * Creates a new FindingTypeStats instance using the specified properties. + * @param [properties] Properties to set + * @returns FindingTypeStats instance + */ + public static create(properties?: google.cloud.websecurityscanner.v1beta.IFindingTypeStats): google.cloud.websecurityscanner.v1beta.FindingTypeStats; + + /** + * Encodes the specified FindingTypeStats message. Does not implicitly {@link google.cloud.websecurityscanner.v1beta.FindingTypeStats.verify|verify} messages. + * @param message FindingTypeStats message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.websecurityscanner.v1beta.IFindingTypeStats, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified FindingTypeStats message, length delimited. Does not implicitly {@link google.cloud.websecurityscanner.v1beta.FindingTypeStats.verify|verify} messages. + * @param message FindingTypeStats message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.websecurityscanner.v1beta.IFindingTypeStats, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FindingTypeStats message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns FindingTypeStats + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.websecurityscanner.v1beta.FindingTypeStats; + + /** + * Decodes a FindingTypeStats message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns FindingTypeStats + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.websecurityscanner.v1beta.FindingTypeStats; + + /** + * Verifies a FindingTypeStats message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a FindingTypeStats message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns FindingTypeStats + */ + public static fromObject(object: { [k: string]: any }): google.cloud.websecurityscanner.v1beta.FindingTypeStats; + + /** + * Creates a plain object from a FindingTypeStats message. Also converts values to other types if specified. + * @param message FindingTypeStats + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.websecurityscanner.v1beta.FindingTypeStats, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this FindingTypeStats to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for FindingTypeStats + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ScanConfig. */ + interface IScanConfig { + + /** ScanConfig name */ + name?: (string|null); + + /** ScanConfig displayName */ + displayName?: (string|null); + + /** ScanConfig maxQps */ + maxQps?: (number|null); + + /** ScanConfig startingUrls */ + startingUrls?: (string[]|null); + + /** ScanConfig authentication */ + authentication?: (google.cloud.websecurityscanner.v1beta.ScanConfig.IAuthentication|null); + + /** ScanConfig userAgent */ + userAgent?: (google.cloud.websecurityscanner.v1beta.ScanConfig.UserAgent|keyof typeof google.cloud.websecurityscanner.v1beta.ScanConfig.UserAgent|null); + + /** ScanConfig blacklistPatterns */ + blacklistPatterns?: (string[]|null); + + /** ScanConfig schedule */ + schedule?: (google.cloud.websecurityscanner.v1beta.ScanConfig.ISchedule|null); + + /** ScanConfig targetPlatforms */ + targetPlatforms?: (google.cloud.websecurityscanner.v1beta.ScanConfig.TargetPlatform[]|null); + + /** ScanConfig exportToSecurityCommandCenter */ + exportToSecurityCommandCenter?: (google.cloud.websecurityscanner.v1beta.ScanConfig.ExportToSecurityCommandCenter|keyof typeof google.cloud.websecurityscanner.v1beta.ScanConfig.ExportToSecurityCommandCenter|null); + + /** ScanConfig latestRun */ + latestRun?: (google.cloud.websecurityscanner.v1beta.IScanRun|null); + + /** ScanConfig riskLevel */ + riskLevel?: (google.cloud.websecurityscanner.v1beta.ScanConfig.RiskLevel|keyof typeof google.cloud.websecurityscanner.v1beta.ScanConfig.RiskLevel|null); + } + + /** Represents a ScanConfig. */ + class ScanConfig implements IScanConfig { + + /** + * Constructs a new ScanConfig. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.websecurityscanner.v1beta.IScanConfig); + + /** ScanConfig name. */ + public name: string; + + /** ScanConfig displayName. */ + public displayName: string; + + /** ScanConfig maxQps. */ + public maxQps: number; + + /** ScanConfig startingUrls. */ + public startingUrls: string[]; + + /** ScanConfig authentication. */ + public authentication?: (google.cloud.websecurityscanner.v1beta.ScanConfig.IAuthentication|null); + + /** ScanConfig userAgent. */ + public userAgent: (google.cloud.websecurityscanner.v1beta.ScanConfig.UserAgent|keyof typeof google.cloud.websecurityscanner.v1beta.ScanConfig.UserAgent); + + /** ScanConfig blacklistPatterns. */ + public blacklistPatterns: string[]; + + /** ScanConfig schedule. */ + public schedule?: (google.cloud.websecurityscanner.v1beta.ScanConfig.ISchedule|null); + + /** ScanConfig targetPlatforms. */ + public targetPlatforms: google.cloud.websecurityscanner.v1beta.ScanConfig.TargetPlatform[]; + + /** ScanConfig exportToSecurityCommandCenter. */ + public exportToSecurityCommandCenter: (google.cloud.websecurityscanner.v1beta.ScanConfig.ExportToSecurityCommandCenter|keyof typeof google.cloud.websecurityscanner.v1beta.ScanConfig.ExportToSecurityCommandCenter); + + /** ScanConfig latestRun. */ + public latestRun?: (google.cloud.websecurityscanner.v1beta.IScanRun|null); + + /** ScanConfig riskLevel. */ + public riskLevel: (google.cloud.websecurityscanner.v1beta.ScanConfig.RiskLevel|keyof typeof google.cloud.websecurityscanner.v1beta.ScanConfig.RiskLevel); + + /** + * Creates a new ScanConfig instance using the specified properties. + * @param [properties] Properties to set + * @returns ScanConfig instance + */ + public static create(properties?: google.cloud.websecurityscanner.v1beta.IScanConfig): google.cloud.websecurityscanner.v1beta.ScanConfig; + + /** + * Encodes the specified ScanConfig message. Does not implicitly {@link google.cloud.websecurityscanner.v1beta.ScanConfig.verify|verify} messages. + * @param message ScanConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.websecurityscanner.v1beta.IScanConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ScanConfig message, length delimited. Does not implicitly {@link google.cloud.websecurityscanner.v1beta.ScanConfig.verify|verify} messages. + * @param message ScanConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.websecurityscanner.v1beta.IScanConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ScanConfig message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ScanConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.websecurityscanner.v1beta.ScanConfig; + + /** + * Decodes a ScanConfig message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ScanConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.websecurityscanner.v1beta.ScanConfig; + + /** + * Verifies a ScanConfig message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ScanConfig message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ScanConfig + */ + public static fromObject(object: { [k: string]: any }): google.cloud.websecurityscanner.v1beta.ScanConfig; + + /** + * Creates a plain object from a ScanConfig message. Also converts values to other types if specified. + * @param message ScanConfig + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.websecurityscanner.v1beta.ScanConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ScanConfig to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ScanConfig + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace ScanConfig { + + /** Properties of an Authentication. */ + interface IAuthentication { + + /** Authentication googleAccount */ + googleAccount?: (google.cloud.websecurityscanner.v1beta.ScanConfig.Authentication.IGoogleAccount|null); + + /** Authentication customAccount */ + customAccount?: (google.cloud.websecurityscanner.v1beta.ScanConfig.Authentication.ICustomAccount|null); + } + + /** Represents an Authentication. */ + class Authentication implements IAuthentication { + + /** + * Constructs a new Authentication. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.websecurityscanner.v1beta.ScanConfig.IAuthentication); + + /** Authentication googleAccount. */ + public googleAccount?: (google.cloud.websecurityscanner.v1beta.ScanConfig.Authentication.IGoogleAccount|null); + + /** Authentication customAccount. */ + public customAccount?: (google.cloud.websecurityscanner.v1beta.ScanConfig.Authentication.ICustomAccount|null); + + /** Authentication authentication. */ + public authentication?: ("googleAccount"|"customAccount"); + + /** + * Creates a new Authentication instance using the specified properties. + * @param [properties] Properties to set + * @returns Authentication instance + */ + public static create(properties?: google.cloud.websecurityscanner.v1beta.ScanConfig.IAuthentication): google.cloud.websecurityscanner.v1beta.ScanConfig.Authentication; + + /** + * Encodes the specified Authentication message. Does not implicitly {@link google.cloud.websecurityscanner.v1beta.ScanConfig.Authentication.verify|verify} messages. + * @param message Authentication message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.websecurityscanner.v1beta.ScanConfig.IAuthentication, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Authentication message, length delimited. Does not implicitly {@link google.cloud.websecurityscanner.v1beta.ScanConfig.Authentication.verify|verify} messages. + * @param message Authentication message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.websecurityscanner.v1beta.ScanConfig.IAuthentication, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an Authentication message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Authentication + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.websecurityscanner.v1beta.ScanConfig.Authentication; + + /** + * Decodes an Authentication message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Authentication + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.websecurityscanner.v1beta.ScanConfig.Authentication; + + /** + * Verifies an Authentication message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an Authentication message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Authentication + */ + public static fromObject(object: { [k: string]: any }): google.cloud.websecurityscanner.v1beta.ScanConfig.Authentication; + + /** + * Creates a plain object from an Authentication message. Also converts values to other types if specified. + * @param message Authentication + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.websecurityscanner.v1beta.ScanConfig.Authentication, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Authentication to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Authentication + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace Authentication { + + /** Properties of a GoogleAccount. */ + interface IGoogleAccount { + + /** GoogleAccount username */ + username?: (string|null); + + /** GoogleAccount password */ + password?: (string|null); + } + + /** Represents a GoogleAccount. */ + class GoogleAccount implements IGoogleAccount { + + /** + * Constructs a new GoogleAccount. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.websecurityscanner.v1beta.ScanConfig.Authentication.IGoogleAccount); + + /** GoogleAccount username. */ + public username: string; + + /** GoogleAccount password. */ + public password: string; + + /** + * Creates a new GoogleAccount instance using the specified properties. + * @param [properties] Properties to set + * @returns GoogleAccount instance + */ + public static create(properties?: google.cloud.websecurityscanner.v1beta.ScanConfig.Authentication.IGoogleAccount): google.cloud.websecurityscanner.v1beta.ScanConfig.Authentication.GoogleAccount; + + /** + * Encodes the specified GoogleAccount message. Does not implicitly {@link google.cloud.websecurityscanner.v1beta.ScanConfig.Authentication.GoogleAccount.verify|verify} messages. + * @param message GoogleAccount message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.websecurityscanner.v1beta.ScanConfig.Authentication.IGoogleAccount, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GoogleAccount message, length delimited. Does not implicitly {@link google.cloud.websecurityscanner.v1beta.ScanConfig.Authentication.GoogleAccount.verify|verify} messages. + * @param message GoogleAccount message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.websecurityscanner.v1beta.ScanConfig.Authentication.IGoogleAccount, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GoogleAccount message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GoogleAccount + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.websecurityscanner.v1beta.ScanConfig.Authentication.GoogleAccount; + + /** + * Decodes a GoogleAccount message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GoogleAccount + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.websecurityscanner.v1beta.ScanConfig.Authentication.GoogleAccount; + + /** + * Verifies a GoogleAccount message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GoogleAccount message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GoogleAccount + */ + public static fromObject(object: { [k: string]: any }): google.cloud.websecurityscanner.v1beta.ScanConfig.Authentication.GoogleAccount; + + /** + * Creates a plain object from a GoogleAccount message. Also converts values to other types if specified. + * @param message GoogleAccount + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.websecurityscanner.v1beta.ScanConfig.Authentication.GoogleAccount, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GoogleAccount to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GoogleAccount + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a CustomAccount. */ + interface ICustomAccount { + + /** CustomAccount username */ + username?: (string|null); + + /** CustomAccount password */ + password?: (string|null); + + /** CustomAccount loginUrl */ + loginUrl?: (string|null); + } + + /** Represents a CustomAccount. */ + class CustomAccount implements ICustomAccount { + + /** + * Constructs a new CustomAccount. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.websecurityscanner.v1beta.ScanConfig.Authentication.ICustomAccount); + + /** CustomAccount username. */ + public username: string; + + /** CustomAccount password. */ + public password: string; + + /** CustomAccount loginUrl. */ + public loginUrl: string; + + /** + * Creates a new CustomAccount instance using the specified properties. + * @param [properties] Properties to set + * @returns CustomAccount instance + */ + public static create(properties?: google.cloud.websecurityscanner.v1beta.ScanConfig.Authentication.ICustomAccount): google.cloud.websecurityscanner.v1beta.ScanConfig.Authentication.CustomAccount; + + /** + * Encodes the specified CustomAccount message. Does not implicitly {@link google.cloud.websecurityscanner.v1beta.ScanConfig.Authentication.CustomAccount.verify|verify} messages. + * @param message CustomAccount message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.websecurityscanner.v1beta.ScanConfig.Authentication.ICustomAccount, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CustomAccount message, length delimited. Does not implicitly {@link google.cloud.websecurityscanner.v1beta.ScanConfig.Authentication.CustomAccount.verify|verify} messages. + * @param message CustomAccount message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.websecurityscanner.v1beta.ScanConfig.Authentication.ICustomAccount, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CustomAccount message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CustomAccount + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.websecurityscanner.v1beta.ScanConfig.Authentication.CustomAccount; + + /** + * Decodes a CustomAccount message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CustomAccount + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.websecurityscanner.v1beta.ScanConfig.Authentication.CustomAccount; + + /** + * Verifies a CustomAccount message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a CustomAccount message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CustomAccount + */ + public static fromObject(object: { [k: string]: any }): google.cloud.websecurityscanner.v1beta.ScanConfig.Authentication.CustomAccount; + + /** + * Creates a plain object from a CustomAccount message. Also converts values to other types if specified. + * @param message CustomAccount + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.websecurityscanner.v1beta.ScanConfig.Authentication.CustomAccount, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CustomAccount to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CustomAccount + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Properties of a Schedule. */ + interface ISchedule { + + /** Schedule scheduleTime */ + scheduleTime?: (google.protobuf.ITimestamp|null); + + /** Schedule intervalDurationDays */ + intervalDurationDays?: (number|null); + } + + /** Represents a Schedule. */ + class Schedule implements ISchedule { + + /** + * Constructs a new Schedule. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.websecurityscanner.v1beta.ScanConfig.ISchedule); + + /** Schedule scheduleTime. */ + public scheduleTime?: (google.protobuf.ITimestamp|null); + + /** Schedule intervalDurationDays. */ + public intervalDurationDays: number; + + /** + * Creates a new Schedule instance using the specified properties. + * @param [properties] Properties to set + * @returns Schedule instance + */ + public static create(properties?: google.cloud.websecurityscanner.v1beta.ScanConfig.ISchedule): google.cloud.websecurityscanner.v1beta.ScanConfig.Schedule; + + /** + * Encodes the specified Schedule message. Does not implicitly {@link google.cloud.websecurityscanner.v1beta.ScanConfig.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.websecurityscanner.v1beta.ScanConfig.ISchedule, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Schedule message, length delimited. Does not implicitly {@link google.cloud.websecurityscanner.v1beta.ScanConfig.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.websecurityscanner.v1beta.ScanConfig.ISchedule, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * 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.websecurityscanner.v1beta.ScanConfig.Schedule; + + /** + * 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.websecurityscanner.v1beta.ScanConfig.Schedule; + + /** + * 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 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.websecurityscanner.v1beta.ScanConfig.Schedule; + + /** + * 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.websecurityscanner.v1beta.ScanConfig.Schedule, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Schedule to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * 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; + } + + /** UserAgent enum. */ + enum UserAgent { + USER_AGENT_UNSPECIFIED = 0, + CHROME_LINUX = 1, + CHROME_ANDROID = 2, + SAFARI_IPHONE = 3 + } + + /** TargetPlatform enum. */ + enum TargetPlatform { + TARGET_PLATFORM_UNSPECIFIED = 0, + APP_ENGINE = 1, + COMPUTE = 2 + } + + /** RiskLevel enum. */ + enum RiskLevel { + RISK_LEVEL_UNSPECIFIED = 0, + NORMAL = 1, + LOW = 2 + } + + /** ExportToSecurityCommandCenter enum. */ + enum ExportToSecurityCommandCenter { + EXPORT_TO_SECURITY_COMMAND_CENTER_UNSPECIFIED = 0, + ENABLED = 1, + DISABLED = 2 + } + } + + /** Properties of a ScanRun. */ + interface IScanRun { + + /** ScanRun name */ + name?: (string|null); + + /** ScanRun executionState */ + executionState?: (google.cloud.websecurityscanner.v1beta.ScanRun.ExecutionState|keyof typeof google.cloud.websecurityscanner.v1beta.ScanRun.ExecutionState|null); + + /** ScanRun resultState */ + resultState?: (google.cloud.websecurityscanner.v1beta.ScanRun.ResultState|keyof typeof google.cloud.websecurityscanner.v1beta.ScanRun.ResultState|null); + + /** ScanRun startTime */ + startTime?: (google.protobuf.ITimestamp|null); + + /** ScanRun endTime */ + endTime?: (google.protobuf.ITimestamp|null); + + /** ScanRun urlsCrawledCount */ + urlsCrawledCount?: (number|Long|string|null); + + /** ScanRun urlsTestedCount */ + urlsTestedCount?: (number|Long|string|null); + + /** ScanRun hasVulnerabilities */ + hasVulnerabilities?: (boolean|null); + + /** ScanRun progressPercent */ + progressPercent?: (number|null); + + /** ScanRun errorTrace */ + errorTrace?: (google.cloud.websecurityscanner.v1beta.IScanRunErrorTrace|null); + + /** ScanRun warningTraces */ + warningTraces?: (google.cloud.websecurityscanner.v1beta.IScanRunWarningTrace[]|null); + } + + /** Represents a ScanRun. */ + class ScanRun implements IScanRun { + + /** + * Constructs a new ScanRun. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.websecurityscanner.v1beta.IScanRun); + + /** ScanRun name. */ + public name: string; + + /** ScanRun executionState. */ + public executionState: (google.cloud.websecurityscanner.v1beta.ScanRun.ExecutionState|keyof typeof google.cloud.websecurityscanner.v1beta.ScanRun.ExecutionState); + + /** ScanRun resultState. */ + public resultState: (google.cloud.websecurityscanner.v1beta.ScanRun.ResultState|keyof typeof google.cloud.websecurityscanner.v1beta.ScanRun.ResultState); + + /** ScanRun startTime. */ + public startTime?: (google.protobuf.ITimestamp|null); + + /** ScanRun endTime. */ + public endTime?: (google.protobuf.ITimestamp|null); + + /** ScanRun urlsCrawledCount. */ + public urlsCrawledCount: (number|Long|string); + + /** ScanRun urlsTestedCount. */ + public urlsTestedCount: (number|Long|string); + + /** ScanRun hasVulnerabilities. */ + public hasVulnerabilities: boolean; + + /** ScanRun progressPercent. */ + public progressPercent: number; + + /** ScanRun errorTrace. */ + public errorTrace?: (google.cloud.websecurityscanner.v1beta.IScanRunErrorTrace|null); + + /** ScanRun warningTraces. */ + public warningTraces: google.cloud.websecurityscanner.v1beta.IScanRunWarningTrace[]; + + /** + * Creates a new ScanRun instance using the specified properties. + * @param [properties] Properties to set + * @returns ScanRun instance + */ + public static create(properties?: google.cloud.websecurityscanner.v1beta.IScanRun): google.cloud.websecurityscanner.v1beta.ScanRun; + + /** + * Encodes the specified ScanRun message. Does not implicitly {@link google.cloud.websecurityscanner.v1beta.ScanRun.verify|verify} messages. + * @param message ScanRun message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.websecurityscanner.v1beta.IScanRun, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ScanRun message, length delimited. Does not implicitly {@link google.cloud.websecurityscanner.v1beta.ScanRun.verify|verify} messages. + * @param message ScanRun message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.websecurityscanner.v1beta.IScanRun, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ScanRun message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ScanRun + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.websecurityscanner.v1beta.ScanRun; + + /** + * Decodes a ScanRun message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ScanRun + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.websecurityscanner.v1beta.ScanRun; + + /** + * Verifies a ScanRun message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ScanRun message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ScanRun + */ + public static fromObject(object: { [k: string]: any }): google.cloud.websecurityscanner.v1beta.ScanRun; + + /** + * Creates a plain object from a ScanRun message. Also converts values to other types if specified. + * @param message ScanRun + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.websecurityscanner.v1beta.ScanRun, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ScanRun to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ScanRun + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace ScanRun { + + /** ExecutionState enum. */ + enum ExecutionState { + EXECUTION_STATE_UNSPECIFIED = 0, + QUEUED = 1, + SCANNING = 2, + FINISHED = 3 + } + + /** ResultState enum. */ + enum ResultState { + RESULT_STATE_UNSPECIFIED = 0, + SUCCESS = 1, + ERROR = 2, + KILLED = 3 + } + } + + /** Properties of a ScanRunErrorTrace. */ + interface IScanRunErrorTrace { + + /** ScanRunErrorTrace code */ + code?: (google.cloud.websecurityscanner.v1beta.ScanRunErrorTrace.Code|keyof typeof google.cloud.websecurityscanner.v1beta.ScanRunErrorTrace.Code|null); + + /** ScanRunErrorTrace scanConfigError */ + scanConfigError?: (google.cloud.websecurityscanner.v1beta.IScanConfigError|null); + + /** ScanRunErrorTrace mostCommonHttpErrorCode */ + mostCommonHttpErrorCode?: (number|null); + } + + /** Represents a ScanRunErrorTrace. */ + class ScanRunErrorTrace implements IScanRunErrorTrace { + + /** + * Constructs a new ScanRunErrorTrace. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.websecurityscanner.v1beta.IScanRunErrorTrace); + + /** ScanRunErrorTrace code. */ + public code: (google.cloud.websecurityscanner.v1beta.ScanRunErrorTrace.Code|keyof typeof google.cloud.websecurityscanner.v1beta.ScanRunErrorTrace.Code); + + /** ScanRunErrorTrace scanConfigError. */ + public scanConfigError?: (google.cloud.websecurityscanner.v1beta.IScanConfigError|null); + + /** ScanRunErrorTrace mostCommonHttpErrorCode. */ + public mostCommonHttpErrorCode: number; + + /** + * Creates a new ScanRunErrorTrace instance using the specified properties. + * @param [properties] Properties to set + * @returns ScanRunErrorTrace instance + */ + public static create(properties?: google.cloud.websecurityscanner.v1beta.IScanRunErrorTrace): google.cloud.websecurityscanner.v1beta.ScanRunErrorTrace; + + /** + * Encodes the specified ScanRunErrorTrace message. Does not implicitly {@link google.cloud.websecurityscanner.v1beta.ScanRunErrorTrace.verify|verify} messages. + * @param message ScanRunErrorTrace message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.websecurityscanner.v1beta.IScanRunErrorTrace, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ScanRunErrorTrace message, length delimited. Does not implicitly {@link google.cloud.websecurityscanner.v1beta.ScanRunErrorTrace.verify|verify} messages. + * @param message ScanRunErrorTrace message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.websecurityscanner.v1beta.IScanRunErrorTrace, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ScanRunErrorTrace message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ScanRunErrorTrace + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.websecurityscanner.v1beta.ScanRunErrorTrace; + + /** + * Decodes a ScanRunErrorTrace message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ScanRunErrorTrace + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.websecurityscanner.v1beta.ScanRunErrorTrace; + + /** + * Verifies a ScanRunErrorTrace message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ScanRunErrorTrace message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ScanRunErrorTrace + */ + public static fromObject(object: { [k: string]: any }): google.cloud.websecurityscanner.v1beta.ScanRunErrorTrace; + + /** + * Creates a plain object from a ScanRunErrorTrace message. Also converts values to other types if specified. + * @param message ScanRunErrorTrace + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.websecurityscanner.v1beta.ScanRunErrorTrace, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ScanRunErrorTrace to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ScanRunErrorTrace + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace ScanRunErrorTrace { + + /** Code enum. */ + enum Code { + CODE_UNSPECIFIED = 0, + INTERNAL_ERROR = 1, + SCAN_CONFIG_ISSUE = 2, + AUTHENTICATION_CONFIG_ISSUE = 3, + TIMED_OUT_WHILE_SCANNING = 4, + TOO_MANY_REDIRECTS = 5, + TOO_MANY_HTTP_ERRORS = 6 + } + } + + /** Properties of a ScanConfigError. */ + interface IScanConfigError { + + /** ScanConfigError code */ + code?: (google.cloud.websecurityscanner.v1beta.ScanConfigError.Code|keyof typeof google.cloud.websecurityscanner.v1beta.ScanConfigError.Code|null); + + /** ScanConfigError fieldName */ + fieldName?: (string|null); + } + + /** Represents a ScanConfigError. */ + class ScanConfigError implements IScanConfigError { + + /** + * Constructs a new ScanConfigError. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.websecurityscanner.v1beta.IScanConfigError); + + /** ScanConfigError code. */ + public code: (google.cloud.websecurityscanner.v1beta.ScanConfigError.Code|keyof typeof google.cloud.websecurityscanner.v1beta.ScanConfigError.Code); + + /** ScanConfigError fieldName. */ + public fieldName: string; + + /** + * Creates a new ScanConfigError instance using the specified properties. + * @param [properties] Properties to set + * @returns ScanConfigError instance + */ + public static create(properties?: google.cloud.websecurityscanner.v1beta.IScanConfigError): google.cloud.websecurityscanner.v1beta.ScanConfigError; + + /** + * Encodes the specified ScanConfigError message. Does not implicitly {@link google.cloud.websecurityscanner.v1beta.ScanConfigError.verify|verify} messages. + * @param message ScanConfigError message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.websecurityscanner.v1beta.IScanConfigError, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ScanConfigError message, length delimited. Does not implicitly {@link google.cloud.websecurityscanner.v1beta.ScanConfigError.verify|verify} messages. + * @param message ScanConfigError message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.websecurityscanner.v1beta.IScanConfigError, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ScanConfigError message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ScanConfigError + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.websecurityscanner.v1beta.ScanConfigError; + + /** + * Decodes a ScanConfigError message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ScanConfigError + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.websecurityscanner.v1beta.ScanConfigError; + + /** + * Verifies a ScanConfigError message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ScanConfigError message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ScanConfigError + */ + public static fromObject(object: { [k: string]: any }): google.cloud.websecurityscanner.v1beta.ScanConfigError; + + /** + * Creates a plain object from a ScanConfigError message. Also converts values to other types if specified. + * @param message ScanConfigError + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.websecurityscanner.v1beta.ScanConfigError, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ScanConfigError to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ScanConfigError + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace ScanConfigError { + + /** Code enum. */ + enum Code { + CODE_UNSPECIFIED = 0, + OK = 0, + INTERNAL_ERROR = 1, + APPENGINE_API_BACKEND_ERROR = 2, + APPENGINE_API_NOT_ACCESSIBLE = 3, + APPENGINE_DEFAULT_HOST_MISSING = 4, + CANNOT_USE_GOOGLE_COM_ACCOUNT = 6, + CANNOT_USE_OWNER_ACCOUNT = 7, + COMPUTE_API_BACKEND_ERROR = 8, + COMPUTE_API_NOT_ACCESSIBLE = 9, + CUSTOM_LOGIN_URL_DOES_NOT_BELONG_TO_CURRENT_PROJECT = 10, + CUSTOM_LOGIN_URL_MALFORMED = 11, + CUSTOM_LOGIN_URL_MAPPED_TO_NON_ROUTABLE_ADDRESS = 12, + CUSTOM_LOGIN_URL_MAPPED_TO_UNRESERVED_ADDRESS = 13, + CUSTOM_LOGIN_URL_HAS_NON_ROUTABLE_IP_ADDRESS = 14, + CUSTOM_LOGIN_URL_HAS_UNRESERVED_IP_ADDRESS = 15, + DUPLICATE_SCAN_NAME = 16, + INVALID_FIELD_VALUE = 18, + FAILED_TO_AUTHENTICATE_TO_TARGET = 19, + FINDING_TYPE_UNSPECIFIED = 20, + FORBIDDEN_TO_SCAN_COMPUTE = 21, + FORBIDDEN_UPDATE_TO_MANAGED_SCAN = 43, + MALFORMED_FILTER = 22, + MALFORMED_RESOURCE_NAME = 23, + PROJECT_INACTIVE = 24, + REQUIRED_FIELD = 25, + RESOURCE_NAME_INCONSISTENT = 26, + SCAN_ALREADY_RUNNING = 27, + SCAN_NOT_RUNNING = 28, + SEED_URL_DOES_NOT_BELONG_TO_CURRENT_PROJECT = 29, + SEED_URL_MALFORMED = 30, + SEED_URL_MAPPED_TO_NON_ROUTABLE_ADDRESS = 31, + SEED_URL_MAPPED_TO_UNRESERVED_ADDRESS = 32, + SEED_URL_HAS_NON_ROUTABLE_IP_ADDRESS = 33, + SEED_URL_HAS_UNRESERVED_IP_ADDRESS = 35, + SERVICE_ACCOUNT_NOT_CONFIGURED = 36, + TOO_MANY_SCANS = 37, + UNABLE_TO_RESOLVE_PROJECT_INFO = 38, + UNSUPPORTED_BLACKLIST_PATTERN_FORMAT = 39, + UNSUPPORTED_FILTER = 40, + UNSUPPORTED_FINDING_TYPE = 41, + UNSUPPORTED_URL_SCHEME = 42 + } + } + + /** Properties of a ScanRunWarningTrace. */ + interface IScanRunWarningTrace { + + /** ScanRunWarningTrace code */ + code?: (google.cloud.websecurityscanner.v1beta.ScanRunWarningTrace.Code|keyof typeof google.cloud.websecurityscanner.v1beta.ScanRunWarningTrace.Code|null); + } + + /** Represents a ScanRunWarningTrace. */ + class ScanRunWarningTrace implements IScanRunWarningTrace { + + /** + * Constructs a new ScanRunWarningTrace. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.websecurityscanner.v1beta.IScanRunWarningTrace); + + /** ScanRunWarningTrace code. */ + public code: (google.cloud.websecurityscanner.v1beta.ScanRunWarningTrace.Code|keyof typeof google.cloud.websecurityscanner.v1beta.ScanRunWarningTrace.Code); + + /** + * Creates a new ScanRunWarningTrace instance using the specified properties. + * @param [properties] Properties to set + * @returns ScanRunWarningTrace instance + */ + public static create(properties?: google.cloud.websecurityscanner.v1beta.IScanRunWarningTrace): google.cloud.websecurityscanner.v1beta.ScanRunWarningTrace; + + /** + * Encodes the specified ScanRunWarningTrace message. Does not implicitly {@link google.cloud.websecurityscanner.v1beta.ScanRunWarningTrace.verify|verify} messages. + * @param message ScanRunWarningTrace message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.websecurityscanner.v1beta.IScanRunWarningTrace, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ScanRunWarningTrace message, length delimited. Does not implicitly {@link google.cloud.websecurityscanner.v1beta.ScanRunWarningTrace.verify|verify} messages. + * @param message ScanRunWarningTrace message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.websecurityscanner.v1beta.IScanRunWarningTrace, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ScanRunWarningTrace message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ScanRunWarningTrace + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.websecurityscanner.v1beta.ScanRunWarningTrace; + + /** + * Decodes a ScanRunWarningTrace message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ScanRunWarningTrace + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.websecurityscanner.v1beta.ScanRunWarningTrace; + + /** + * Verifies a ScanRunWarningTrace message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ScanRunWarningTrace message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ScanRunWarningTrace + */ + public static fromObject(object: { [k: string]: any }): google.cloud.websecurityscanner.v1beta.ScanRunWarningTrace; + + /** + * Creates a plain object from a ScanRunWarningTrace message. Also converts values to other types if specified. + * @param message ScanRunWarningTrace + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.websecurityscanner.v1beta.ScanRunWarningTrace, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ScanRunWarningTrace to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ScanRunWarningTrace + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace ScanRunWarningTrace { + + /** Code enum. */ + enum Code { + CODE_UNSPECIFIED = 0, + INSUFFICIENT_CRAWL_RESULTS = 1, + TOO_MANY_CRAWL_RESULTS = 2, + TOO_MANY_FUZZ_TASKS = 3, + BLOCKED_BY_IAP = 4 + } + } + + /** Represents a WebSecurityScanner */ + class WebSecurityScanner extends $protobuf.rpc.Service { + + /** + * Constructs a new WebSecurityScanner 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 WebSecurityScanner 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): WebSecurityScanner; + + /** + * Calls CreateScanConfig. + * @param request CreateScanConfigRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ScanConfig + */ + public createScanConfig(request: google.cloud.websecurityscanner.v1beta.ICreateScanConfigRequest, callback: google.cloud.websecurityscanner.v1beta.WebSecurityScanner.CreateScanConfigCallback): void; + + /** + * Calls CreateScanConfig. + * @param request CreateScanConfigRequest message or plain object + * @returns Promise + */ + public createScanConfig(request: google.cloud.websecurityscanner.v1beta.ICreateScanConfigRequest): Promise; + + /** + * Calls DeleteScanConfig. + * @param request DeleteScanConfigRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Empty + */ + public deleteScanConfig(request: google.cloud.websecurityscanner.v1beta.IDeleteScanConfigRequest, callback: google.cloud.websecurityscanner.v1beta.WebSecurityScanner.DeleteScanConfigCallback): void; + + /** + * Calls DeleteScanConfig. + * @param request DeleteScanConfigRequest message or plain object + * @returns Promise + */ + public deleteScanConfig(request: google.cloud.websecurityscanner.v1beta.IDeleteScanConfigRequest): Promise; + + /** + * Calls GetScanConfig. + * @param request GetScanConfigRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ScanConfig + */ + public getScanConfig(request: google.cloud.websecurityscanner.v1beta.IGetScanConfigRequest, callback: google.cloud.websecurityscanner.v1beta.WebSecurityScanner.GetScanConfigCallback): void; + + /** + * Calls GetScanConfig. + * @param request GetScanConfigRequest message or plain object + * @returns Promise + */ + public getScanConfig(request: google.cloud.websecurityscanner.v1beta.IGetScanConfigRequest): Promise; + + /** + * Calls ListScanConfigs. + * @param request ListScanConfigsRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ListScanConfigsResponse + */ + public listScanConfigs(request: google.cloud.websecurityscanner.v1beta.IListScanConfigsRequest, callback: google.cloud.websecurityscanner.v1beta.WebSecurityScanner.ListScanConfigsCallback): void; + + /** + * Calls ListScanConfigs. + * @param request ListScanConfigsRequest message or plain object + * @returns Promise + */ + public listScanConfigs(request: google.cloud.websecurityscanner.v1beta.IListScanConfigsRequest): Promise; + + /** + * Calls UpdateScanConfig. + * @param request UpdateScanConfigRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ScanConfig + */ + public updateScanConfig(request: google.cloud.websecurityscanner.v1beta.IUpdateScanConfigRequest, callback: google.cloud.websecurityscanner.v1beta.WebSecurityScanner.UpdateScanConfigCallback): void; + + /** + * Calls UpdateScanConfig. + * @param request UpdateScanConfigRequest message or plain object + * @returns Promise + */ + public updateScanConfig(request: google.cloud.websecurityscanner.v1beta.IUpdateScanConfigRequest): Promise; + + /** + * Calls StartScanRun. + * @param request StartScanRunRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ScanRun + */ + public startScanRun(request: google.cloud.websecurityscanner.v1beta.IStartScanRunRequest, callback: google.cloud.websecurityscanner.v1beta.WebSecurityScanner.StartScanRunCallback): void; + + /** + * Calls StartScanRun. + * @param request StartScanRunRequest message or plain object + * @returns Promise + */ + public startScanRun(request: google.cloud.websecurityscanner.v1beta.IStartScanRunRequest): Promise; + + /** + * Calls GetScanRun. + * @param request GetScanRunRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ScanRun + */ + public getScanRun(request: google.cloud.websecurityscanner.v1beta.IGetScanRunRequest, callback: google.cloud.websecurityscanner.v1beta.WebSecurityScanner.GetScanRunCallback): void; + + /** + * Calls GetScanRun. + * @param request GetScanRunRequest message or plain object + * @returns Promise + */ + public getScanRun(request: google.cloud.websecurityscanner.v1beta.IGetScanRunRequest): Promise; + + /** + * Calls ListScanRuns. + * @param request ListScanRunsRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ListScanRunsResponse + */ + public listScanRuns(request: google.cloud.websecurityscanner.v1beta.IListScanRunsRequest, callback: google.cloud.websecurityscanner.v1beta.WebSecurityScanner.ListScanRunsCallback): void; + + /** + * Calls ListScanRuns. + * @param request ListScanRunsRequest message or plain object + * @returns Promise + */ + public listScanRuns(request: google.cloud.websecurityscanner.v1beta.IListScanRunsRequest): Promise; + + /** + * Calls StopScanRun. + * @param request StopScanRunRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ScanRun + */ + public stopScanRun(request: google.cloud.websecurityscanner.v1beta.IStopScanRunRequest, callback: google.cloud.websecurityscanner.v1beta.WebSecurityScanner.StopScanRunCallback): void; + + /** + * Calls StopScanRun. + * @param request StopScanRunRequest message or plain object + * @returns Promise + */ + public stopScanRun(request: google.cloud.websecurityscanner.v1beta.IStopScanRunRequest): Promise; + + /** + * Calls ListCrawledUrls. + * @param request ListCrawledUrlsRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ListCrawledUrlsResponse + */ + public listCrawledUrls(request: google.cloud.websecurityscanner.v1beta.IListCrawledUrlsRequest, callback: google.cloud.websecurityscanner.v1beta.WebSecurityScanner.ListCrawledUrlsCallback): void; + + /** + * Calls ListCrawledUrls. + * @param request ListCrawledUrlsRequest message or plain object + * @returns Promise + */ + public listCrawledUrls(request: google.cloud.websecurityscanner.v1beta.IListCrawledUrlsRequest): Promise; + + /** + * Calls GetFinding. + * @param request GetFindingRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Finding + */ + public getFinding(request: google.cloud.websecurityscanner.v1beta.IGetFindingRequest, callback: google.cloud.websecurityscanner.v1beta.WebSecurityScanner.GetFindingCallback): void; + + /** + * Calls GetFinding. + * @param request GetFindingRequest message or plain object + * @returns Promise + */ + public getFinding(request: google.cloud.websecurityscanner.v1beta.IGetFindingRequest): Promise; + + /** + * Calls ListFindings. + * @param request ListFindingsRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ListFindingsResponse + */ + public listFindings(request: google.cloud.websecurityscanner.v1beta.IListFindingsRequest, callback: google.cloud.websecurityscanner.v1beta.WebSecurityScanner.ListFindingsCallback): void; + + /** + * Calls ListFindings. + * @param request ListFindingsRequest message or plain object + * @returns Promise + */ + public listFindings(request: google.cloud.websecurityscanner.v1beta.IListFindingsRequest): Promise; + + /** + * Calls ListFindingTypeStats. + * @param request ListFindingTypeStatsRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ListFindingTypeStatsResponse + */ + public listFindingTypeStats(request: google.cloud.websecurityscanner.v1beta.IListFindingTypeStatsRequest, callback: google.cloud.websecurityscanner.v1beta.WebSecurityScanner.ListFindingTypeStatsCallback): void; + + /** + * Calls ListFindingTypeStats. + * @param request ListFindingTypeStatsRequest message or plain object + * @returns Promise + */ + public listFindingTypeStats(request: google.cloud.websecurityscanner.v1beta.IListFindingTypeStatsRequest): Promise; + } + + namespace WebSecurityScanner { + + /** + * Callback as used by {@link google.cloud.websecurityscanner.v1beta.WebSecurityScanner|createScanConfig}. + * @param error Error, if any + * @param [response] ScanConfig + */ + type CreateScanConfigCallback = (error: (Error|null), response?: google.cloud.websecurityscanner.v1beta.ScanConfig) => void; + + /** + * Callback as used by {@link google.cloud.websecurityscanner.v1beta.WebSecurityScanner|deleteScanConfig}. + * @param error Error, if any + * @param [response] Empty + */ + type DeleteScanConfigCallback = (error: (Error|null), response?: google.protobuf.Empty) => void; + + /** + * Callback as used by {@link google.cloud.websecurityscanner.v1beta.WebSecurityScanner|getScanConfig}. + * @param error Error, if any + * @param [response] ScanConfig + */ + type GetScanConfigCallback = (error: (Error|null), response?: google.cloud.websecurityscanner.v1beta.ScanConfig) => void; + + /** + * Callback as used by {@link google.cloud.websecurityscanner.v1beta.WebSecurityScanner|listScanConfigs}. + * @param error Error, if any + * @param [response] ListScanConfigsResponse + */ + type ListScanConfigsCallback = (error: (Error|null), response?: google.cloud.websecurityscanner.v1beta.ListScanConfigsResponse) => void; + + /** + * Callback as used by {@link google.cloud.websecurityscanner.v1beta.WebSecurityScanner|updateScanConfig}. + * @param error Error, if any + * @param [response] ScanConfig + */ + type UpdateScanConfigCallback = (error: (Error|null), response?: google.cloud.websecurityscanner.v1beta.ScanConfig) => void; + + /** + * Callback as used by {@link google.cloud.websecurityscanner.v1beta.WebSecurityScanner|startScanRun}. + * @param error Error, if any + * @param [response] ScanRun + */ + type StartScanRunCallback = (error: (Error|null), response?: google.cloud.websecurityscanner.v1beta.ScanRun) => void; + + /** + * Callback as used by {@link google.cloud.websecurityscanner.v1beta.WebSecurityScanner|getScanRun}. + * @param error Error, if any + * @param [response] ScanRun + */ + type GetScanRunCallback = (error: (Error|null), response?: google.cloud.websecurityscanner.v1beta.ScanRun) => void; + + /** + * Callback as used by {@link google.cloud.websecurityscanner.v1beta.WebSecurityScanner|listScanRuns}. + * @param error Error, if any + * @param [response] ListScanRunsResponse + */ + type ListScanRunsCallback = (error: (Error|null), response?: google.cloud.websecurityscanner.v1beta.ListScanRunsResponse) => void; + + /** + * Callback as used by {@link google.cloud.websecurityscanner.v1beta.WebSecurityScanner|stopScanRun}. + * @param error Error, if any + * @param [response] ScanRun + */ + type StopScanRunCallback = (error: (Error|null), response?: google.cloud.websecurityscanner.v1beta.ScanRun) => void; + + /** + * Callback as used by {@link google.cloud.websecurityscanner.v1beta.WebSecurityScanner|listCrawledUrls}. + * @param error Error, if any + * @param [response] ListCrawledUrlsResponse + */ + type ListCrawledUrlsCallback = (error: (Error|null), response?: google.cloud.websecurityscanner.v1beta.ListCrawledUrlsResponse) => void; + + /** + * Callback as used by {@link google.cloud.websecurityscanner.v1beta.WebSecurityScanner|getFinding}. + * @param error Error, if any + * @param [response] Finding + */ + type GetFindingCallback = (error: (Error|null), response?: google.cloud.websecurityscanner.v1beta.Finding) => void; + + /** + * Callback as used by {@link google.cloud.websecurityscanner.v1beta.WebSecurityScanner|listFindings}. + * @param error Error, if any + * @param [response] ListFindingsResponse + */ + type ListFindingsCallback = (error: (Error|null), response?: google.cloud.websecurityscanner.v1beta.ListFindingsResponse) => void; + + /** + * Callback as used by {@link google.cloud.websecurityscanner.v1beta.WebSecurityScanner|listFindingTypeStats}. + * @param error Error, if any + * @param [response] ListFindingTypeStatsResponse + */ + type ListFindingTypeStatsCallback = (error: (Error|null), response?: google.cloud.websecurityscanner.v1beta.ListFindingTypeStatsResponse) => void; + } + + /** Properties of a CreateScanConfigRequest. */ + interface ICreateScanConfigRequest { + + /** CreateScanConfigRequest parent */ + parent?: (string|null); + + /** CreateScanConfigRequest scanConfig */ + scanConfig?: (google.cloud.websecurityscanner.v1beta.IScanConfig|null); + } + + /** Represents a CreateScanConfigRequest. */ + class CreateScanConfigRequest implements ICreateScanConfigRequest { + + /** + * Constructs a new CreateScanConfigRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.websecurityscanner.v1beta.ICreateScanConfigRequest); + + /** CreateScanConfigRequest parent. */ + public parent: string; + + /** CreateScanConfigRequest scanConfig. */ + public scanConfig?: (google.cloud.websecurityscanner.v1beta.IScanConfig|null); + + /** + * Creates a new CreateScanConfigRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns CreateScanConfigRequest instance + */ + public static create(properties?: google.cloud.websecurityscanner.v1beta.ICreateScanConfigRequest): google.cloud.websecurityscanner.v1beta.CreateScanConfigRequest; + + /** + * Encodes the specified CreateScanConfigRequest message. Does not implicitly {@link google.cloud.websecurityscanner.v1beta.CreateScanConfigRequest.verify|verify} messages. + * @param message CreateScanConfigRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.websecurityscanner.v1beta.ICreateScanConfigRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CreateScanConfigRequest message, length delimited. Does not implicitly {@link google.cloud.websecurityscanner.v1beta.CreateScanConfigRequest.verify|verify} messages. + * @param message CreateScanConfigRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.websecurityscanner.v1beta.ICreateScanConfigRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CreateScanConfigRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CreateScanConfigRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.websecurityscanner.v1beta.CreateScanConfigRequest; + + /** + * Decodes a CreateScanConfigRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CreateScanConfigRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.websecurityscanner.v1beta.CreateScanConfigRequest; + + /** + * Verifies a CreateScanConfigRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a CreateScanConfigRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CreateScanConfigRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.websecurityscanner.v1beta.CreateScanConfigRequest; + + /** + * Creates a plain object from a CreateScanConfigRequest message. Also converts values to other types if specified. + * @param message CreateScanConfigRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.websecurityscanner.v1beta.CreateScanConfigRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CreateScanConfigRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CreateScanConfigRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a DeleteScanConfigRequest. */ + interface IDeleteScanConfigRequest { + + /** DeleteScanConfigRequest name */ + name?: (string|null); + } + + /** Represents a DeleteScanConfigRequest. */ + class DeleteScanConfigRequest implements IDeleteScanConfigRequest { + + /** + * Constructs a new DeleteScanConfigRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.websecurityscanner.v1beta.IDeleteScanConfigRequest); + + /** DeleteScanConfigRequest name. */ + public name: string; + + /** + * Creates a new DeleteScanConfigRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns DeleteScanConfigRequest instance + */ + public static create(properties?: google.cloud.websecurityscanner.v1beta.IDeleteScanConfigRequest): google.cloud.websecurityscanner.v1beta.DeleteScanConfigRequest; + + /** + * Encodes the specified DeleteScanConfigRequest message. Does not implicitly {@link google.cloud.websecurityscanner.v1beta.DeleteScanConfigRequest.verify|verify} messages. + * @param message DeleteScanConfigRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.websecurityscanner.v1beta.IDeleteScanConfigRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DeleteScanConfigRequest message, length delimited. Does not implicitly {@link google.cloud.websecurityscanner.v1beta.DeleteScanConfigRequest.verify|verify} messages. + * @param message DeleteScanConfigRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.websecurityscanner.v1beta.IDeleteScanConfigRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DeleteScanConfigRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DeleteScanConfigRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.websecurityscanner.v1beta.DeleteScanConfigRequest; + + /** + * Decodes a DeleteScanConfigRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DeleteScanConfigRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.websecurityscanner.v1beta.DeleteScanConfigRequest; + + /** + * Verifies a DeleteScanConfigRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a DeleteScanConfigRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DeleteScanConfigRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.websecurityscanner.v1beta.DeleteScanConfigRequest; + + /** + * Creates a plain object from a DeleteScanConfigRequest message. Also converts values to other types if specified. + * @param message DeleteScanConfigRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.websecurityscanner.v1beta.DeleteScanConfigRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DeleteScanConfigRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DeleteScanConfigRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a GetScanConfigRequest. */ + interface IGetScanConfigRequest { + + /** GetScanConfigRequest name */ + name?: (string|null); + } + + /** Represents a GetScanConfigRequest. */ + class GetScanConfigRequest implements IGetScanConfigRequest { + + /** + * Constructs a new GetScanConfigRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.websecurityscanner.v1beta.IGetScanConfigRequest); + + /** GetScanConfigRequest name. */ + public name: string; + + /** + * Creates a new GetScanConfigRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns GetScanConfigRequest instance + */ + public static create(properties?: google.cloud.websecurityscanner.v1beta.IGetScanConfigRequest): google.cloud.websecurityscanner.v1beta.GetScanConfigRequest; + + /** + * Encodes the specified GetScanConfigRequest message. Does not implicitly {@link google.cloud.websecurityscanner.v1beta.GetScanConfigRequest.verify|verify} messages. + * @param message GetScanConfigRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.websecurityscanner.v1beta.IGetScanConfigRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GetScanConfigRequest message, length delimited. Does not implicitly {@link google.cloud.websecurityscanner.v1beta.GetScanConfigRequest.verify|verify} messages. + * @param message GetScanConfigRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.websecurityscanner.v1beta.IGetScanConfigRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GetScanConfigRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GetScanConfigRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.websecurityscanner.v1beta.GetScanConfigRequest; + + /** + * Decodes a GetScanConfigRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GetScanConfigRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.websecurityscanner.v1beta.GetScanConfigRequest; + + /** + * Verifies a GetScanConfigRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GetScanConfigRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GetScanConfigRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.websecurityscanner.v1beta.GetScanConfigRequest; + + /** + * Creates a plain object from a GetScanConfigRequest message. Also converts values to other types if specified. + * @param message GetScanConfigRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.websecurityscanner.v1beta.GetScanConfigRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GetScanConfigRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GetScanConfigRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListScanConfigsRequest. */ + interface IListScanConfigsRequest { + + /** ListScanConfigsRequest parent */ + parent?: (string|null); + + /** ListScanConfigsRequest pageToken */ + pageToken?: (string|null); + + /** ListScanConfigsRequest pageSize */ + pageSize?: (number|null); + } + + /** Represents a ListScanConfigsRequest. */ + class ListScanConfigsRequest implements IListScanConfigsRequest { + + /** + * Constructs a new ListScanConfigsRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.websecurityscanner.v1beta.IListScanConfigsRequest); + + /** ListScanConfigsRequest parent. */ + public parent: string; + + /** ListScanConfigsRequest pageToken. */ + public pageToken: string; + + /** ListScanConfigsRequest pageSize. */ + public pageSize: number; + + /** + * Creates a new ListScanConfigsRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ListScanConfigsRequest instance + */ + public static create(properties?: google.cloud.websecurityscanner.v1beta.IListScanConfigsRequest): google.cloud.websecurityscanner.v1beta.ListScanConfigsRequest; + + /** + * Encodes the specified ListScanConfigsRequest message. Does not implicitly {@link google.cloud.websecurityscanner.v1beta.ListScanConfigsRequest.verify|verify} messages. + * @param message ListScanConfigsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.websecurityscanner.v1beta.IListScanConfigsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListScanConfigsRequest message, length delimited. Does not implicitly {@link google.cloud.websecurityscanner.v1beta.ListScanConfigsRequest.verify|verify} messages. + * @param message ListScanConfigsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.websecurityscanner.v1beta.IListScanConfigsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListScanConfigsRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListScanConfigsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.websecurityscanner.v1beta.ListScanConfigsRequest; + + /** + * Decodes a ListScanConfigsRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListScanConfigsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.websecurityscanner.v1beta.ListScanConfigsRequest; + + /** + * Verifies a ListScanConfigsRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListScanConfigsRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListScanConfigsRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.websecurityscanner.v1beta.ListScanConfigsRequest; + + /** + * Creates a plain object from a ListScanConfigsRequest message. Also converts values to other types if specified. + * @param message ListScanConfigsRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.websecurityscanner.v1beta.ListScanConfigsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListScanConfigsRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListScanConfigsRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an UpdateScanConfigRequest. */ + interface IUpdateScanConfigRequest { + + /** UpdateScanConfigRequest scanConfig */ + scanConfig?: (google.cloud.websecurityscanner.v1beta.IScanConfig|null); + + /** UpdateScanConfigRequest updateMask */ + updateMask?: (google.protobuf.IFieldMask|null); + } + + /** Represents an UpdateScanConfigRequest. */ + class UpdateScanConfigRequest implements IUpdateScanConfigRequest { + + /** + * Constructs a new UpdateScanConfigRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.websecurityscanner.v1beta.IUpdateScanConfigRequest); + + /** UpdateScanConfigRequest scanConfig. */ + public scanConfig?: (google.cloud.websecurityscanner.v1beta.IScanConfig|null); + + /** UpdateScanConfigRequest updateMask. */ + public updateMask?: (google.protobuf.IFieldMask|null); + + /** + * Creates a new UpdateScanConfigRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns UpdateScanConfigRequest instance + */ + public static create(properties?: google.cloud.websecurityscanner.v1beta.IUpdateScanConfigRequest): google.cloud.websecurityscanner.v1beta.UpdateScanConfigRequest; + + /** + * Encodes the specified UpdateScanConfigRequest message. Does not implicitly {@link google.cloud.websecurityscanner.v1beta.UpdateScanConfigRequest.verify|verify} messages. + * @param message UpdateScanConfigRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.websecurityscanner.v1beta.IUpdateScanConfigRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified UpdateScanConfigRequest message, length delimited. Does not implicitly {@link google.cloud.websecurityscanner.v1beta.UpdateScanConfigRequest.verify|verify} messages. + * @param message UpdateScanConfigRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.websecurityscanner.v1beta.IUpdateScanConfigRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an UpdateScanConfigRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns UpdateScanConfigRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.websecurityscanner.v1beta.UpdateScanConfigRequest; + + /** + * Decodes an UpdateScanConfigRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns UpdateScanConfigRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.websecurityscanner.v1beta.UpdateScanConfigRequest; + + /** + * Verifies an UpdateScanConfigRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an UpdateScanConfigRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns UpdateScanConfigRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.websecurityscanner.v1beta.UpdateScanConfigRequest; + + /** + * Creates a plain object from an UpdateScanConfigRequest message. Also converts values to other types if specified. + * @param message UpdateScanConfigRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.websecurityscanner.v1beta.UpdateScanConfigRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this UpdateScanConfigRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for UpdateScanConfigRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListScanConfigsResponse. */ + interface IListScanConfigsResponse { + + /** ListScanConfigsResponse scanConfigs */ + scanConfigs?: (google.cloud.websecurityscanner.v1beta.IScanConfig[]|null); + + /** ListScanConfigsResponse nextPageToken */ + nextPageToken?: (string|null); + } + + /** Represents a ListScanConfigsResponse. */ + class ListScanConfigsResponse implements IListScanConfigsResponse { + + /** + * Constructs a new ListScanConfigsResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.websecurityscanner.v1beta.IListScanConfigsResponse); + + /** ListScanConfigsResponse scanConfigs. */ + public scanConfigs: google.cloud.websecurityscanner.v1beta.IScanConfig[]; + + /** ListScanConfigsResponse nextPageToken. */ + public nextPageToken: string; + + /** + * Creates a new ListScanConfigsResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns ListScanConfigsResponse instance + */ + public static create(properties?: google.cloud.websecurityscanner.v1beta.IListScanConfigsResponse): google.cloud.websecurityscanner.v1beta.ListScanConfigsResponse; + + /** + * Encodes the specified ListScanConfigsResponse message. Does not implicitly {@link google.cloud.websecurityscanner.v1beta.ListScanConfigsResponse.verify|verify} messages. + * @param message ListScanConfigsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.websecurityscanner.v1beta.IListScanConfigsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListScanConfigsResponse message, length delimited. Does not implicitly {@link google.cloud.websecurityscanner.v1beta.ListScanConfigsResponse.verify|verify} messages. + * @param message ListScanConfigsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.websecurityscanner.v1beta.IListScanConfigsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListScanConfigsResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListScanConfigsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.websecurityscanner.v1beta.ListScanConfigsResponse; + + /** + * Decodes a ListScanConfigsResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListScanConfigsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.websecurityscanner.v1beta.ListScanConfigsResponse; + + /** + * Verifies a ListScanConfigsResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListScanConfigsResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListScanConfigsResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.websecurityscanner.v1beta.ListScanConfigsResponse; + + /** + * Creates a plain object from a ListScanConfigsResponse message. Also converts values to other types if specified. + * @param message ListScanConfigsResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.websecurityscanner.v1beta.ListScanConfigsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListScanConfigsResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListScanConfigsResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a StartScanRunRequest. */ + interface IStartScanRunRequest { + + /** StartScanRunRequest name */ + name?: (string|null); + } + + /** Represents a StartScanRunRequest. */ + class StartScanRunRequest implements IStartScanRunRequest { + + /** + * Constructs a new StartScanRunRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.websecurityscanner.v1beta.IStartScanRunRequest); + + /** StartScanRunRequest name. */ + public name: string; + + /** + * Creates a new StartScanRunRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns StartScanRunRequest instance + */ + public static create(properties?: google.cloud.websecurityscanner.v1beta.IStartScanRunRequest): google.cloud.websecurityscanner.v1beta.StartScanRunRequest; + + /** + * Encodes the specified StartScanRunRequest message. Does not implicitly {@link google.cloud.websecurityscanner.v1beta.StartScanRunRequest.verify|verify} messages. + * @param message StartScanRunRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.websecurityscanner.v1beta.IStartScanRunRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified StartScanRunRequest message, length delimited. Does not implicitly {@link google.cloud.websecurityscanner.v1beta.StartScanRunRequest.verify|verify} messages. + * @param message StartScanRunRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.websecurityscanner.v1beta.IStartScanRunRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a StartScanRunRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns StartScanRunRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.websecurityscanner.v1beta.StartScanRunRequest; + + /** + * Decodes a StartScanRunRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns StartScanRunRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.websecurityscanner.v1beta.StartScanRunRequest; + + /** + * Verifies a StartScanRunRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a StartScanRunRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns StartScanRunRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.websecurityscanner.v1beta.StartScanRunRequest; + + /** + * Creates a plain object from a StartScanRunRequest message. Also converts values to other types if specified. + * @param message StartScanRunRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.websecurityscanner.v1beta.StartScanRunRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this StartScanRunRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for StartScanRunRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a GetScanRunRequest. */ + interface IGetScanRunRequest { + + /** GetScanRunRequest name */ + name?: (string|null); + } + + /** Represents a GetScanRunRequest. */ + class GetScanRunRequest implements IGetScanRunRequest { + + /** + * Constructs a new GetScanRunRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.websecurityscanner.v1beta.IGetScanRunRequest); + + /** GetScanRunRequest name. */ + public name: string; + + /** + * Creates a new GetScanRunRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns GetScanRunRequest instance + */ + public static create(properties?: google.cloud.websecurityscanner.v1beta.IGetScanRunRequest): google.cloud.websecurityscanner.v1beta.GetScanRunRequest; + + /** + * Encodes the specified GetScanRunRequest message. Does not implicitly {@link google.cloud.websecurityscanner.v1beta.GetScanRunRequest.verify|verify} messages. + * @param message GetScanRunRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.websecurityscanner.v1beta.IGetScanRunRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GetScanRunRequest message, length delimited. Does not implicitly {@link google.cloud.websecurityscanner.v1beta.GetScanRunRequest.verify|verify} messages. + * @param message GetScanRunRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.websecurityscanner.v1beta.IGetScanRunRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GetScanRunRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GetScanRunRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.websecurityscanner.v1beta.GetScanRunRequest; + + /** + * Decodes a GetScanRunRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GetScanRunRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.websecurityscanner.v1beta.GetScanRunRequest; + + /** + * Verifies a GetScanRunRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GetScanRunRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GetScanRunRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.websecurityscanner.v1beta.GetScanRunRequest; + + /** + * Creates a plain object from a GetScanRunRequest message. Also converts values to other types if specified. + * @param message GetScanRunRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.websecurityscanner.v1beta.GetScanRunRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GetScanRunRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GetScanRunRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListScanRunsRequest. */ + interface IListScanRunsRequest { + + /** ListScanRunsRequest parent */ + parent?: (string|null); + + /** ListScanRunsRequest pageToken */ + pageToken?: (string|null); + + /** ListScanRunsRequest pageSize */ + pageSize?: (number|null); + } + + /** Represents a ListScanRunsRequest. */ + class ListScanRunsRequest implements IListScanRunsRequest { + + /** + * Constructs a new ListScanRunsRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.websecurityscanner.v1beta.IListScanRunsRequest); + + /** ListScanRunsRequest parent. */ + public parent: string; + + /** ListScanRunsRequest pageToken. */ + public pageToken: string; + + /** ListScanRunsRequest pageSize. */ + public pageSize: number; + + /** + * Creates a new ListScanRunsRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ListScanRunsRequest instance + */ + public static create(properties?: google.cloud.websecurityscanner.v1beta.IListScanRunsRequest): google.cloud.websecurityscanner.v1beta.ListScanRunsRequest; + + /** + * Encodes the specified ListScanRunsRequest message. Does not implicitly {@link google.cloud.websecurityscanner.v1beta.ListScanRunsRequest.verify|verify} messages. + * @param message ListScanRunsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.websecurityscanner.v1beta.IListScanRunsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListScanRunsRequest message, length delimited. Does not implicitly {@link google.cloud.websecurityscanner.v1beta.ListScanRunsRequest.verify|verify} messages. + * @param message ListScanRunsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.websecurityscanner.v1beta.IListScanRunsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListScanRunsRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListScanRunsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.websecurityscanner.v1beta.ListScanRunsRequest; + + /** + * Decodes a ListScanRunsRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListScanRunsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.websecurityscanner.v1beta.ListScanRunsRequest; + + /** + * Verifies a ListScanRunsRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListScanRunsRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListScanRunsRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.websecurityscanner.v1beta.ListScanRunsRequest; + + /** + * Creates a plain object from a ListScanRunsRequest message. Also converts values to other types if specified. + * @param message ListScanRunsRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.websecurityscanner.v1beta.ListScanRunsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListScanRunsRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListScanRunsRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListScanRunsResponse. */ + interface IListScanRunsResponse { + + /** ListScanRunsResponse scanRuns */ + scanRuns?: (google.cloud.websecurityscanner.v1beta.IScanRun[]|null); + + /** ListScanRunsResponse nextPageToken */ + nextPageToken?: (string|null); + } + + /** Represents a ListScanRunsResponse. */ + class ListScanRunsResponse implements IListScanRunsResponse { + + /** + * Constructs a new ListScanRunsResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.websecurityscanner.v1beta.IListScanRunsResponse); + + /** ListScanRunsResponse scanRuns. */ + public scanRuns: google.cloud.websecurityscanner.v1beta.IScanRun[]; + + /** ListScanRunsResponse nextPageToken. */ + public nextPageToken: string; + + /** + * Creates a new ListScanRunsResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns ListScanRunsResponse instance + */ + public static create(properties?: google.cloud.websecurityscanner.v1beta.IListScanRunsResponse): google.cloud.websecurityscanner.v1beta.ListScanRunsResponse; + + /** + * Encodes the specified ListScanRunsResponse message. Does not implicitly {@link google.cloud.websecurityscanner.v1beta.ListScanRunsResponse.verify|verify} messages. + * @param message ListScanRunsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.websecurityscanner.v1beta.IListScanRunsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListScanRunsResponse message, length delimited. Does not implicitly {@link google.cloud.websecurityscanner.v1beta.ListScanRunsResponse.verify|verify} messages. + * @param message ListScanRunsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.websecurityscanner.v1beta.IListScanRunsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListScanRunsResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListScanRunsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.websecurityscanner.v1beta.ListScanRunsResponse; + + /** + * Decodes a ListScanRunsResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListScanRunsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.websecurityscanner.v1beta.ListScanRunsResponse; + + /** + * Verifies a ListScanRunsResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListScanRunsResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListScanRunsResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.websecurityscanner.v1beta.ListScanRunsResponse; + + /** + * Creates a plain object from a ListScanRunsResponse message. Also converts values to other types if specified. + * @param message ListScanRunsResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.websecurityscanner.v1beta.ListScanRunsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListScanRunsResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListScanRunsResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a StopScanRunRequest. */ + interface IStopScanRunRequest { + + /** StopScanRunRequest name */ + name?: (string|null); + } + + /** Represents a StopScanRunRequest. */ + class StopScanRunRequest implements IStopScanRunRequest { + + /** + * Constructs a new StopScanRunRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.websecurityscanner.v1beta.IStopScanRunRequest); + + /** StopScanRunRequest name. */ + public name: string; + + /** + * Creates a new StopScanRunRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns StopScanRunRequest instance + */ + public static create(properties?: google.cloud.websecurityscanner.v1beta.IStopScanRunRequest): google.cloud.websecurityscanner.v1beta.StopScanRunRequest; + + /** + * Encodes the specified StopScanRunRequest message. Does not implicitly {@link google.cloud.websecurityscanner.v1beta.StopScanRunRequest.verify|verify} messages. + * @param message StopScanRunRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.websecurityscanner.v1beta.IStopScanRunRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified StopScanRunRequest message, length delimited. Does not implicitly {@link google.cloud.websecurityscanner.v1beta.StopScanRunRequest.verify|verify} messages. + * @param message StopScanRunRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.websecurityscanner.v1beta.IStopScanRunRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a StopScanRunRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns StopScanRunRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.websecurityscanner.v1beta.StopScanRunRequest; + + /** + * Decodes a StopScanRunRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns StopScanRunRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.websecurityscanner.v1beta.StopScanRunRequest; + + /** + * Verifies a StopScanRunRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a StopScanRunRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns StopScanRunRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.websecurityscanner.v1beta.StopScanRunRequest; + + /** + * Creates a plain object from a StopScanRunRequest message. Also converts values to other types if specified. + * @param message StopScanRunRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.websecurityscanner.v1beta.StopScanRunRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this StopScanRunRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for StopScanRunRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListCrawledUrlsRequest. */ + interface IListCrawledUrlsRequest { + + /** ListCrawledUrlsRequest parent */ + parent?: (string|null); + + /** ListCrawledUrlsRequest pageToken */ + pageToken?: (string|null); + + /** ListCrawledUrlsRequest pageSize */ + pageSize?: (number|null); + } + + /** Represents a ListCrawledUrlsRequest. */ + class ListCrawledUrlsRequest implements IListCrawledUrlsRequest { + + /** + * Constructs a new ListCrawledUrlsRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.websecurityscanner.v1beta.IListCrawledUrlsRequest); + + /** ListCrawledUrlsRequest parent. */ + public parent: string; + + /** ListCrawledUrlsRequest pageToken. */ + public pageToken: string; + + /** ListCrawledUrlsRequest pageSize. */ + public pageSize: number; + + /** + * Creates a new ListCrawledUrlsRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ListCrawledUrlsRequest instance + */ + public static create(properties?: google.cloud.websecurityscanner.v1beta.IListCrawledUrlsRequest): google.cloud.websecurityscanner.v1beta.ListCrawledUrlsRequest; + + /** + * Encodes the specified ListCrawledUrlsRequest message. Does not implicitly {@link google.cloud.websecurityscanner.v1beta.ListCrawledUrlsRequest.verify|verify} messages. + * @param message ListCrawledUrlsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.websecurityscanner.v1beta.IListCrawledUrlsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListCrawledUrlsRequest message, length delimited. Does not implicitly {@link google.cloud.websecurityscanner.v1beta.ListCrawledUrlsRequest.verify|verify} messages. + * @param message ListCrawledUrlsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.websecurityscanner.v1beta.IListCrawledUrlsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListCrawledUrlsRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListCrawledUrlsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.websecurityscanner.v1beta.ListCrawledUrlsRequest; + + /** + * Decodes a ListCrawledUrlsRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListCrawledUrlsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.websecurityscanner.v1beta.ListCrawledUrlsRequest; + + /** + * Verifies a ListCrawledUrlsRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListCrawledUrlsRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListCrawledUrlsRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.websecurityscanner.v1beta.ListCrawledUrlsRequest; + + /** + * Creates a plain object from a ListCrawledUrlsRequest message. Also converts values to other types if specified. + * @param message ListCrawledUrlsRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.websecurityscanner.v1beta.ListCrawledUrlsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListCrawledUrlsRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListCrawledUrlsRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListCrawledUrlsResponse. */ + interface IListCrawledUrlsResponse { + + /** ListCrawledUrlsResponse crawledUrls */ + crawledUrls?: (google.cloud.websecurityscanner.v1beta.ICrawledUrl[]|null); + + /** ListCrawledUrlsResponse nextPageToken */ + nextPageToken?: (string|null); + } + + /** Represents a ListCrawledUrlsResponse. */ + class ListCrawledUrlsResponse implements IListCrawledUrlsResponse { + + /** + * Constructs a new ListCrawledUrlsResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.websecurityscanner.v1beta.IListCrawledUrlsResponse); + + /** ListCrawledUrlsResponse crawledUrls. */ + public crawledUrls: google.cloud.websecurityscanner.v1beta.ICrawledUrl[]; + + /** ListCrawledUrlsResponse nextPageToken. */ + public nextPageToken: string; + + /** + * Creates a new ListCrawledUrlsResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns ListCrawledUrlsResponse instance + */ + public static create(properties?: google.cloud.websecurityscanner.v1beta.IListCrawledUrlsResponse): google.cloud.websecurityscanner.v1beta.ListCrawledUrlsResponse; + + /** + * Encodes the specified ListCrawledUrlsResponse message. Does not implicitly {@link google.cloud.websecurityscanner.v1beta.ListCrawledUrlsResponse.verify|verify} messages. + * @param message ListCrawledUrlsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.websecurityscanner.v1beta.IListCrawledUrlsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListCrawledUrlsResponse message, length delimited. Does not implicitly {@link google.cloud.websecurityscanner.v1beta.ListCrawledUrlsResponse.verify|verify} messages. + * @param message ListCrawledUrlsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.websecurityscanner.v1beta.IListCrawledUrlsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListCrawledUrlsResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListCrawledUrlsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.websecurityscanner.v1beta.ListCrawledUrlsResponse; + + /** + * Decodes a ListCrawledUrlsResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListCrawledUrlsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.websecurityscanner.v1beta.ListCrawledUrlsResponse; + + /** + * Verifies a ListCrawledUrlsResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListCrawledUrlsResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListCrawledUrlsResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.websecurityscanner.v1beta.ListCrawledUrlsResponse; + + /** + * Creates a plain object from a ListCrawledUrlsResponse message. Also converts values to other types if specified. + * @param message ListCrawledUrlsResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.websecurityscanner.v1beta.ListCrawledUrlsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListCrawledUrlsResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListCrawledUrlsResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a GetFindingRequest. */ + interface IGetFindingRequest { + + /** GetFindingRequest name */ + name?: (string|null); + } + + /** Represents a GetFindingRequest. */ + class GetFindingRequest implements IGetFindingRequest { + + /** + * Constructs a new GetFindingRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.websecurityscanner.v1beta.IGetFindingRequest); + + /** GetFindingRequest name. */ + public name: string; + + /** + * Creates a new GetFindingRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns GetFindingRequest instance + */ + public static create(properties?: google.cloud.websecurityscanner.v1beta.IGetFindingRequest): google.cloud.websecurityscanner.v1beta.GetFindingRequest; + + /** + * Encodes the specified GetFindingRequest message. Does not implicitly {@link google.cloud.websecurityscanner.v1beta.GetFindingRequest.verify|verify} messages. + * @param message GetFindingRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.websecurityscanner.v1beta.IGetFindingRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GetFindingRequest message, length delimited. Does not implicitly {@link google.cloud.websecurityscanner.v1beta.GetFindingRequest.verify|verify} messages. + * @param message GetFindingRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.websecurityscanner.v1beta.IGetFindingRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GetFindingRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GetFindingRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.websecurityscanner.v1beta.GetFindingRequest; + + /** + * Decodes a GetFindingRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GetFindingRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.websecurityscanner.v1beta.GetFindingRequest; + + /** + * Verifies a GetFindingRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GetFindingRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GetFindingRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.websecurityscanner.v1beta.GetFindingRequest; + + /** + * Creates a plain object from a GetFindingRequest message. Also converts values to other types if specified. + * @param message GetFindingRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.websecurityscanner.v1beta.GetFindingRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GetFindingRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GetFindingRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListFindingsRequest. */ + interface IListFindingsRequest { + + /** ListFindingsRequest parent */ + parent?: (string|null); + + /** ListFindingsRequest filter */ + filter?: (string|null); + + /** ListFindingsRequest pageToken */ + pageToken?: (string|null); + + /** ListFindingsRequest pageSize */ + pageSize?: (number|null); + } + + /** Represents a ListFindingsRequest. */ + class ListFindingsRequest implements IListFindingsRequest { + + /** + * Constructs a new ListFindingsRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.websecurityscanner.v1beta.IListFindingsRequest); + + /** ListFindingsRequest parent. */ + public parent: string; + + /** ListFindingsRequest filter. */ + public filter: string; + + /** ListFindingsRequest pageToken. */ + public pageToken: string; + + /** ListFindingsRequest pageSize. */ + public pageSize: number; + + /** + * Creates a new ListFindingsRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ListFindingsRequest instance + */ + public static create(properties?: google.cloud.websecurityscanner.v1beta.IListFindingsRequest): google.cloud.websecurityscanner.v1beta.ListFindingsRequest; + + /** + * Encodes the specified ListFindingsRequest message. Does not implicitly {@link google.cloud.websecurityscanner.v1beta.ListFindingsRequest.verify|verify} messages. + * @param message ListFindingsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.websecurityscanner.v1beta.IListFindingsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListFindingsRequest message, length delimited. Does not implicitly {@link google.cloud.websecurityscanner.v1beta.ListFindingsRequest.verify|verify} messages. + * @param message ListFindingsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.websecurityscanner.v1beta.IListFindingsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListFindingsRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListFindingsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.websecurityscanner.v1beta.ListFindingsRequest; + + /** + * Decodes a ListFindingsRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListFindingsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.websecurityscanner.v1beta.ListFindingsRequest; + + /** + * Verifies a ListFindingsRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListFindingsRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListFindingsRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.websecurityscanner.v1beta.ListFindingsRequest; + + /** + * Creates a plain object from a ListFindingsRequest message. Also converts values to other types if specified. + * @param message ListFindingsRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.websecurityscanner.v1beta.ListFindingsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListFindingsRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListFindingsRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListFindingsResponse. */ + interface IListFindingsResponse { + + /** ListFindingsResponse findings */ + findings?: (google.cloud.websecurityscanner.v1beta.IFinding[]|null); + + /** ListFindingsResponse nextPageToken */ + nextPageToken?: (string|null); + } + + /** Represents a ListFindingsResponse. */ + class ListFindingsResponse implements IListFindingsResponse { + + /** + * Constructs a new ListFindingsResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.websecurityscanner.v1beta.IListFindingsResponse); + + /** ListFindingsResponse findings. */ + public findings: google.cloud.websecurityscanner.v1beta.IFinding[]; + + /** ListFindingsResponse nextPageToken. */ + public nextPageToken: string; + + /** + * Creates a new ListFindingsResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns ListFindingsResponse instance + */ + public static create(properties?: google.cloud.websecurityscanner.v1beta.IListFindingsResponse): google.cloud.websecurityscanner.v1beta.ListFindingsResponse; + + /** + * Encodes the specified ListFindingsResponse message. Does not implicitly {@link google.cloud.websecurityscanner.v1beta.ListFindingsResponse.verify|verify} messages. + * @param message ListFindingsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.websecurityscanner.v1beta.IListFindingsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListFindingsResponse message, length delimited. Does not implicitly {@link google.cloud.websecurityscanner.v1beta.ListFindingsResponse.verify|verify} messages. + * @param message ListFindingsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.websecurityscanner.v1beta.IListFindingsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListFindingsResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListFindingsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.websecurityscanner.v1beta.ListFindingsResponse; + + /** + * Decodes a ListFindingsResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListFindingsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.websecurityscanner.v1beta.ListFindingsResponse; + + /** + * Verifies a ListFindingsResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListFindingsResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListFindingsResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.websecurityscanner.v1beta.ListFindingsResponse; + + /** + * Creates a plain object from a ListFindingsResponse message. Also converts values to other types if specified. + * @param message ListFindingsResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.websecurityscanner.v1beta.ListFindingsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListFindingsResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListFindingsResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListFindingTypeStatsRequest. */ + interface IListFindingTypeStatsRequest { + + /** ListFindingTypeStatsRequest parent */ + parent?: (string|null); + } + + /** Represents a ListFindingTypeStatsRequest. */ + class ListFindingTypeStatsRequest implements IListFindingTypeStatsRequest { + + /** + * Constructs a new ListFindingTypeStatsRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.websecurityscanner.v1beta.IListFindingTypeStatsRequest); + + /** ListFindingTypeStatsRequest parent. */ + public parent: string; + + /** + * Creates a new ListFindingTypeStatsRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ListFindingTypeStatsRequest instance + */ + public static create(properties?: google.cloud.websecurityscanner.v1beta.IListFindingTypeStatsRequest): google.cloud.websecurityscanner.v1beta.ListFindingTypeStatsRequest; + + /** + * Encodes the specified ListFindingTypeStatsRequest message. Does not implicitly {@link google.cloud.websecurityscanner.v1beta.ListFindingTypeStatsRequest.verify|verify} messages. + * @param message ListFindingTypeStatsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.websecurityscanner.v1beta.IListFindingTypeStatsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListFindingTypeStatsRequest message, length delimited. Does not implicitly {@link google.cloud.websecurityscanner.v1beta.ListFindingTypeStatsRequest.verify|verify} messages. + * @param message ListFindingTypeStatsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.websecurityscanner.v1beta.IListFindingTypeStatsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListFindingTypeStatsRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListFindingTypeStatsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.websecurityscanner.v1beta.ListFindingTypeStatsRequest; + + /** + * Decodes a ListFindingTypeStatsRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListFindingTypeStatsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.websecurityscanner.v1beta.ListFindingTypeStatsRequest; + + /** + * Verifies a ListFindingTypeStatsRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListFindingTypeStatsRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListFindingTypeStatsRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.websecurityscanner.v1beta.ListFindingTypeStatsRequest; + + /** + * Creates a plain object from a ListFindingTypeStatsRequest message. Also converts values to other types if specified. + * @param message ListFindingTypeStatsRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.websecurityscanner.v1beta.ListFindingTypeStatsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListFindingTypeStatsRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListFindingTypeStatsRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListFindingTypeStatsResponse. */ + interface IListFindingTypeStatsResponse { + + /** ListFindingTypeStatsResponse findingTypeStats */ + findingTypeStats?: (google.cloud.websecurityscanner.v1beta.IFindingTypeStats[]|null); + } + + /** Represents a ListFindingTypeStatsResponse. */ + class ListFindingTypeStatsResponse implements IListFindingTypeStatsResponse { + + /** + * Constructs a new ListFindingTypeStatsResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.websecurityscanner.v1beta.IListFindingTypeStatsResponse); + + /** ListFindingTypeStatsResponse findingTypeStats. */ + public findingTypeStats: google.cloud.websecurityscanner.v1beta.IFindingTypeStats[]; + + /** + * Creates a new ListFindingTypeStatsResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns ListFindingTypeStatsResponse instance + */ + public static create(properties?: google.cloud.websecurityscanner.v1beta.IListFindingTypeStatsResponse): google.cloud.websecurityscanner.v1beta.ListFindingTypeStatsResponse; + + /** + * Encodes the specified ListFindingTypeStatsResponse message. Does not implicitly {@link google.cloud.websecurityscanner.v1beta.ListFindingTypeStatsResponse.verify|verify} messages. + * @param message ListFindingTypeStatsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.websecurityscanner.v1beta.IListFindingTypeStatsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListFindingTypeStatsResponse message, length delimited. Does not implicitly {@link google.cloud.websecurityscanner.v1beta.ListFindingTypeStatsResponse.verify|verify} messages. + * @param message ListFindingTypeStatsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.websecurityscanner.v1beta.IListFindingTypeStatsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListFindingTypeStatsResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListFindingTypeStatsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.websecurityscanner.v1beta.ListFindingTypeStatsResponse; + + /** + * Decodes a ListFindingTypeStatsResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListFindingTypeStatsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.websecurityscanner.v1beta.ListFindingTypeStatsResponse; + + /** + * Verifies a ListFindingTypeStatsResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListFindingTypeStatsResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListFindingTypeStatsResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.websecurityscanner.v1beta.ListFindingTypeStatsResponse; + + /** + * Creates a plain object from a ListFindingTypeStatsResponse message. Also converts values to other types if specified. + * @param message ListFindingTypeStatsResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.websecurityscanner.v1beta.ListFindingTypeStatsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListFindingTypeStatsResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListFindingTypeStatsResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + } + } + + /** Namespace api. */ + namespace api { + + /** FieldBehavior enum. */ + enum FieldBehavior { + FIELD_BEHAVIOR_UNSPECIFIED = 0, + OPTIONAL = 1, + REQUIRED = 2, + OUTPUT_ONLY = 3, + INPUT_ONLY = 4, + IMMUTABLE = 5, + UNORDERED_LIST = 6, + NON_EMPTY_DEFAULT = 7 + } + + /** Properties of a ResourceDescriptor. */ + interface IResourceDescriptor { + + /** ResourceDescriptor type */ + type?: (string|null); + + /** ResourceDescriptor pattern */ + pattern?: (string[]|null); + + /** ResourceDescriptor nameField */ + nameField?: (string|null); + + /** ResourceDescriptor history */ + history?: (google.api.ResourceDescriptor.History|keyof typeof google.api.ResourceDescriptor.History|null); + + /** ResourceDescriptor plural */ + plural?: (string|null); + + /** ResourceDescriptor singular */ + singular?: (string|null); + + /** ResourceDescriptor style */ + style?: (google.api.ResourceDescriptor.Style[]|null); + } + + /** Represents a ResourceDescriptor. */ + class ResourceDescriptor implements IResourceDescriptor { + + /** + * Constructs a new ResourceDescriptor. + * @param [properties] Properties to set + */ + constructor(properties?: google.api.IResourceDescriptor); + + /** ResourceDescriptor type. */ + public type: string; + + /** ResourceDescriptor pattern. */ + public pattern: string[]; + + /** ResourceDescriptor nameField. */ + public nameField: string; + + /** ResourceDescriptor history. */ + public history: (google.api.ResourceDescriptor.History|keyof typeof google.api.ResourceDescriptor.History); + + /** ResourceDescriptor plural. */ + public plural: string; + + /** ResourceDescriptor singular. */ + public singular: string; + + /** ResourceDescriptor style. */ + public style: google.api.ResourceDescriptor.Style[]; + + /** + * Creates a new ResourceDescriptor instance using the specified properties. + * @param [properties] Properties to set + * @returns ResourceDescriptor instance + */ + public static create(properties?: google.api.IResourceDescriptor): google.api.ResourceDescriptor; + + /** + * Encodes the specified ResourceDescriptor message. Does not implicitly {@link google.api.ResourceDescriptor.verify|verify} messages. + * @param message ResourceDescriptor message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.api.IResourceDescriptor, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ResourceDescriptor message, length delimited. Does not implicitly {@link google.api.ResourceDescriptor.verify|verify} messages. + * @param message ResourceDescriptor message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.api.IResourceDescriptor, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ResourceDescriptor message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ResourceDescriptor + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.ResourceDescriptor; + + /** + * Decodes a ResourceDescriptor message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ResourceDescriptor + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.ResourceDescriptor; + + /** + * Verifies a ResourceDescriptor message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ResourceDescriptor message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ResourceDescriptor + */ + public static fromObject(object: { [k: string]: any }): google.api.ResourceDescriptor; + + /** + * Creates a plain object from a ResourceDescriptor message. Also converts values to other types if specified. + * @param message ResourceDescriptor + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.api.ResourceDescriptor, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ResourceDescriptor to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ResourceDescriptor + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace ResourceDescriptor { + + /** History enum. */ + enum History { + HISTORY_UNSPECIFIED = 0, + ORIGINALLY_SINGLE_PATTERN = 1, + FUTURE_MULTI_PATTERN = 2 + } + + /** Style enum. */ + enum Style { + STYLE_UNSPECIFIED = 0, + DECLARATIVE_FRIENDLY = 1 + } + } + + /** Properties of a ResourceReference. */ + interface IResourceReference { + + /** ResourceReference type */ + type?: (string|null); + + /** ResourceReference childType */ + childType?: (string|null); + } + + /** Represents a ResourceReference. */ + class ResourceReference implements IResourceReference { + + /** + * Constructs a new ResourceReference. + * @param [properties] Properties to set + */ + constructor(properties?: google.api.IResourceReference); + + /** ResourceReference type. */ + public type: string; + + /** ResourceReference childType. */ + public childType: string; + + /** + * Creates a new ResourceReference instance using the specified properties. + * @param [properties] Properties to set + * @returns ResourceReference instance + */ + public static create(properties?: google.api.IResourceReference): google.api.ResourceReference; + + /** + * Encodes the specified ResourceReference message. Does not implicitly {@link google.api.ResourceReference.verify|verify} messages. + * @param message ResourceReference message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.api.IResourceReference, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ResourceReference message, length delimited. Does not implicitly {@link google.api.ResourceReference.verify|verify} messages. + * @param message ResourceReference message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.api.IResourceReference, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ResourceReference message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ResourceReference + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.ResourceReference; + + /** + * Decodes a ResourceReference message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ResourceReference + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.ResourceReference; + + /** + * Verifies a ResourceReference message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ResourceReference message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ResourceReference + */ + public static fromObject(object: { [k: string]: any }): google.api.ResourceReference; + + /** + * Creates a plain object from a ResourceReference message. Also converts values to other types if specified. + * @param message ResourceReference + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.api.ResourceReference, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ResourceReference to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ResourceReference + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a Http. */ + interface IHttp { + + /** Http rules */ + rules?: (google.api.IHttpRule[]|null); + + /** Http fullyDecodeReservedExpansion */ + fullyDecodeReservedExpansion?: (boolean|null); + } + + /** Represents a Http. */ + class Http implements IHttp { + + /** + * Constructs a new Http. + * @param [properties] Properties to set + */ + constructor(properties?: google.api.IHttp); + + /** Http rules. */ + public rules: google.api.IHttpRule[]; + + /** Http fullyDecodeReservedExpansion. */ + public fullyDecodeReservedExpansion: boolean; + + /** + * Creates a new Http instance using the specified properties. + * @param [properties] Properties to set + * @returns Http instance + */ + public static create(properties?: google.api.IHttp): google.api.Http; + + /** + * Encodes the specified Http message. Does not implicitly {@link google.api.Http.verify|verify} messages. + * @param message Http message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.api.IHttp, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Http message, length delimited. Does not implicitly {@link google.api.Http.verify|verify} messages. + * @param message Http message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.api.IHttp, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Http message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Http + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.Http; + + /** + * Decodes a Http message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Http + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.Http; + + /** + * Verifies a Http message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Http message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Http + */ + public static fromObject(object: { [k: string]: any }): google.api.Http; + + /** + * Creates a plain object from a Http message. Also converts values to other types if specified. + * @param message Http + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.api.Http, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Http to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Http + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a HttpRule. */ + interface IHttpRule { + + /** HttpRule selector */ + selector?: (string|null); + + /** HttpRule get */ + get?: (string|null); + + /** HttpRule put */ + put?: (string|null); + + /** HttpRule post */ + post?: (string|null); + + /** HttpRule delete */ + "delete"?: (string|null); + + /** HttpRule patch */ + patch?: (string|null); + + /** HttpRule custom */ + custom?: (google.api.ICustomHttpPattern|null); + + /** HttpRule body */ + body?: (string|null); + + /** HttpRule responseBody */ + responseBody?: (string|null); + + /** HttpRule additionalBindings */ + additionalBindings?: (google.api.IHttpRule[]|null); + } + + /** Represents a HttpRule. */ + class HttpRule implements IHttpRule { + + /** + * Constructs a new HttpRule. + * @param [properties] Properties to set + */ + constructor(properties?: google.api.IHttpRule); + + /** HttpRule selector. */ + public selector: string; + + /** HttpRule get. */ + public get?: (string|null); + + /** HttpRule put. */ + public put?: (string|null); + + /** HttpRule post. */ + public post?: (string|null); + + /** HttpRule delete. */ + public delete?: (string|null); + + /** HttpRule patch. */ + public patch?: (string|null); + + /** HttpRule custom. */ + public custom?: (google.api.ICustomHttpPattern|null); + + /** HttpRule body. */ + public body: string; + + /** HttpRule responseBody. */ + public responseBody: string; + + /** HttpRule additionalBindings. */ + public additionalBindings: google.api.IHttpRule[]; + + /** HttpRule pattern. */ + public pattern?: ("get"|"put"|"post"|"delete"|"patch"|"custom"); + + /** + * Creates a new HttpRule instance using the specified properties. + * @param [properties] Properties to set + * @returns HttpRule instance + */ + public static create(properties?: google.api.IHttpRule): google.api.HttpRule; + + /** + * Encodes the specified HttpRule message. Does not implicitly {@link google.api.HttpRule.verify|verify} messages. + * @param message HttpRule message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.api.IHttpRule, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified HttpRule message, length delimited. Does not implicitly {@link google.api.HttpRule.verify|verify} messages. + * @param message HttpRule message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.api.IHttpRule, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a HttpRule message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns HttpRule + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.HttpRule; + + /** + * Decodes a HttpRule message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns HttpRule + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.HttpRule; + + /** + * Verifies a HttpRule message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a HttpRule message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns HttpRule + */ + public static fromObject(object: { [k: string]: any }): google.api.HttpRule; + + /** + * Creates a plain object from a HttpRule message. Also converts values to other types if specified. + * @param message HttpRule + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.api.HttpRule, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this HttpRule to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for HttpRule + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a CustomHttpPattern. */ + interface ICustomHttpPattern { + + /** CustomHttpPattern kind */ + kind?: (string|null); + + /** CustomHttpPattern path */ + path?: (string|null); + } + + /** Represents a CustomHttpPattern. */ + class CustomHttpPattern implements ICustomHttpPattern { + + /** + * Constructs a new CustomHttpPattern. + * @param [properties] Properties to set + */ + constructor(properties?: google.api.ICustomHttpPattern); + + /** CustomHttpPattern kind. */ + public kind: string; + + /** CustomHttpPattern path. */ + public path: string; + + /** + * Creates a new CustomHttpPattern instance using the specified properties. + * @param [properties] Properties to set + * @returns CustomHttpPattern instance + */ + public static create(properties?: google.api.ICustomHttpPattern): google.api.CustomHttpPattern; + + /** + * Encodes the specified CustomHttpPattern message. Does not implicitly {@link google.api.CustomHttpPattern.verify|verify} messages. + * @param message CustomHttpPattern message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.api.ICustomHttpPattern, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CustomHttpPattern message, length delimited. Does not implicitly {@link google.api.CustomHttpPattern.verify|verify} messages. + * @param message CustomHttpPattern message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.api.ICustomHttpPattern, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CustomHttpPattern message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CustomHttpPattern + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.CustomHttpPattern; + + /** + * Decodes a CustomHttpPattern message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CustomHttpPattern + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.CustomHttpPattern; + + /** + * Verifies a CustomHttpPattern message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a CustomHttpPattern message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CustomHttpPattern + */ + public static fromObject(object: { [k: string]: any }): google.api.CustomHttpPattern; + + /** + * Creates a plain object from a CustomHttpPattern message. Also converts values to other types if specified. + * @param message CustomHttpPattern + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.api.CustomHttpPattern, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CustomHttpPattern to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CustomHttpPattern + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Namespace protobuf. */ + namespace protobuf { + + /** Properties of a FileDescriptorSet. */ + interface IFileDescriptorSet { + + /** FileDescriptorSet file */ + file?: (google.protobuf.IFileDescriptorProto[]|null); + } + + /** Represents a FileDescriptorSet. */ + class FileDescriptorSet implements IFileDescriptorSet { + + /** + * Constructs a new FileDescriptorSet. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IFileDescriptorSet); + + /** FileDescriptorSet file. */ + public file: google.protobuf.IFileDescriptorProto[]; + + /** + * Creates a new FileDescriptorSet instance using the specified properties. + * @param [properties] Properties to set + * @returns FileDescriptorSet instance + */ + public static create(properties?: google.protobuf.IFileDescriptorSet): google.protobuf.FileDescriptorSet; + + /** + * Encodes the specified FileDescriptorSet message. Does not implicitly {@link google.protobuf.FileDescriptorSet.verify|verify} messages. + * @param message FileDescriptorSet message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IFileDescriptorSet, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified FileDescriptorSet message, length delimited. Does not implicitly {@link google.protobuf.FileDescriptorSet.verify|verify} messages. + * @param message FileDescriptorSet message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IFileDescriptorSet, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FileDescriptorSet message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns FileDescriptorSet + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.FileDescriptorSet; + + /** + * Decodes a FileDescriptorSet message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns FileDescriptorSet + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.FileDescriptorSet; + + /** + * Verifies a FileDescriptorSet message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a FileDescriptorSet message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns FileDescriptorSet + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.FileDescriptorSet; + + /** + * Creates a plain object from a FileDescriptorSet message. Also converts values to other types if specified. + * @param message FileDescriptorSet + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.FileDescriptorSet, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this FileDescriptorSet to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for FileDescriptorSet + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a FileDescriptorProto. */ + interface IFileDescriptorProto { + + /** FileDescriptorProto name */ + name?: (string|null); + + /** FileDescriptorProto package */ + "package"?: (string|null); + + /** FileDescriptorProto dependency */ + dependency?: (string[]|null); + + /** FileDescriptorProto publicDependency */ + publicDependency?: (number[]|null); + + /** FileDescriptorProto weakDependency */ + weakDependency?: (number[]|null); + + /** FileDescriptorProto messageType */ + messageType?: (google.protobuf.IDescriptorProto[]|null); + + /** FileDescriptorProto enumType */ + enumType?: (google.protobuf.IEnumDescriptorProto[]|null); + + /** FileDescriptorProto service */ + service?: (google.protobuf.IServiceDescriptorProto[]|null); + + /** FileDescriptorProto extension */ + extension?: (google.protobuf.IFieldDescriptorProto[]|null); + + /** FileDescriptorProto options */ + options?: (google.protobuf.IFileOptions|null); + + /** FileDescriptorProto sourceCodeInfo */ + sourceCodeInfo?: (google.protobuf.ISourceCodeInfo|null); + + /** FileDescriptorProto syntax */ + syntax?: (string|null); + + /** FileDescriptorProto edition */ + edition?: (string|null); + } + + /** Represents a FileDescriptorProto. */ + class FileDescriptorProto implements IFileDescriptorProto { + + /** + * Constructs a new FileDescriptorProto. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IFileDescriptorProto); + + /** FileDescriptorProto name. */ + public name: string; + + /** FileDescriptorProto package. */ + public package: string; + + /** FileDescriptorProto dependency. */ + public dependency: string[]; + + /** FileDescriptorProto publicDependency. */ + public publicDependency: number[]; + + /** FileDescriptorProto weakDependency. */ + public weakDependency: number[]; + + /** FileDescriptorProto messageType. */ + public messageType: google.protobuf.IDescriptorProto[]; + + /** FileDescriptorProto enumType. */ + public enumType: google.protobuf.IEnumDescriptorProto[]; + + /** FileDescriptorProto service. */ + public service: google.protobuf.IServiceDescriptorProto[]; + + /** FileDescriptorProto extension. */ + public extension: google.protobuf.IFieldDescriptorProto[]; + + /** FileDescriptorProto options. */ + public options?: (google.protobuf.IFileOptions|null); + + /** FileDescriptorProto sourceCodeInfo. */ + public sourceCodeInfo?: (google.protobuf.ISourceCodeInfo|null); + + /** FileDescriptorProto syntax. */ + public syntax: string; + + /** FileDescriptorProto edition. */ + public edition: string; + + /** + * Creates a new FileDescriptorProto instance using the specified properties. + * @param [properties] Properties to set + * @returns FileDescriptorProto instance + */ + public static create(properties?: google.protobuf.IFileDescriptorProto): google.protobuf.FileDescriptorProto; + + /** + * Encodes the specified FileDescriptorProto message. Does not implicitly {@link google.protobuf.FileDescriptorProto.verify|verify} messages. + * @param message FileDescriptorProto message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IFileDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified FileDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.FileDescriptorProto.verify|verify} messages. + * @param message FileDescriptorProto message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IFileDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FileDescriptorProto message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns FileDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.FileDescriptorProto; + + /** + * Decodes a FileDescriptorProto message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns FileDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.FileDescriptorProto; + + /** + * Verifies a FileDescriptorProto message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a FileDescriptorProto message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns FileDescriptorProto + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.FileDescriptorProto; + + /** + * Creates a plain object from a FileDescriptorProto message. Also converts values to other types if specified. + * @param message FileDescriptorProto + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.FileDescriptorProto, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this FileDescriptorProto to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for FileDescriptorProto + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a DescriptorProto. */ + interface IDescriptorProto { + + /** DescriptorProto name */ + name?: (string|null); + + /** DescriptorProto field */ + field?: (google.protobuf.IFieldDescriptorProto[]|null); + + /** DescriptorProto extension */ + extension?: (google.protobuf.IFieldDescriptorProto[]|null); + + /** DescriptorProto nestedType */ + nestedType?: (google.protobuf.IDescriptorProto[]|null); + + /** DescriptorProto enumType */ + enumType?: (google.protobuf.IEnumDescriptorProto[]|null); + + /** DescriptorProto extensionRange */ + extensionRange?: (google.protobuf.DescriptorProto.IExtensionRange[]|null); + + /** DescriptorProto oneofDecl */ + oneofDecl?: (google.protobuf.IOneofDescriptorProto[]|null); + + /** DescriptorProto options */ + options?: (google.protobuf.IMessageOptions|null); + + /** DescriptorProto reservedRange */ + reservedRange?: (google.protobuf.DescriptorProto.IReservedRange[]|null); + + /** DescriptorProto reservedName */ + reservedName?: (string[]|null); + } + + /** Represents a DescriptorProto. */ + class DescriptorProto implements IDescriptorProto { + + /** + * Constructs a new DescriptorProto. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IDescriptorProto); + + /** DescriptorProto name. */ + public name: string; + + /** DescriptorProto field. */ + public field: google.protobuf.IFieldDescriptorProto[]; + + /** DescriptorProto extension. */ + public extension: google.protobuf.IFieldDescriptorProto[]; + + /** DescriptorProto nestedType. */ + public nestedType: google.protobuf.IDescriptorProto[]; + + /** DescriptorProto enumType. */ + public enumType: google.protobuf.IEnumDescriptorProto[]; + + /** DescriptorProto extensionRange. */ + public extensionRange: google.protobuf.DescriptorProto.IExtensionRange[]; + + /** DescriptorProto oneofDecl. */ + public oneofDecl: google.protobuf.IOneofDescriptorProto[]; + + /** DescriptorProto options. */ + public options?: (google.protobuf.IMessageOptions|null); + + /** DescriptorProto reservedRange. */ + public reservedRange: google.protobuf.DescriptorProto.IReservedRange[]; + + /** DescriptorProto reservedName. */ + public reservedName: string[]; + + /** + * Creates a new DescriptorProto instance using the specified properties. + * @param [properties] Properties to set + * @returns DescriptorProto instance + */ + public static create(properties?: google.protobuf.IDescriptorProto): google.protobuf.DescriptorProto; + + /** + * Encodes the specified DescriptorProto message. Does not implicitly {@link google.protobuf.DescriptorProto.verify|verify} messages. + * @param message DescriptorProto message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.DescriptorProto.verify|verify} messages. + * @param message DescriptorProto message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DescriptorProto message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.DescriptorProto; + + /** + * Decodes a DescriptorProto message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.DescriptorProto; + + /** + * Verifies a DescriptorProto message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a DescriptorProto message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DescriptorProto + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.DescriptorProto; + + /** + * Creates a plain object from a DescriptorProto message. Also converts values to other types if specified. + * @param message DescriptorProto + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.DescriptorProto, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DescriptorProto to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DescriptorProto + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace DescriptorProto { + + /** Properties of an ExtensionRange. */ + interface IExtensionRange { + + /** ExtensionRange start */ + start?: (number|null); + + /** ExtensionRange end */ + end?: (number|null); + + /** ExtensionRange options */ + options?: (google.protobuf.IExtensionRangeOptions|null); + } + + /** Represents an ExtensionRange. */ + class ExtensionRange implements IExtensionRange { + + /** + * Constructs a new ExtensionRange. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.DescriptorProto.IExtensionRange); + + /** ExtensionRange start. */ + public start: number; + + /** ExtensionRange end. */ + public end: number; + + /** ExtensionRange options. */ + public options?: (google.protobuf.IExtensionRangeOptions|null); + + /** + * Creates a new ExtensionRange instance using the specified properties. + * @param [properties] Properties to set + * @returns ExtensionRange instance + */ + public static create(properties?: google.protobuf.DescriptorProto.IExtensionRange): google.protobuf.DescriptorProto.ExtensionRange; + + /** + * Encodes the specified ExtensionRange message. Does not implicitly {@link google.protobuf.DescriptorProto.ExtensionRange.verify|verify} messages. + * @param message ExtensionRange message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.DescriptorProto.IExtensionRange, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ExtensionRange message, length delimited. Does not implicitly {@link google.protobuf.DescriptorProto.ExtensionRange.verify|verify} messages. + * @param message ExtensionRange message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.DescriptorProto.IExtensionRange, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an ExtensionRange message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ExtensionRange + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.DescriptorProto.ExtensionRange; + + /** + * Decodes an ExtensionRange message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ExtensionRange + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.DescriptorProto.ExtensionRange; + + /** + * Verifies an ExtensionRange message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an ExtensionRange message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ExtensionRange + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.DescriptorProto.ExtensionRange; + + /** + * Creates a plain object from an ExtensionRange message. Also converts values to other types if specified. + * @param message ExtensionRange + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.DescriptorProto.ExtensionRange, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ExtensionRange to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ExtensionRange + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ReservedRange. */ + interface IReservedRange { + + /** ReservedRange start */ + start?: (number|null); + + /** ReservedRange end */ + end?: (number|null); + } + + /** Represents a ReservedRange. */ + class ReservedRange implements IReservedRange { + + /** + * Constructs a new ReservedRange. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.DescriptorProto.IReservedRange); + + /** ReservedRange start. */ + public start: number; + + /** ReservedRange end. */ + public end: number; + + /** + * Creates a new ReservedRange instance using the specified properties. + * @param [properties] Properties to set + * @returns ReservedRange instance + */ + public static create(properties?: google.protobuf.DescriptorProto.IReservedRange): google.protobuf.DescriptorProto.ReservedRange; + + /** + * Encodes the specified ReservedRange message. Does not implicitly {@link google.protobuf.DescriptorProto.ReservedRange.verify|verify} messages. + * @param message ReservedRange message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.DescriptorProto.IReservedRange, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ReservedRange message, length delimited. Does not implicitly {@link google.protobuf.DescriptorProto.ReservedRange.verify|verify} messages. + * @param message ReservedRange message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.DescriptorProto.IReservedRange, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ReservedRange message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ReservedRange + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.DescriptorProto.ReservedRange; + + /** + * Decodes a ReservedRange message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ReservedRange + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.DescriptorProto.ReservedRange; + + /** + * Verifies a ReservedRange message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ReservedRange message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ReservedRange + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.DescriptorProto.ReservedRange; + + /** + * Creates a plain object from a ReservedRange message. Also converts values to other types if specified. + * @param message ReservedRange + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.DescriptorProto.ReservedRange, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ReservedRange to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ReservedRange + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Properties of an ExtensionRangeOptions. */ + interface IExtensionRangeOptions { + + /** ExtensionRangeOptions uninterpretedOption */ + uninterpretedOption?: (google.protobuf.IUninterpretedOption[]|null); + } + + /** Represents an ExtensionRangeOptions. */ + class ExtensionRangeOptions implements IExtensionRangeOptions { + + /** + * Constructs a new ExtensionRangeOptions. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IExtensionRangeOptions); + + /** ExtensionRangeOptions uninterpretedOption. */ + public uninterpretedOption: google.protobuf.IUninterpretedOption[]; + + /** + * Creates a new ExtensionRangeOptions instance using the specified properties. + * @param [properties] Properties to set + * @returns ExtensionRangeOptions instance + */ + public static create(properties?: google.protobuf.IExtensionRangeOptions): google.protobuf.ExtensionRangeOptions; + + /** + * Encodes the specified ExtensionRangeOptions message. Does not implicitly {@link google.protobuf.ExtensionRangeOptions.verify|verify} messages. + * @param message ExtensionRangeOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IExtensionRangeOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ExtensionRangeOptions message, length delimited. Does not implicitly {@link google.protobuf.ExtensionRangeOptions.verify|verify} messages. + * @param message ExtensionRangeOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IExtensionRangeOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an ExtensionRangeOptions message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ExtensionRangeOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.ExtensionRangeOptions; + + /** + * Decodes an ExtensionRangeOptions message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ExtensionRangeOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.ExtensionRangeOptions; + + /** + * Verifies an ExtensionRangeOptions message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an ExtensionRangeOptions message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ExtensionRangeOptions + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.ExtensionRangeOptions; + + /** + * Creates a plain object from an ExtensionRangeOptions message. Also converts values to other types if specified. + * @param message ExtensionRangeOptions + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.ExtensionRangeOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ExtensionRangeOptions to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ExtensionRangeOptions + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a FieldDescriptorProto. */ + interface IFieldDescriptorProto { + + /** FieldDescriptorProto name */ + name?: (string|null); + + /** FieldDescriptorProto number */ + number?: (number|null); + + /** FieldDescriptorProto label */ + label?: (google.protobuf.FieldDescriptorProto.Label|keyof typeof google.protobuf.FieldDescriptorProto.Label|null); + + /** FieldDescriptorProto type */ + type?: (google.protobuf.FieldDescriptorProto.Type|keyof typeof google.protobuf.FieldDescriptorProto.Type|null); + + /** FieldDescriptorProto typeName */ + typeName?: (string|null); + + /** FieldDescriptorProto extendee */ + extendee?: (string|null); + + /** FieldDescriptorProto defaultValue */ + defaultValue?: (string|null); + + /** FieldDescriptorProto oneofIndex */ + oneofIndex?: (number|null); + + /** FieldDescriptorProto jsonName */ + jsonName?: (string|null); + + /** FieldDescriptorProto options */ + options?: (google.protobuf.IFieldOptions|null); + + /** FieldDescriptorProto proto3Optional */ + proto3Optional?: (boolean|null); + } + + /** Represents a FieldDescriptorProto. */ + class FieldDescriptorProto implements IFieldDescriptorProto { + + /** + * Constructs a new FieldDescriptorProto. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IFieldDescriptorProto); + + /** FieldDescriptorProto name. */ + public name: string; + + /** FieldDescriptorProto number. */ + public number: number; + + /** FieldDescriptorProto label. */ + public label: (google.protobuf.FieldDescriptorProto.Label|keyof typeof google.protobuf.FieldDescriptorProto.Label); + + /** FieldDescriptorProto type. */ + public type: (google.protobuf.FieldDescriptorProto.Type|keyof typeof google.protobuf.FieldDescriptorProto.Type); + + /** FieldDescriptorProto typeName. */ + public typeName: string; + + /** FieldDescriptorProto extendee. */ + public extendee: string; + + /** FieldDescriptorProto defaultValue. */ + public defaultValue: string; + + /** FieldDescriptorProto oneofIndex. */ + public oneofIndex: number; + + /** FieldDescriptorProto jsonName. */ + public jsonName: string; + + /** FieldDescriptorProto options. */ + public options?: (google.protobuf.IFieldOptions|null); + + /** FieldDescriptorProto proto3Optional. */ + public proto3Optional: boolean; + + /** + * Creates a new FieldDescriptorProto instance using the specified properties. + * @param [properties] Properties to set + * @returns FieldDescriptorProto instance + */ + public static create(properties?: google.protobuf.IFieldDescriptorProto): google.protobuf.FieldDescriptorProto; + + /** + * Encodes the specified FieldDescriptorProto message. Does not implicitly {@link google.protobuf.FieldDescriptorProto.verify|verify} messages. + * @param message FieldDescriptorProto message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IFieldDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified FieldDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.FieldDescriptorProto.verify|verify} messages. + * @param message FieldDescriptorProto message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IFieldDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FieldDescriptorProto message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns FieldDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.FieldDescriptorProto; + + /** + * Decodes a FieldDescriptorProto message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns FieldDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.FieldDescriptorProto; + + /** + * Verifies a FieldDescriptorProto message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a FieldDescriptorProto message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns FieldDescriptorProto + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.FieldDescriptorProto; + + /** + * Creates a plain object from a FieldDescriptorProto message. Also converts values to other types if specified. + * @param message FieldDescriptorProto + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.FieldDescriptorProto, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this FieldDescriptorProto to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for FieldDescriptorProto + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace FieldDescriptorProto { + + /** Type enum. */ + enum Type { + TYPE_DOUBLE = 1, + TYPE_FLOAT = 2, + TYPE_INT64 = 3, + TYPE_UINT64 = 4, + TYPE_INT32 = 5, + TYPE_FIXED64 = 6, + TYPE_FIXED32 = 7, + TYPE_BOOL = 8, + TYPE_STRING = 9, + TYPE_GROUP = 10, + TYPE_MESSAGE = 11, + TYPE_BYTES = 12, + TYPE_UINT32 = 13, + TYPE_ENUM = 14, + TYPE_SFIXED32 = 15, + TYPE_SFIXED64 = 16, + TYPE_SINT32 = 17, + TYPE_SINT64 = 18 + } + + /** Label enum. */ + enum Label { + LABEL_OPTIONAL = 1, + LABEL_REQUIRED = 2, + LABEL_REPEATED = 3 + } + } + + /** Properties of an OneofDescriptorProto. */ + interface IOneofDescriptorProto { + + /** OneofDescriptorProto name */ + name?: (string|null); + + /** OneofDescriptorProto options */ + options?: (google.protobuf.IOneofOptions|null); + } + + /** Represents an OneofDescriptorProto. */ + class OneofDescriptorProto implements IOneofDescriptorProto { + + /** + * Constructs a new OneofDescriptorProto. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IOneofDescriptorProto); + + /** OneofDescriptorProto name. */ + public name: string; + + /** OneofDescriptorProto options. */ + public options?: (google.protobuf.IOneofOptions|null); + + /** + * Creates a new OneofDescriptorProto instance using the specified properties. + * @param [properties] Properties to set + * @returns OneofDescriptorProto instance + */ + public static create(properties?: google.protobuf.IOneofDescriptorProto): google.protobuf.OneofDescriptorProto; + + /** + * Encodes the specified OneofDescriptorProto message. Does not implicitly {@link google.protobuf.OneofDescriptorProto.verify|verify} messages. + * @param message OneofDescriptorProto message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IOneofDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified OneofDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.OneofDescriptorProto.verify|verify} messages. + * @param message OneofDescriptorProto message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IOneofDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an OneofDescriptorProto message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns OneofDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.OneofDescriptorProto; + + /** + * Decodes an OneofDescriptorProto message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns OneofDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.OneofDescriptorProto; + + /** + * Verifies an OneofDescriptorProto message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an OneofDescriptorProto message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns OneofDescriptorProto + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.OneofDescriptorProto; + + /** + * Creates a plain object from an OneofDescriptorProto message. Also converts values to other types if specified. + * @param message OneofDescriptorProto + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.OneofDescriptorProto, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this OneofDescriptorProto to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for OneofDescriptorProto + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an EnumDescriptorProto. */ + interface IEnumDescriptorProto { + + /** EnumDescriptorProto name */ + name?: (string|null); + + /** EnumDescriptorProto value */ + value?: (google.protobuf.IEnumValueDescriptorProto[]|null); + + /** EnumDescriptorProto options */ + options?: (google.protobuf.IEnumOptions|null); + + /** EnumDescriptorProto reservedRange */ + reservedRange?: (google.protobuf.EnumDescriptorProto.IEnumReservedRange[]|null); + + /** EnumDescriptorProto reservedName */ + reservedName?: (string[]|null); + } + + /** Represents an EnumDescriptorProto. */ + class EnumDescriptorProto implements IEnumDescriptorProto { + + /** + * Constructs a new EnumDescriptorProto. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IEnumDescriptorProto); + + /** EnumDescriptorProto name. */ + public name: string; + + /** EnumDescriptorProto value. */ + public value: google.protobuf.IEnumValueDescriptorProto[]; + + /** EnumDescriptorProto options. */ + public options?: (google.protobuf.IEnumOptions|null); + + /** EnumDescriptorProto reservedRange. */ + public reservedRange: google.protobuf.EnumDescriptorProto.IEnumReservedRange[]; + + /** EnumDescriptorProto reservedName. */ + public reservedName: string[]; + + /** + * Creates a new EnumDescriptorProto instance using the specified properties. + * @param [properties] Properties to set + * @returns EnumDescriptorProto instance + */ + public static create(properties?: google.protobuf.IEnumDescriptorProto): google.protobuf.EnumDescriptorProto; + + /** + * Encodes the specified EnumDescriptorProto message. Does not implicitly {@link google.protobuf.EnumDescriptorProto.verify|verify} messages. + * @param message EnumDescriptorProto message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IEnumDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified EnumDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.EnumDescriptorProto.verify|verify} messages. + * @param message EnumDescriptorProto message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IEnumDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an EnumDescriptorProto message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns EnumDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.EnumDescriptorProto; + + /** + * Decodes an EnumDescriptorProto message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns EnumDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.EnumDescriptorProto; + + /** + * Verifies an EnumDescriptorProto message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an EnumDescriptorProto message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns EnumDescriptorProto + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.EnumDescriptorProto; + + /** + * Creates a plain object from an EnumDescriptorProto message. Also converts values to other types if specified. + * @param message EnumDescriptorProto + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.EnumDescriptorProto, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this EnumDescriptorProto to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for EnumDescriptorProto + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace EnumDescriptorProto { + + /** Properties of an EnumReservedRange. */ + interface IEnumReservedRange { + + /** EnumReservedRange start */ + start?: (number|null); + + /** EnumReservedRange end */ + end?: (number|null); + } + + /** Represents an EnumReservedRange. */ + class EnumReservedRange implements IEnumReservedRange { + + /** + * Constructs a new EnumReservedRange. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.EnumDescriptorProto.IEnumReservedRange); + + /** EnumReservedRange start. */ + public start: number; + + /** EnumReservedRange end. */ + public end: number; + + /** + * Creates a new EnumReservedRange instance using the specified properties. + * @param [properties] Properties to set + * @returns EnumReservedRange instance + */ + public static create(properties?: google.protobuf.EnumDescriptorProto.IEnumReservedRange): google.protobuf.EnumDescriptorProto.EnumReservedRange; + + /** + * Encodes the specified EnumReservedRange message. Does not implicitly {@link google.protobuf.EnumDescriptorProto.EnumReservedRange.verify|verify} messages. + * @param message EnumReservedRange message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.EnumDescriptorProto.IEnumReservedRange, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified EnumReservedRange message, length delimited. Does not implicitly {@link google.protobuf.EnumDescriptorProto.EnumReservedRange.verify|verify} messages. + * @param message EnumReservedRange message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.EnumDescriptorProto.IEnumReservedRange, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an EnumReservedRange message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns EnumReservedRange + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.EnumDescriptorProto.EnumReservedRange; + + /** + * Decodes an EnumReservedRange message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns EnumReservedRange + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.EnumDescriptorProto.EnumReservedRange; + + /** + * Verifies an EnumReservedRange message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an EnumReservedRange message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns EnumReservedRange + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.EnumDescriptorProto.EnumReservedRange; + + /** + * Creates a plain object from an EnumReservedRange message. Also converts values to other types if specified. + * @param message EnumReservedRange + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.EnumDescriptorProto.EnumReservedRange, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this EnumReservedRange to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for EnumReservedRange + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Properties of an EnumValueDescriptorProto. */ + interface IEnumValueDescriptorProto { + + /** EnumValueDescriptorProto name */ + name?: (string|null); + + /** EnumValueDescriptorProto number */ + number?: (number|null); + + /** EnumValueDescriptorProto options */ + options?: (google.protobuf.IEnumValueOptions|null); + } + + /** Represents an EnumValueDescriptorProto. */ + class EnumValueDescriptorProto implements IEnumValueDescriptorProto { + + /** + * Constructs a new EnumValueDescriptorProto. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IEnumValueDescriptorProto); + + /** EnumValueDescriptorProto name. */ + public name: string; + + /** EnumValueDescriptorProto number. */ + public number: number; + + /** EnumValueDescriptorProto options. */ + public options?: (google.protobuf.IEnumValueOptions|null); + + /** + * Creates a new EnumValueDescriptorProto instance using the specified properties. + * @param [properties] Properties to set + * @returns EnumValueDescriptorProto instance + */ + public static create(properties?: google.protobuf.IEnumValueDescriptorProto): google.protobuf.EnumValueDescriptorProto; + + /** + * Encodes the specified EnumValueDescriptorProto message. Does not implicitly {@link google.protobuf.EnumValueDescriptorProto.verify|verify} messages. + * @param message EnumValueDescriptorProto message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IEnumValueDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified EnumValueDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.EnumValueDescriptorProto.verify|verify} messages. + * @param message EnumValueDescriptorProto message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IEnumValueDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an EnumValueDescriptorProto message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns EnumValueDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.EnumValueDescriptorProto; + + /** + * Decodes an EnumValueDescriptorProto message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns EnumValueDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.EnumValueDescriptorProto; + + /** + * Verifies an EnumValueDescriptorProto message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an EnumValueDescriptorProto message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns EnumValueDescriptorProto + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.EnumValueDescriptorProto; + + /** + * Creates a plain object from an EnumValueDescriptorProto message. Also converts values to other types if specified. + * @param message EnumValueDescriptorProto + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.EnumValueDescriptorProto, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this EnumValueDescriptorProto to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for EnumValueDescriptorProto + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ServiceDescriptorProto. */ + interface IServiceDescriptorProto { + + /** ServiceDescriptorProto name */ + name?: (string|null); + + /** ServiceDescriptorProto method */ + method?: (google.protobuf.IMethodDescriptorProto[]|null); + + /** ServiceDescriptorProto options */ + options?: (google.protobuf.IServiceOptions|null); + } + + /** Represents a ServiceDescriptorProto. */ + class ServiceDescriptorProto implements IServiceDescriptorProto { + + /** + * Constructs a new ServiceDescriptorProto. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IServiceDescriptorProto); + + /** ServiceDescriptorProto name. */ + public name: string; + + /** ServiceDescriptorProto method. */ + public method: google.protobuf.IMethodDescriptorProto[]; + + /** ServiceDescriptorProto options. */ + public options?: (google.protobuf.IServiceOptions|null); + + /** + * Creates a new ServiceDescriptorProto instance using the specified properties. + * @param [properties] Properties to set + * @returns ServiceDescriptorProto instance + */ + public static create(properties?: google.protobuf.IServiceDescriptorProto): google.protobuf.ServiceDescriptorProto; + + /** + * Encodes the specified ServiceDescriptorProto message. Does not implicitly {@link google.protobuf.ServiceDescriptorProto.verify|verify} messages. + * @param message ServiceDescriptorProto message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IServiceDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ServiceDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.ServiceDescriptorProto.verify|verify} messages. + * @param message ServiceDescriptorProto message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IServiceDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ServiceDescriptorProto message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ServiceDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.ServiceDescriptorProto; + + /** + * Decodes a ServiceDescriptorProto message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ServiceDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.ServiceDescriptorProto; + + /** + * Verifies a ServiceDescriptorProto message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ServiceDescriptorProto message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ServiceDescriptorProto + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.ServiceDescriptorProto; + + /** + * Creates a plain object from a ServiceDescriptorProto message. Also converts values to other types if specified. + * @param message ServiceDescriptorProto + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.ServiceDescriptorProto, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ServiceDescriptorProto to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ServiceDescriptorProto + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a MethodDescriptorProto. */ + interface IMethodDescriptorProto { + + /** MethodDescriptorProto name */ + name?: (string|null); + + /** MethodDescriptorProto inputType */ + inputType?: (string|null); + + /** MethodDescriptorProto outputType */ + outputType?: (string|null); + + /** MethodDescriptorProto options */ + options?: (google.protobuf.IMethodOptions|null); + + /** MethodDescriptorProto clientStreaming */ + clientStreaming?: (boolean|null); + + /** MethodDescriptorProto serverStreaming */ + serverStreaming?: (boolean|null); + } + + /** Represents a MethodDescriptorProto. */ + class MethodDescriptorProto implements IMethodDescriptorProto { + + /** + * Constructs a new MethodDescriptorProto. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IMethodDescriptorProto); + + /** MethodDescriptorProto name. */ + public name: string; + + /** MethodDescriptorProto inputType. */ + public inputType: string; + + /** MethodDescriptorProto outputType. */ + public outputType: string; + + /** MethodDescriptorProto options. */ + public options?: (google.protobuf.IMethodOptions|null); + + /** MethodDescriptorProto clientStreaming. */ + public clientStreaming: boolean; + + /** MethodDescriptorProto serverStreaming. */ + public serverStreaming: boolean; + + /** + * Creates a new MethodDescriptorProto instance using the specified properties. + * @param [properties] Properties to set + * @returns MethodDescriptorProto instance + */ + public static create(properties?: google.protobuf.IMethodDescriptorProto): google.protobuf.MethodDescriptorProto; + + /** + * Encodes the specified MethodDescriptorProto message. Does not implicitly {@link google.protobuf.MethodDescriptorProto.verify|verify} messages. + * @param message MethodDescriptorProto message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IMethodDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified MethodDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.MethodDescriptorProto.verify|verify} messages. + * @param message MethodDescriptorProto message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IMethodDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a MethodDescriptorProto message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns MethodDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.MethodDescriptorProto; + + /** + * Decodes a MethodDescriptorProto message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns MethodDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.MethodDescriptorProto; + + /** + * Verifies a MethodDescriptorProto message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a MethodDescriptorProto message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns MethodDescriptorProto + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.MethodDescriptorProto; + + /** + * Creates a plain object from a MethodDescriptorProto message. Also converts values to other types if specified. + * @param message MethodDescriptorProto + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.MethodDescriptorProto, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this MethodDescriptorProto to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for MethodDescriptorProto + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a FileOptions. */ + interface IFileOptions { + + /** FileOptions javaPackage */ + javaPackage?: (string|null); + + /** FileOptions javaOuterClassname */ + javaOuterClassname?: (string|null); + + /** FileOptions javaMultipleFiles */ + javaMultipleFiles?: (boolean|null); + + /** FileOptions javaGenerateEqualsAndHash */ + javaGenerateEqualsAndHash?: (boolean|null); + + /** FileOptions javaStringCheckUtf8 */ + javaStringCheckUtf8?: (boolean|null); + + /** FileOptions optimizeFor */ + optimizeFor?: (google.protobuf.FileOptions.OptimizeMode|keyof typeof google.protobuf.FileOptions.OptimizeMode|null); + + /** FileOptions goPackage */ + goPackage?: (string|null); + + /** FileOptions ccGenericServices */ + ccGenericServices?: (boolean|null); + + /** FileOptions javaGenericServices */ + javaGenericServices?: (boolean|null); + + /** FileOptions pyGenericServices */ + pyGenericServices?: (boolean|null); + + /** FileOptions phpGenericServices */ + phpGenericServices?: (boolean|null); + + /** FileOptions deprecated */ + deprecated?: (boolean|null); + + /** FileOptions ccEnableArenas */ + ccEnableArenas?: (boolean|null); + + /** FileOptions objcClassPrefix */ + objcClassPrefix?: (string|null); + + /** FileOptions csharpNamespace */ + csharpNamespace?: (string|null); + + /** FileOptions swiftPrefix */ + swiftPrefix?: (string|null); + + /** FileOptions phpClassPrefix */ + phpClassPrefix?: (string|null); + + /** FileOptions phpNamespace */ + phpNamespace?: (string|null); + + /** FileOptions phpMetadataNamespace */ + phpMetadataNamespace?: (string|null); + + /** FileOptions rubyPackage */ + rubyPackage?: (string|null); + + /** FileOptions uninterpretedOption */ + uninterpretedOption?: (google.protobuf.IUninterpretedOption[]|null); + + /** FileOptions .google.api.resourceDefinition */ + ".google.api.resourceDefinition"?: (google.api.IResourceDescriptor[]|null); + } + + /** Represents a FileOptions. */ + class FileOptions implements IFileOptions { + + /** + * Constructs a new FileOptions. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IFileOptions); + + /** FileOptions javaPackage. */ + public javaPackage: string; + + /** FileOptions javaOuterClassname. */ + public javaOuterClassname: string; + + /** FileOptions javaMultipleFiles. */ + public javaMultipleFiles: boolean; + + /** FileOptions javaGenerateEqualsAndHash. */ + public javaGenerateEqualsAndHash: boolean; + + /** FileOptions javaStringCheckUtf8. */ + public javaStringCheckUtf8: boolean; + + /** FileOptions optimizeFor. */ + public optimizeFor: (google.protobuf.FileOptions.OptimizeMode|keyof typeof google.protobuf.FileOptions.OptimizeMode); + + /** FileOptions goPackage. */ + public goPackage: string; + + /** FileOptions ccGenericServices. */ + public ccGenericServices: boolean; + + /** FileOptions javaGenericServices. */ + public javaGenericServices: boolean; + + /** FileOptions pyGenericServices. */ + public pyGenericServices: boolean; + + /** FileOptions phpGenericServices. */ + public phpGenericServices: boolean; + + /** FileOptions deprecated. */ + public deprecated: boolean; + + /** FileOptions ccEnableArenas. */ + public ccEnableArenas: boolean; + + /** FileOptions objcClassPrefix. */ + public objcClassPrefix: string; + + /** FileOptions csharpNamespace. */ + public csharpNamespace: string; + + /** FileOptions swiftPrefix. */ + public swiftPrefix: string; + + /** FileOptions phpClassPrefix. */ + public phpClassPrefix: string; + + /** FileOptions phpNamespace. */ + public phpNamespace: string; + + /** FileOptions phpMetadataNamespace. */ + public phpMetadataNamespace: string; + + /** FileOptions rubyPackage. */ + public rubyPackage: string; + + /** FileOptions uninterpretedOption. */ + public uninterpretedOption: google.protobuf.IUninterpretedOption[]; + + /** + * Creates a new FileOptions instance using the specified properties. + * @param [properties] Properties to set + * @returns FileOptions instance + */ + public static create(properties?: google.protobuf.IFileOptions): google.protobuf.FileOptions; + + /** + * Encodes the specified FileOptions message. Does not implicitly {@link google.protobuf.FileOptions.verify|verify} messages. + * @param message FileOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IFileOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified FileOptions message, length delimited. Does not implicitly {@link google.protobuf.FileOptions.verify|verify} messages. + * @param message FileOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IFileOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FileOptions message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns FileOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.FileOptions; + + /** + * Decodes a FileOptions message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns FileOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.FileOptions; + + /** + * Verifies a FileOptions message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a FileOptions message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns FileOptions + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.FileOptions; + + /** + * Creates a plain object from a FileOptions message. Also converts values to other types if specified. + * @param message FileOptions + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.FileOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this FileOptions to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for FileOptions + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace FileOptions { + + /** OptimizeMode enum. */ + enum OptimizeMode { + SPEED = 1, + CODE_SIZE = 2, + LITE_RUNTIME = 3 + } + } + + /** Properties of a MessageOptions. */ + interface IMessageOptions { + + /** MessageOptions messageSetWireFormat */ + messageSetWireFormat?: (boolean|null); + + /** MessageOptions noStandardDescriptorAccessor */ + noStandardDescriptorAccessor?: (boolean|null); + + /** MessageOptions deprecated */ + deprecated?: (boolean|null); + + /** MessageOptions mapEntry */ + mapEntry?: (boolean|null); + + /** MessageOptions uninterpretedOption */ + uninterpretedOption?: (google.protobuf.IUninterpretedOption[]|null); + + /** MessageOptions .google.api.resource */ + ".google.api.resource"?: (google.api.IResourceDescriptor|null); + } + + /** Represents a MessageOptions. */ + class MessageOptions implements IMessageOptions { + + /** + * Constructs a new MessageOptions. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IMessageOptions); + + /** MessageOptions messageSetWireFormat. */ + public messageSetWireFormat: boolean; + + /** MessageOptions noStandardDescriptorAccessor. */ + public noStandardDescriptorAccessor: boolean; + + /** MessageOptions deprecated. */ + public deprecated: boolean; + + /** MessageOptions mapEntry. */ + public mapEntry: boolean; + + /** MessageOptions uninterpretedOption. */ + public uninterpretedOption: google.protobuf.IUninterpretedOption[]; + + /** + * Creates a new MessageOptions instance using the specified properties. + * @param [properties] Properties to set + * @returns MessageOptions instance + */ + public static create(properties?: google.protobuf.IMessageOptions): google.protobuf.MessageOptions; + + /** + * Encodes the specified MessageOptions message. Does not implicitly {@link google.protobuf.MessageOptions.verify|verify} messages. + * @param message MessageOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IMessageOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified MessageOptions message, length delimited. Does not implicitly {@link google.protobuf.MessageOptions.verify|verify} messages. + * @param message MessageOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IMessageOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a MessageOptions message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns MessageOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.MessageOptions; + + /** + * Decodes a MessageOptions message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns MessageOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.MessageOptions; + + /** + * Verifies a MessageOptions message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a MessageOptions message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns MessageOptions + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.MessageOptions; + + /** + * Creates a plain object from a MessageOptions message. Also converts values to other types if specified. + * @param message MessageOptions + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.MessageOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this MessageOptions to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for MessageOptions + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a FieldOptions. */ + interface IFieldOptions { + + /** FieldOptions ctype */ + ctype?: (google.protobuf.FieldOptions.CType|keyof typeof google.protobuf.FieldOptions.CType|null); + + /** FieldOptions packed */ + packed?: (boolean|null); + + /** FieldOptions jstype */ + jstype?: (google.protobuf.FieldOptions.JSType|keyof typeof google.protobuf.FieldOptions.JSType|null); + + /** FieldOptions lazy */ + lazy?: (boolean|null); + + /** FieldOptions unverifiedLazy */ + unverifiedLazy?: (boolean|null); + + /** FieldOptions deprecated */ + deprecated?: (boolean|null); + + /** FieldOptions weak */ + weak?: (boolean|null); + + /** FieldOptions uninterpretedOption */ + uninterpretedOption?: (google.protobuf.IUninterpretedOption[]|null); + + /** FieldOptions .google.api.fieldBehavior */ + ".google.api.fieldBehavior"?: (google.api.FieldBehavior[]|null); + + /** FieldOptions .google.api.resourceReference */ + ".google.api.resourceReference"?: (google.api.IResourceReference|null); + } + + /** Represents a FieldOptions. */ + class FieldOptions implements IFieldOptions { + + /** + * Constructs a new FieldOptions. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IFieldOptions); + + /** FieldOptions ctype. */ + public ctype: (google.protobuf.FieldOptions.CType|keyof typeof google.protobuf.FieldOptions.CType); + + /** FieldOptions packed. */ + public packed: boolean; + + /** FieldOptions jstype. */ + public jstype: (google.protobuf.FieldOptions.JSType|keyof typeof google.protobuf.FieldOptions.JSType); + + /** FieldOptions lazy. */ + public lazy: boolean; + + /** FieldOptions unverifiedLazy. */ + public unverifiedLazy: boolean; + + /** FieldOptions deprecated. */ + public deprecated: boolean; + + /** FieldOptions weak. */ + public weak: boolean; + + /** FieldOptions uninterpretedOption. */ + public uninterpretedOption: google.protobuf.IUninterpretedOption[]; + + /** + * Creates a new FieldOptions instance using the specified properties. + * @param [properties] Properties to set + * @returns FieldOptions instance + */ + public static create(properties?: google.protobuf.IFieldOptions): google.protobuf.FieldOptions; + + /** + * Encodes the specified FieldOptions message. Does not implicitly {@link google.protobuf.FieldOptions.verify|verify} messages. + * @param message FieldOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IFieldOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified FieldOptions message, length delimited. Does not implicitly {@link google.protobuf.FieldOptions.verify|verify} messages. + * @param message FieldOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IFieldOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FieldOptions message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns FieldOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.FieldOptions; + + /** + * Decodes a FieldOptions message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns FieldOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.FieldOptions; + + /** + * Verifies a FieldOptions message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a FieldOptions message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns FieldOptions + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.FieldOptions; + + /** + * Creates a plain object from a FieldOptions message. Also converts values to other types if specified. + * @param message FieldOptions + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.FieldOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this FieldOptions to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for FieldOptions + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace FieldOptions { + + /** CType enum. */ + enum CType { + STRING = 0, + CORD = 1, + STRING_PIECE = 2 + } + + /** JSType enum. */ + enum JSType { + JS_NORMAL = 0, + JS_STRING = 1, + JS_NUMBER = 2 + } + } + + /** Properties of an OneofOptions. */ + interface IOneofOptions { + + /** OneofOptions uninterpretedOption */ + uninterpretedOption?: (google.protobuf.IUninterpretedOption[]|null); + } + + /** Represents an OneofOptions. */ + class OneofOptions implements IOneofOptions { + + /** + * Constructs a new OneofOptions. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IOneofOptions); + + /** OneofOptions uninterpretedOption. */ + public uninterpretedOption: google.protobuf.IUninterpretedOption[]; + + /** + * Creates a new OneofOptions instance using the specified properties. + * @param [properties] Properties to set + * @returns OneofOptions instance + */ + public static create(properties?: google.protobuf.IOneofOptions): google.protobuf.OneofOptions; + + /** + * Encodes the specified OneofOptions message. Does not implicitly {@link google.protobuf.OneofOptions.verify|verify} messages. + * @param message OneofOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IOneofOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified OneofOptions message, length delimited. Does not implicitly {@link google.protobuf.OneofOptions.verify|verify} messages. + * @param message OneofOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IOneofOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an OneofOptions message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns OneofOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.OneofOptions; + + /** + * Decodes an OneofOptions message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns OneofOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.OneofOptions; + + /** + * Verifies an OneofOptions message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an OneofOptions message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns OneofOptions + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.OneofOptions; + + /** + * Creates a plain object from an OneofOptions message. Also converts values to other types if specified. + * @param message OneofOptions + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.OneofOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this OneofOptions to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for OneofOptions + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an EnumOptions. */ + interface IEnumOptions { + + /** EnumOptions allowAlias */ + allowAlias?: (boolean|null); + + /** EnumOptions deprecated */ + deprecated?: (boolean|null); + + /** EnumOptions uninterpretedOption */ + uninterpretedOption?: (google.protobuf.IUninterpretedOption[]|null); + } + + /** Represents an EnumOptions. */ + class EnumOptions implements IEnumOptions { + + /** + * Constructs a new EnumOptions. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IEnumOptions); + + /** EnumOptions allowAlias. */ + public allowAlias: boolean; + + /** EnumOptions deprecated. */ + public deprecated: boolean; + + /** EnumOptions uninterpretedOption. */ + public uninterpretedOption: google.protobuf.IUninterpretedOption[]; + + /** + * Creates a new EnumOptions instance using the specified properties. + * @param [properties] Properties to set + * @returns EnumOptions instance + */ + public static create(properties?: google.protobuf.IEnumOptions): google.protobuf.EnumOptions; + + /** + * Encodes the specified EnumOptions message. Does not implicitly {@link google.protobuf.EnumOptions.verify|verify} messages. + * @param message EnumOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IEnumOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified EnumOptions message, length delimited. Does not implicitly {@link google.protobuf.EnumOptions.verify|verify} messages. + * @param message EnumOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IEnumOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an EnumOptions message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns EnumOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.EnumOptions; + + /** + * Decodes an EnumOptions message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns EnumOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.EnumOptions; + + /** + * Verifies an EnumOptions message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an EnumOptions message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns EnumOptions + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.EnumOptions; + + /** + * Creates a plain object from an EnumOptions message. Also converts values to other types if specified. + * @param message EnumOptions + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.EnumOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this EnumOptions to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for EnumOptions + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an EnumValueOptions. */ + interface IEnumValueOptions { + + /** EnumValueOptions deprecated */ + deprecated?: (boolean|null); + + /** EnumValueOptions uninterpretedOption */ + uninterpretedOption?: (google.protobuf.IUninterpretedOption[]|null); + } + + /** Represents an EnumValueOptions. */ + class EnumValueOptions implements IEnumValueOptions { + + /** + * Constructs a new EnumValueOptions. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IEnumValueOptions); + + /** EnumValueOptions deprecated. */ + public deprecated: boolean; + + /** EnumValueOptions uninterpretedOption. */ + public uninterpretedOption: google.protobuf.IUninterpretedOption[]; + + /** + * Creates a new EnumValueOptions instance using the specified properties. + * @param [properties] Properties to set + * @returns EnumValueOptions instance + */ + public static create(properties?: google.protobuf.IEnumValueOptions): google.protobuf.EnumValueOptions; + + /** + * Encodes the specified EnumValueOptions message. Does not implicitly {@link google.protobuf.EnumValueOptions.verify|verify} messages. + * @param message EnumValueOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IEnumValueOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified EnumValueOptions message, length delimited. Does not implicitly {@link google.protobuf.EnumValueOptions.verify|verify} messages. + * @param message EnumValueOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IEnumValueOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an EnumValueOptions message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns EnumValueOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.EnumValueOptions; + + /** + * Decodes an EnumValueOptions message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns EnumValueOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.EnumValueOptions; + + /** + * Verifies an EnumValueOptions message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an EnumValueOptions message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns EnumValueOptions + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.EnumValueOptions; + + /** + * Creates a plain object from an EnumValueOptions message. Also converts values to other types if specified. + * @param message EnumValueOptions + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.EnumValueOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this EnumValueOptions to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for EnumValueOptions + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ServiceOptions. */ + interface IServiceOptions { + + /** ServiceOptions deprecated */ + deprecated?: (boolean|null); + + /** ServiceOptions uninterpretedOption */ + uninterpretedOption?: (google.protobuf.IUninterpretedOption[]|null); + + /** ServiceOptions .google.api.defaultHost */ + ".google.api.defaultHost"?: (string|null); + + /** ServiceOptions .google.api.oauthScopes */ + ".google.api.oauthScopes"?: (string|null); + } + + /** Represents a ServiceOptions. */ + class ServiceOptions implements IServiceOptions { + + /** + * Constructs a new ServiceOptions. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IServiceOptions); + + /** ServiceOptions deprecated. */ + public deprecated: boolean; + + /** ServiceOptions uninterpretedOption. */ + public uninterpretedOption: google.protobuf.IUninterpretedOption[]; + + /** + * Creates a new ServiceOptions instance using the specified properties. + * @param [properties] Properties to set + * @returns ServiceOptions instance + */ + public static create(properties?: google.protobuf.IServiceOptions): google.protobuf.ServiceOptions; + + /** + * Encodes the specified ServiceOptions message. Does not implicitly {@link google.protobuf.ServiceOptions.verify|verify} messages. + * @param message ServiceOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IServiceOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ServiceOptions message, length delimited. Does not implicitly {@link google.protobuf.ServiceOptions.verify|verify} messages. + * @param message ServiceOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IServiceOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ServiceOptions message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ServiceOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.ServiceOptions; + + /** + * Decodes a ServiceOptions message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ServiceOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.ServiceOptions; + + /** + * Verifies a ServiceOptions message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ServiceOptions message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ServiceOptions + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.ServiceOptions; + + /** + * Creates a plain object from a ServiceOptions message. Also converts values to other types if specified. + * @param message ServiceOptions + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.ServiceOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ServiceOptions to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ServiceOptions + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a MethodOptions. */ + interface IMethodOptions { + + /** MethodOptions deprecated */ + deprecated?: (boolean|null); + + /** MethodOptions idempotencyLevel */ + idempotencyLevel?: (google.protobuf.MethodOptions.IdempotencyLevel|keyof typeof google.protobuf.MethodOptions.IdempotencyLevel|null); + + /** MethodOptions uninterpretedOption */ + uninterpretedOption?: (google.protobuf.IUninterpretedOption[]|null); + + /** MethodOptions .google.api.http */ + ".google.api.http"?: (google.api.IHttpRule|null); + + /** MethodOptions .google.api.methodSignature */ + ".google.api.methodSignature"?: (string[]|null); + } + + /** Represents a MethodOptions. */ + class MethodOptions implements IMethodOptions { + + /** + * Constructs a new MethodOptions. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IMethodOptions); + + /** MethodOptions deprecated. */ + public deprecated: boolean; + + /** MethodOptions idempotencyLevel. */ + public idempotencyLevel: (google.protobuf.MethodOptions.IdempotencyLevel|keyof typeof google.protobuf.MethodOptions.IdempotencyLevel); + + /** MethodOptions uninterpretedOption. */ + public uninterpretedOption: google.protobuf.IUninterpretedOption[]; + + /** + * Creates a new MethodOptions instance using the specified properties. + * @param [properties] Properties to set + * @returns MethodOptions instance + */ + public static create(properties?: google.protobuf.IMethodOptions): google.protobuf.MethodOptions; + + /** + * Encodes the specified MethodOptions message. Does not implicitly {@link google.protobuf.MethodOptions.verify|verify} messages. + * @param message MethodOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IMethodOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified MethodOptions message, length delimited. Does not implicitly {@link google.protobuf.MethodOptions.verify|verify} messages. + * @param message MethodOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IMethodOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a MethodOptions message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns MethodOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.MethodOptions; + + /** + * Decodes a MethodOptions message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns MethodOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.MethodOptions; + + /** + * Verifies a MethodOptions message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a MethodOptions message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns MethodOptions + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.MethodOptions; + + /** + * Creates a plain object from a MethodOptions message. Also converts values to other types if specified. + * @param message MethodOptions + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.MethodOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this MethodOptions to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for MethodOptions + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace MethodOptions { + + /** IdempotencyLevel enum. */ + enum IdempotencyLevel { + IDEMPOTENCY_UNKNOWN = 0, + NO_SIDE_EFFECTS = 1, + IDEMPOTENT = 2 + } + } + + /** Properties of an UninterpretedOption. */ + interface IUninterpretedOption { + + /** UninterpretedOption name */ + name?: (google.protobuf.UninterpretedOption.INamePart[]|null); + + /** UninterpretedOption identifierValue */ + identifierValue?: (string|null); + + /** UninterpretedOption positiveIntValue */ + positiveIntValue?: (number|Long|string|null); + + /** UninterpretedOption negativeIntValue */ + negativeIntValue?: (number|Long|string|null); + + /** UninterpretedOption doubleValue */ + doubleValue?: (number|null); + + /** UninterpretedOption stringValue */ + stringValue?: (Uint8Array|string|null); + + /** UninterpretedOption aggregateValue */ + aggregateValue?: (string|null); + } + + /** Represents an UninterpretedOption. */ + class UninterpretedOption implements IUninterpretedOption { + + /** + * Constructs a new UninterpretedOption. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IUninterpretedOption); + + /** UninterpretedOption name. */ + public name: google.protobuf.UninterpretedOption.INamePart[]; + + /** UninterpretedOption identifierValue. */ + public identifierValue: string; + + /** UninterpretedOption positiveIntValue. */ + public positiveIntValue: (number|Long|string); + + /** UninterpretedOption negativeIntValue. */ + public negativeIntValue: (number|Long|string); + + /** UninterpretedOption doubleValue. */ + public doubleValue: number; + + /** UninterpretedOption stringValue. */ + public stringValue: (Uint8Array|string); + + /** UninterpretedOption aggregateValue. */ + public aggregateValue: string; + + /** + * Creates a new UninterpretedOption instance using the specified properties. + * @param [properties] Properties to set + * @returns UninterpretedOption instance + */ + public static create(properties?: google.protobuf.IUninterpretedOption): google.protobuf.UninterpretedOption; + + /** + * Encodes the specified UninterpretedOption message. Does not implicitly {@link google.protobuf.UninterpretedOption.verify|verify} messages. + * @param message UninterpretedOption message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IUninterpretedOption, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified UninterpretedOption message, length delimited. Does not implicitly {@link google.protobuf.UninterpretedOption.verify|verify} messages. + * @param message UninterpretedOption message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IUninterpretedOption, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an UninterpretedOption message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns UninterpretedOption + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.UninterpretedOption; + + /** + * Decodes an UninterpretedOption message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns UninterpretedOption + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.UninterpretedOption; + + /** + * Verifies an UninterpretedOption message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an UninterpretedOption message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns UninterpretedOption + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.UninterpretedOption; + + /** + * Creates a plain object from an UninterpretedOption message. Also converts values to other types if specified. + * @param message UninterpretedOption + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.UninterpretedOption, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this UninterpretedOption to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for UninterpretedOption + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace UninterpretedOption { + + /** Properties of a NamePart. */ + interface INamePart { + + /** NamePart namePart */ + namePart: string; + + /** NamePart isExtension */ + isExtension: boolean; + } + + /** Represents a NamePart. */ + class NamePart implements INamePart { + + /** + * Constructs a new NamePart. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.UninterpretedOption.INamePart); + + /** NamePart namePart. */ + public namePart: string; + + /** NamePart isExtension. */ + public isExtension: boolean; + + /** + * Creates a new NamePart instance using the specified properties. + * @param [properties] Properties to set + * @returns NamePart instance + */ + public static create(properties?: google.protobuf.UninterpretedOption.INamePart): google.protobuf.UninterpretedOption.NamePart; + + /** + * Encodes the specified NamePart message. Does not implicitly {@link google.protobuf.UninterpretedOption.NamePart.verify|verify} messages. + * @param message NamePart message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.UninterpretedOption.INamePart, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified NamePart message, length delimited. Does not implicitly {@link google.protobuf.UninterpretedOption.NamePart.verify|verify} messages. + * @param message NamePart message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.UninterpretedOption.INamePart, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a NamePart message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns NamePart + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.UninterpretedOption.NamePart; + + /** + * Decodes a NamePart message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns NamePart + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.UninterpretedOption.NamePart; + + /** + * Verifies a NamePart message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a NamePart message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns NamePart + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.UninterpretedOption.NamePart; + + /** + * Creates a plain object from a NamePart message. Also converts values to other types if specified. + * @param message NamePart + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.UninterpretedOption.NamePart, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this NamePart to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for NamePart + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Properties of a SourceCodeInfo. */ + interface ISourceCodeInfo { + + /** SourceCodeInfo location */ + location?: (google.protobuf.SourceCodeInfo.ILocation[]|null); + } + + /** Represents a SourceCodeInfo. */ + class SourceCodeInfo implements ISourceCodeInfo { + + /** + * Constructs a new SourceCodeInfo. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.ISourceCodeInfo); + + /** SourceCodeInfo location. */ + public location: google.protobuf.SourceCodeInfo.ILocation[]; + + /** + * Creates a new SourceCodeInfo instance using the specified properties. + * @param [properties] Properties to set + * @returns SourceCodeInfo instance + */ + public static create(properties?: google.protobuf.ISourceCodeInfo): google.protobuf.SourceCodeInfo; + + /** + * Encodes the specified SourceCodeInfo message. Does not implicitly {@link google.protobuf.SourceCodeInfo.verify|verify} messages. + * @param message SourceCodeInfo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.ISourceCodeInfo, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified SourceCodeInfo message, length delimited. Does not implicitly {@link google.protobuf.SourceCodeInfo.verify|verify} messages. + * @param message SourceCodeInfo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.ISourceCodeInfo, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SourceCodeInfo message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns SourceCodeInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.SourceCodeInfo; + + /** + * Decodes a SourceCodeInfo message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns SourceCodeInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.SourceCodeInfo; + + /** + * Verifies a SourceCodeInfo message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a SourceCodeInfo message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns SourceCodeInfo + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.SourceCodeInfo; + + /** + * Creates a plain object from a SourceCodeInfo message. Also converts values to other types if specified. + * @param message SourceCodeInfo + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.SourceCodeInfo, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this SourceCodeInfo to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for SourceCodeInfo + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace SourceCodeInfo { + + /** Properties of a Location. */ + interface ILocation { + + /** Location path */ + path?: (number[]|null); + + /** Location span */ + span?: (number[]|null); + + /** Location leadingComments */ + leadingComments?: (string|null); + + /** Location trailingComments */ + trailingComments?: (string|null); + + /** Location leadingDetachedComments */ + leadingDetachedComments?: (string[]|null); + } + + /** Represents a Location. */ + class Location implements ILocation { + + /** + * Constructs a new Location. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.SourceCodeInfo.ILocation); + + /** Location path. */ + public path: number[]; + + /** Location span. */ + public span: number[]; + + /** Location leadingComments. */ + public leadingComments: string; + + /** Location trailingComments. */ + public trailingComments: string; + + /** Location leadingDetachedComments. */ + public leadingDetachedComments: string[]; + + /** + * Creates a new Location instance using the specified properties. + * @param [properties] Properties to set + * @returns Location instance + */ + public static create(properties?: google.protobuf.SourceCodeInfo.ILocation): google.protobuf.SourceCodeInfo.Location; + + /** + * Encodes the specified Location message. Does not implicitly {@link google.protobuf.SourceCodeInfo.Location.verify|verify} messages. + * @param message Location message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.SourceCodeInfo.ILocation, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Location message, length delimited. Does not implicitly {@link google.protobuf.SourceCodeInfo.Location.verify|verify} messages. + * @param message Location message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.SourceCodeInfo.ILocation, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Location message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Location + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.SourceCodeInfo.Location; + + /** + * Decodes a Location message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Location + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.SourceCodeInfo.Location; + + /** + * Verifies a Location message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Location message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Location + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.SourceCodeInfo.Location; + + /** + * Creates a plain object from a Location message. Also converts values to other types if specified. + * @param message Location + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.SourceCodeInfo.Location, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Location to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Location + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Properties of a GeneratedCodeInfo. */ + interface IGeneratedCodeInfo { + + /** GeneratedCodeInfo annotation */ + annotation?: (google.protobuf.GeneratedCodeInfo.IAnnotation[]|null); + } + + /** Represents a GeneratedCodeInfo. */ + class GeneratedCodeInfo implements IGeneratedCodeInfo { + + /** + * Constructs a new GeneratedCodeInfo. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IGeneratedCodeInfo); + + /** GeneratedCodeInfo annotation. */ + public annotation: google.protobuf.GeneratedCodeInfo.IAnnotation[]; + + /** + * Creates a new GeneratedCodeInfo instance using the specified properties. + * @param [properties] Properties to set + * @returns GeneratedCodeInfo instance + */ + public static create(properties?: google.protobuf.IGeneratedCodeInfo): google.protobuf.GeneratedCodeInfo; + + /** + * Encodes the specified GeneratedCodeInfo message. Does not implicitly {@link google.protobuf.GeneratedCodeInfo.verify|verify} messages. + * @param message GeneratedCodeInfo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IGeneratedCodeInfo, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GeneratedCodeInfo message, length delimited. Does not implicitly {@link google.protobuf.GeneratedCodeInfo.verify|verify} messages. + * @param message GeneratedCodeInfo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IGeneratedCodeInfo, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GeneratedCodeInfo message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GeneratedCodeInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.GeneratedCodeInfo; + + /** + * Decodes a GeneratedCodeInfo message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GeneratedCodeInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.GeneratedCodeInfo; + + /** + * Verifies a GeneratedCodeInfo message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GeneratedCodeInfo message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GeneratedCodeInfo + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.GeneratedCodeInfo; + + /** + * Creates a plain object from a GeneratedCodeInfo message. Also converts values to other types if specified. + * @param message GeneratedCodeInfo + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.GeneratedCodeInfo, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GeneratedCodeInfo to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GeneratedCodeInfo + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace GeneratedCodeInfo { + + /** Properties of an Annotation. */ + interface IAnnotation { + + /** Annotation path */ + path?: (number[]|null); + + /** Annotation sourceFile */ + sourceFile?: (string|null); + + /** Annotation begin */ + begin?: (number|null); + + /** Annotation end */ + end?: (number|null); + + /** Annotation semantic */ + semantic?: (google.protobuf.GeneratedCodeInfo.Annotation.Semantic|keyof typeof google.protobuf.GeneratedCodeInfo.Annotation.Semantic|null); + } + + /** Represents an Annotation. */ + class Annotation implements IAnnotation { + + /** + * Constructs a new Annotation. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.GeneratedCodeInfo.IAnnotation); + + /** Annotation path. */ + public path: number[]; + + /** Annotation sourceFile. */ + public sourceFile: string; + + /** Annotation begin. */ + public begin: number; + + /** Annotation end. */ + public end: number; + + /** Annotation semantic. */ + public semantic: (google.protobuf.GeneratedCodeInfo.Annotation.Semantic|keyof typeof google.protobuf.GeneratedCodeInfo.Annotation.Semantic); + + /** + * Creates a new Annotation instance using the specified properties. + * @param [properties] Properties to set + * @returns Annotation instance + */ + public static create(properties?: google.protobuf.GeneratedCodeInfo.IAnnotation): google.protobuf.GeneratedCodeInfo.Annotation; + + /** + * Encodes the specified Annotation message. Does not implicitly {@link google.protobuf.GeneratedCodeInfo.Annotation.verify|verify} messages. + * @param message Annotation message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.GeneratedCodeInfo.IAnnotation, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Annotation message, length delimited. Does not implicitly {@link google.protobuf.GeneratedCodeInfo.Annotation.verify|verify} messages. + * @param message Annotation message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.GeneratedCodeInfo.IAnnotation, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an Annotation message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Annotation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.GeneratedCodeInfo.Annotation; + + /** + * Decodes an Annotation message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Annotation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.GeneratedCodeInfo.Annotation; + + /** + * Verifies an Annotation message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an Annotation message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Annotation + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.GeneratedCodeInfo.Annotation; + + /** + * Creates a plain object from an Annotation message. Also converts values to other types if specified. + * @param message Annotation + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.GeneratedCodeInfo.Annotation, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Annotation to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Annotation + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace Annotation { + + /** Semantic enum. */ + enum Semantic { + NONE = 0, + SET = 1, + ALIAS = 2 + } + } + } + + /** Properties of a 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 Empty. */ + interface IEmpty { + } + + /** Represents an Empty. */ + class Empty implements IEmpty { + + /** + * Constructs a new Empty. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IEmpty); + + /** + * Creates a new Empty instance using the specified properties. + * @param [properties] Properties to set + * @returns Empty instance + */ + public static create(properties?: google.protobuf.IEmpty): google.protobuf.Empty; + + /** + * Encodes the specified Empty message. Does not implicitly {@link google.protobuf.Empty.verify|verify} messages. + * @param message Empty message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IEmpty, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Empty message, length delimited. Does not implicitly {@link google.protobuf.Empty.verify|verify} messages. + * @param message Empty message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IEmpty, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an Empty message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Empty + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.Empty; + + /** + * Decodes an Empty message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Empty + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.Empty; + + /** + * Verifies an Empty message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an Empty message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Empty + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.Empty; + + /** + * Creates a plain object from an Empty message. Also converts values to other types if specified. + * @param message Empty + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.Empty, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Empty to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Empty + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a FieldMask. */ + interface IFieldMask { + + /** FieldMask paths */ + paths?: (string[]|null); + } + + /** Represents a FieldMask. */ + class FieldMask implements IFieldMask { + + /** + * Constructs a new FieldMask. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IFieldMask); + + /** FieldMask paths. */ + public paths: string[]; + + /** + * Creates a new FieldMask instance using the specified properties. + * @param [properties] Properties to set + * @returns FieldMask instance + */ + public static create(properties?: google.protobuf.IFieldMask): google.protobuf.FieldMask; + + /** + * Encodes the specified FieldMask message. Does not implicitly {@link google.protobuf.FieldMask.verify|verify} messages. + * @param message FieldMask message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IFieldMask, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified FieldMask message, length delimited. Does not implicitly {@link google.protobuf.FieldMask.verify|verify} messages. + * @param message FieldMask message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IFieldMask, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FieldMask message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns FieldMask + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.FieldMask; + + /** + * Decodes a FieldMask message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns FieldMask + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.FieldMask; + + /** + * Verifies a FieldMask message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a FieldMask message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns FieldMask + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.FieldMask; + + /** + * Creates a plain object from a FieldMask message. Also converts values to other types if specified. + * @param message FieldMask + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.FieldMask, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this FieldMask to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for FieldMask + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } +} diff --git a/packages/google-cloud-websecurityscanner/protos/protos.js b/packages/google-cloud-websecurityscanner/protos/protos.js new file mode 100644 index 00000000000..c1c663e51f7 --- /dev/null +++ b/packages/google-cloud-websecurityscanner/protos/protos.js @@ -0,0 +1,43992 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*eslint-disable block-scoped-var, id-length, no-control-regex, no-magic-numbers, no-prototype-builtins, no-redeclare, no-shadow, no-var, sort-vars*/ +(function(global, factory) { /* global define, require, module */ + + /* AMD */ if (typeof define === 'function' && define.amd) + define(["protobufjs/minimal"], factory); + + /* CommonJS */ else if (typeof require === 'function' && typeof module === 'object' && module && module.exports) + module.exports = factory(require("google-gax/build/src/protobuf").protobufMinimal); + +})(this, function($protobuf) { + "use strict"; + + // Common aliases + var $Reader = $protobuf.Reader, $Writer = $protobuf.Writer, $util = $protobuf.util; + + // Exported root namespace + var $root = $protobuf.roots._google_cloud_web_security_scanner_protos || ($protobuf.roots._google_cloud_web_security_scanner_protos = {}); + + $root.google = (function() { + + /** + * Namespace google. + * @exports google + * @namespace + */ + var google = {}; + + google.cloud = (function() { + + /** + * Namespace cloud. + * @memberof google + * @namespace + */ + var cloud = {}; + + cloud.websecurityscanner = (function() { + + /** + * Namespace websecurityscanner. + * @memberof google.cloud + * @namespace + */ + var websecurityscanner = {}; + + websecurityscanner.v1 = (function() { + + /** + * Namespace v1. + * @memberof google.cloud.websecurityscanner + * @namespace + */ + var v1 = {}; + + v1.CrawledUrl = (function() { + + /** + * Properties of a CrawledUrl. + * @memberof google.cloud.websecurityscanner.v1 + * @interface ICrawledUrl + * @property {string|null} [httpMethod] CrawledUrl httpMethod + * @property {string|null} [url] CrawledUrl url + * @property {string|null} [body] CrawledUrl body + */ + + /** + * Constructs a new CrawledUrl. + * @memberof google.cloud.websecurityscanner.v1 + * @classdesc Represents a CrawledUrl. + * @implements ICrawledUrl + * @constructor + * @param {google.cloud.websecurityscanner.v1.ICrawledUrl=} [properties] Properties to set + */ + function CrawledUrl(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * CrawledUrl httpMethod. + * @member {string} httpMethod + * @memberof google.cloud.websecurityscanner.v1.CrawledUrl + * @instance + */ + CrawledUrl.prototype.httpMethod = ""; + + /** + * CrawledUrl url. + * @member {string} url + * @memberof google.cloud.websecurityscanner.v1.CrawledUrl + * @instance + */ + CrawledUrl.prototype.url = ""; + + /** + * CrawledUrl body. + * @member {string} body + * @memberof google.cloud.websecurityscanner.v1.CrawledUrl + * @instance + */ + CrawledUrl.prototype.body = ""; + + /** + * Creates a new CrawledUrl instance using the specified properties. + * @function create + * @memberof google.cloud.websecurityscanner.v1.CrawledUrl + * @static + * @param {google.cloud.websecurityscanner.v1.ICrawledUrl=} [properties] Properties to set + * @returns {google.cloud.websecurityscanner.v1.CrawledUrl} CrawledUrl instance + */ + CrawledUrl.create = function create(properties) { + return new CrawledUrl(properties); + }; + + /** + * Encodes the specified CrawledUrl message. Does not implicitly {@link google.cloud.websecurityscanner.v1.CrawledUrl.verify|verify} messages. + * @function encode + * @memberof google.cloud.websecurityscanner.v1.CrawledUrl + * @static + * @param {google.cloud.websecurityscanner.v1.ICrawledUrl} message CrawledUrl message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CrawledUrl.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.httpMethod != null && Object.hasOwnProperty.call(message, "httpMethod")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.httpMethod); + if (message.url != null && Object.hasOwnProperty.call(message, "url")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.url); + if (message.body != null && Object.hasOwnProperty.call(message, "body")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.body); + return writer; + }; + + /** + * Encodes the specified CrawledUrl message, length delimited. Does not implicitly {@link google.cloud.websecurityscanner.v1.CrawledUrl.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.websecurityscanner.v1.CrawledUrl + * @static + * @param {google.cloud.websecurityscanner.v1.ICrawledUrl} message CrawledUrl message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CrawledUrl.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CrawledUrl message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.websecurityscanner.v1.CrawledUrl + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.websecurityscanner.v1.CrawledUrl} CrawledUrl + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CrawledUrl.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.websecurityscanner.v1.CrawledUrl(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.httpMethod = reader.string(); + break; + } + case 2: { + message.url = reader.string(); + break; + } + case 3: { + message.body = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CrawledUrl message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.websecurityscanner.v1.CrawledUrl + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.websecurityscanner.v1.CrawledUrl} CrawledUrl + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CrawledUrl.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CrawledUrl message. + * @function verify + * @memberof google.cloud.websecurityscanner.v1.CrawledUrl + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CrawledUrl.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.httpMethod != null && message.hasOwnProperty("httpMethod")) + if (!$util.isString(message.httpMethod)) + return "httpMethod: string expected"; + if (message.url != null && message.hasOwnProperty("url")) + if (!$util.isString(message.url)) + return "url: string expected"; + if (message.body != null && message.hasOwnProperty("body")) + if (!$util.isString(message.body)) + return "body: string expected"; + return null; + }; + + /** + * Creates a CrawledUrl message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.websecurityscanner.v1.CrawledUrl + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.websecurityscanner.v1.CrawledUrl} CrawledUrl + */ + CrawledUrl.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.websecurityscanner.v1.CrawledUrl) + return object; + var message = new $root.google.cloud.websecurityscanner.v1.CrawledUrl(); + if (object.httpMethod != null) + message.httpMethod = String(object.httpMethod); + if (object.url != null) + message.url = String(object.url); + if (object.body != null) + message.body = String(object.body); + return message; + }; + + /** + * Creates a plain object from a CrawledUrl message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.websecurityscanner.v1.CrawledUrl + * @static + * @param {google.cloud.websecurityscanner.v1.CrawledUrl} message CrawledUrl + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CrawledUrl.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.httpMethod = ""; + object.url = ""; + object.body = ""; + } + if (message.httpMethod != null && message.hasOwnProperty("httpMethod")) + object.httpMethod = message.httpMethod; + if (message.url != null && message.hasOwnProperty("url")) + object.url = message.url; + if (message.body != null && message.hasOwnProperty("body")) + object.body = message.body; + return object; + }; + + /** + * Converts this CrawledUrl to JSON. + * @function toJSON + * @memberof google.cloud.websecurityscanner.v1.CrawledUrl + * @instance + * @returns {Object.} JSON object + */ + CrawledUrl.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CrawledUrl + * @function getTypeUrl + * @memberof google.cloud.websecurityscanner.v1.CrawledUrl + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CrawledUrl.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.websecurityscanner.v1.CrawledUrl"; + }; + + return CrawledUrl; + })(); + + v1.Finding = (function() { + + /** + * Properties of a Finding. + * @memberof google.cloud.websecurityscanner.v1 + * @interface IFinding + * @property {string|null} [name] Finding name + * @property {string|null} [findingType] Finding findingType + * @property {google.cloud.websecurityscanner.v1.Finding.Severity|null} [severity] Finding severity + * @property {string|null} [httpMethod] Finding httpMethod + * @property {string|null} [fuzzedUrl] Finding fuzzedUrl + * @property {string|null} [body] Finding body + * @property {string|null} [description] Finding description + * @property {string|null} [reproductionUrl] Finding reproductionUrl + * @property {string|null} [frameUrl] Finding frameUrl + * @property {string|null} [finalUrl] Finding finalUrl + * @property {string|null} [trackingId] Finding trackingId + * @property {google.cloud.websecurityscanner.v1.IForm|null} [form] Finding form + * @property {google.cloud.websecurityscanner.v1.IOutdatedLibrary|null} [outdatedLibrary] Finding outdatedLibrary + * @property {google.cloud.websecurityscanner.v1.IViolatingResource|null} [violatingResource] Finding violatingResource + * @property {google.cloud.websecurityscanner.v1.IVulnerableHeaders|null} [vulnerableHeaders] Finding vulnerableHeaders + * @property {google.cloud.websecurityscanner.v1.IVulnerableParameters|null} [vulnerableParameters] Finding vulnerableParameters + * @property {google.cloud.websecurityscanner.v1.IXss|null} [xss] Finding xss + * @property {google.cloud.websecurityscanner.v1.IXxe|null} [xxe] Finding xxe + */ + + /** + * Constructs a new Finding. + * @memberof google.cloud.websecurityscanner.v1 + * @classdesc Represents a Finding. + * @implements IFinding + * @constructor + * @param {google.cloud.websecurityscanner.v1.IFinding=} [properties] Properties to set + */ + function Finding(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Finding name. + * @member {string} name + * @memberof google.cloud.websecurityscanner.v1.Finding + * @instance + */ + Finding.prototype.name = ""; + + /** + * Finding findingType. + * @member {string} findingType + * @memberof google.cloud.websecurityscanner.v1.Finding + * @instance + */ + Finding.prototype.findingType = ""; + + /** + * Finding severity. + * @member {google.cloud.websecurityscanner.v1.Finding.Severity} severity + * @memberof google.cloud.websecurityscanner.v1.Finding + * @instance + */ + Finding.prototype.severity = 0; + + /** + * Finding httpMethod. + * @member {string} httpMethod + * @memberof google.cloud.websecurityscanner.v1.Finding + * @instance + */ + Finding.prototype.httpMethod = ""; + + /** + * Finding fuzzedUrl. + * @member {string} fuzzedUrl + * @memberof google.cloud.websecurityscanner.v1.Finding + * @instance + */ + Finding.prototype.fuzzedUrl = ""; + + /** + * Finding body. + * @member {string} body + * @memberof google.cloud.websecurityscanner.v1.Finding + * @instance + */ + Finding.prototype.body = ""; + + /** + * Finding description. + * @member {string} description + * @memberof google.cloud.websecurityscanner.v1.Finding + * @instance + */ + Finding.prototype.description = ""; + + /** + * Finding reproductionUrl. + * @member {string} reproductionUrl + * @memberof google.cloud.websecurityscanner.v1.Finding + * @instance + */ + Finding.prototype.reproductionUrl = ""; + + /** + * Finding frameUrl. + * @member {string} frameUrl + * @memberof google.cloud.websecurityscanner.v1.Finding + * @instance + */ + Finding.prototype.frameUrl = ""; + + /** + * Finding finalUrl. + * @member {string} finalUrl + * @memberof google.cloud.websecurityscanner.v1.Finding + * @instance + */ + Finding.prototype.finalUrl = ""; + + /** + * Finding trackingId. + * @member {string} trackingId + * @memberof google.cloud.websecurityscanner.v1.Finding + * @instance + */ + Finding.prototype.trackingId = ""; + + /** + * Finding form. + * @member {google.cloud.websecurityscanner.v1.IForm|null|undefined} form + * @memberof google.cloud.websecurityscanner.v1.Finding + * @instance + */ + Finding.prototype.form = null; + + /** + * Finding outdatedLibrary. + * @member {google.cloud.websecurityscanner.v1.IOutdatedLibrary|null|undefined} outdatedLibrary + * @memberof google.cloud.websecurityscanner.v1.Finding + * @instance + */ + Finding.prototype.outdatedLibrary = null; + + /** + * Finding violatingResource. + * @member {google.cloud.websecurityscanner.v1.IViolatingResource|null|undefined} violatingResource + * @memberof google.cloud.websecurityscanner.v1.Finding + * @instance + */ + Finding.prototype.violatingResource = null; + + /** + * Finding vulnerableHeaders. + * @member {google.cloud.websecurityscanner.v1.IVulnerableHeaders|null|undefined} vulnerableHeaders + * @memberof google.cloud.websecurityscanner.v1.Finding + * @instance + */ + Finding.prototype.vulnerableHeaders = null; + + /** + * Finding vulnerableParameters. + * @member {google.cloud.websecurityscanner.v1.IVulnerableParameters|null|undefined} vulnerableParameters + * @memberof google.cloud.websecurityscanner.v1.Finding + * @instance + */ + Finding.prototype.vulnerableParameters = null; + + /** + * Finding xss. + * @member {google.cloud.websecurityscanner.v1.IXss|null|undefined} xss + * @memberof google.cloud.websecurityscanner.v1.Finding + * @instance + */ + Finding.prototype.xss = null; + + /** + * Finding xxe. + * @member {google.cloud.websecurityscanner.v1.IXxe|null|undefined} xxe + * @memberof google.cloud.websecurityscanner.v1.Finding + * @instance + */ + Finding.prototype.xxe = null; + + /** + * Creates a new Finding instance using the specified properties. + * @function create + * @memberof google.cloud.websecurityscanner.v1.Finding + * @static + * @param {google.cloud.websecurityscanner.v1.IFinding=} [properties] Properties to set + * @returns {google.cloud.websecurityscanner.v1.Finding} Finding instance + */ + Finding.create = function create(properties) { + return new Finding(properties); + }; + + /** + * Encodes the specified Finding message. Does not implicitly {@link google.cloud.websecurityscanner.v1.Finding.verify|verify} messages. + * @function encode + * @memberof google.cloud.websecurityscanner.v1.Finding + * @static + * @param {google.cloud.websecurityscanner.v1.IFinding} message Finding message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Finding.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.findingType != null && Object.hasOwnProperty.call(message, "findingType")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.findingType); + if (message.httpMethod != null && Object.hasOwnProperty.call(message, "httpMethod")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.httpMethod); + if (message.fuzzedUrl != null && Object.hasOwnProperty.call(message, "fuzzedUrl")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.fuzzedUrl); + if (message.body != null && Object.hasOwnProperty.call(message, "body")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.body); + if (message.description != null && Object.hasOwnProperty.call(message, "description")) + writer.uint32(/* id 6, wireType 2 =*/50).string(message.description); + if (message.reproductionUrl != null && Object.hasOwnProperty.call(message, "reproductionUrl")) + writer.uint32(/* id 7, wireType 2 =*/58).string(message.reproductionUrl); + if (message.frameUrl != null && Object.hasOwnProperty.call(message, "frameUrl")) + writer.uint32(/* id 8, wireType 2 =*/66).string(message.frameUrl); + if (message.finalUrl != null && Object.hasOwnProperty.call(message, "finalUrl")) + writer.uint32(/* id 9, wireType 2 =*/74).string(message.finalUrl); + if (message.trackingId != null && Object.hasOwnProperty.call(message, "trackingId")) + writer.uint32(/* id 10, wireType 2 =*/82).string(message.trackingId); + if (message.outdatedLibrary != null && Object.hasOwnProperty.call(message, "outdatedLibrary")) + $root.google.cloud.websecurityscanner.v1.OutdatedLibrary.encode(message.outdatedLibrary, writer.uint32(/* id 11, wireType 2 =*/90).fork()).ldelim(); + if (message.violatingResource != null && Object.hasOwnProperty.call(message, "violatingResource")) + $root.google.cloud.websecurityscanner.v1.ViolatingResource.encode(message.violatingResource, writer.uint32(/* id 12, wireType 2 =*/98).fork()).ldelim(); + if (message.vulnerableParameters != null && Object.hasOwnProperty.call(message, "vulnerableParameters")) + $root.google.cloud.websecurityscanner.v1.VulnerableParameters.encode(message.vulnerableParameters, writer.uint32(/* id 13, wireType 2 =*/106).fork()).ldelim(); + if (message.xss != null && Object.hasOwnProperty.call(message, "xss")) + $root.google.cloud.websecurityscanner.v1.Xss.encode(message.xss, writer.uint32(/* id 14, wireType 2 =*/114).fork()).ldelim(); + if (message.vulnerableHeaders != null && Object.hasOwnProperty.call(message, "vulnerableHeaders")) + $root.google.cloud.websecurityscanner.v1.VulnerableHeaders.encode(message.vulnerableHeaders, writer.uint32(/* id 15, wireType 2 =*/122).fork()).ldelim(); + if (message.form != null && Object.hasOwnProperty.call(message, "form")) + $root.google.cloud.websecurityscanner.v1.Form.encode(message.form, writer.uint32(/* id 16, wireType 2 =*/130).fork()).ldelim(); + if (message.severity != null && Object.hasOwnProperty.call(message, "severity")) + writer.uint32(/* id 17, wireType 0 =*/136).int32(message.severity); + if (message.xxe != null && Object.hasOwnProperty.call(message, "xxe")) + $root.google.cloud.websecurityscanner.v1.Xxe.encode(message.xxe, writer.uint32(/* id 18, wireType 2 =*/146).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified Finding message, length delimited. Does not implicitly {@link google.cloud.websecurityscanner.v1.Finding.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.websecurityscanner.v1.Finding + * @static + * @param {google.cloud.websecurityscanner.v1.IFinding} message Finding message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Finding.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Finding message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.websecurityscanner.v1.Finding + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.websecurityscanner.v1.Finding} Finding + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Finding.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.websecurityscanner.v1.Finding(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.findingType = reader.string(); + break; + } + case 17: { + message.severity = reader.int32(); + break; + } + case 3: { + message.httpMethod = reader.string(); + break; + } + case 4: { + message.fuzzedUrl = reader.string(); + break; + } + case 5: { + message.body = reader.string(); + break; + } + case 6: { + message.description = reader.string(); + break; + } + case 7: { + message.reproductionUrl = reader.string(); + break; + } + case 8: { + message.frameUrl = reader.string(); + break; + } + case 9: { + message.finalUrl = reader.string(); + break; + } + case 10: { + message.trackingId = reader.string(); + break; + } + case 16: { + message.form = $root.google.cloud.websecurityscanner.v1.Form.decode(reader, reader.uint32()); + break; + } + case 11: { + message.outdatedLibrary = $root.google.cloud.websecurityscanner.v1.OutdatedLibrary.decode(reader, reader.uint32()); + break; + } + case 12: { + message.violatingResource = $root.google.cloud.websecurityscanner.v1.ViolatingResource.decode(reader, reader.uint32()); + break; + } + case 15: { + message.vulnerableHeaders = $root.google.cloud.websecurityscanner.v1.VulnerableHeaders.decode(reader, reader.uint32()); + break; + } + case 13: { + message.vulnerableParameters = $root.google.cloud.websecurityscanner.v1.VulnerableParameters.decode(reader, reader.uint32()); + break; + } + case 14: { + message.xss = $root.google.cloud.websecurityscanner.v1.Xss.decode(reader, reader.uint32()); + break; + } + case 18: { + message.xxe = $root.google.cloud.websecurityscanner.v1.Xxe.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Finding message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.websecurityscanner.v1.Finding + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.websecurityscanner.v1.Finding} Finding + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Finding.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Finding message. + * @function verify + * @memberof google.cloud.websecurityscanner.v1.Finding + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Finding.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.findingType != null && message.hasOwnProperty("findingType")) + if (!$util.isString(message.findingType)) + return "findingType: string expected"; + if (message.severity != null && message.hasOwnProperty("severity")) + switch (message.severity) { + default: + return "severity: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + break; + } + if (message.httpMethod != null && message.hasOwnProperty("httpMethod")) + if (!$util.isString(message.httpMethod)) + return "httpMethod: string expected"; + if (message.fuzzedUrl != null && message.hasOwnProperty("fuzzedUrl")) + if (!$util.isString(message.fuzzedUrl)) + return "fuzzedUrl: string expected"; + if (message.body != null && message.hasOwnProperty("body")) + if (!$util.isString(message.body)) + return "body: string expected"; + if (message.description != null && message.hasOwnProperty("description")) + if (!$util.isString(message.description)) + return "description: string expected"; + if (message.reproductionUrl != null && message.hasOwnProperty("reproductionUrl")) + if (!$util.isString(message.reproductionUrl)) + return "reproductionUrl: string expected"; + if (message.frameUrl != null && message.hasOwnProperty("frameUrl")) + if (!$util.isString(message.frameUrl)) + return "frameUrl: string expected"; + if (message.finalUrl != null && message.hasOwnProperty("finalUrl")) + if (!$util.isString(message.finalUrl)) + return "finalUrl: string expected"; + if (message.trackingId != null && message.hasOwnProperty("trackingId")) + if (!$util.isString(message.trackingId)) + return "trackingId: string expected"; + if (message.form != null && message.hasOwnProperty("form")) { + var error = $root.google.cloud.websecurityscanner.v1.Form.verify(message.form); + if (error) + return "form." + error; + } + if (message.outdatedLibrary != null && message.hasOwnProperty("outdatedLibrary")) { + var error = $root.google.cloud.websecurityscanner.v1.OutdatedLibrary.verify(message.outdatedLibrary); + if (error) + return "outdatedLibrary." + error; + } + if (message.violatingResource != null && message.hasOwnProperty("violatingResource")) { + var error = $root.google.cloud.websecurityscanner.v1.ViolatingResource.verify(message.violatingResource); + if (error) + return "violatingResource." + error; + } + if (message.vulnerableHeaders != null && message.hasOwnProperty("vulnerableHeaders")) { + var error = $root.google.cloud.websecurityscanner.v1.VulnerableHeaders.verify(message.vulnerableHeaders); + if (error) + return "vulnerableHeaders." + error; + } + if (message.vulnerableParameters != null && message.hasOwnProperty("vulnerableParameters")) { + var error = $root.google.cloud.websecurityscanner.v1.VulnerableParameters.verify(message.vulnerableParameters); + if (error) + return "vulnerableParameters." + error; + } + if (message.xss != null && message.hasOwnProperty("xss")) { + var error = $root.google.cloud.websecurityscanner.v1.Xss.verify(message.xss); + if (error) + return "xss." + error; + } + if (message.xxe != null && message.hasOwnProperty("xxe")) { + var error = $root.google.cloud.websecurityscanner.v1.Xxe.verify(message.xxe); + if (error) + return "xxe." + error; + } + return null; + }; + + /** + * Creates a Finding message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.websecurityscanner.v1.Finding + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.websecurityscanner.v1.Finding} Finding + */ + Finding.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.websecurityscanner.v1.Finding) + return object; + var message = new $root.google.cloud.websecurityscanner.v1.Finding(); + if (object.name != null) + message.name = String(object.name); + if (object.findingType != null) + message.findingType = String(object.findingType); + switch (object.severity) { + default: + if (typeof object.severity === "number") { + message.severity = object.severity; + break; + } + break; + case "SEVERITY_UNSPECIFIED": + case 0: + message.severity = 0; + break; + case "CRITICAL": + case 1: + message.severity = 1; + break; + case "HIGH": + case 2: + message.severity = 2; + break; + case "MEDIUM": + case 3: + message.severity = 3; + break; + case "LOW": + case 4: + message.severity = 4; + break; + } + if (object.httpMethod != null) + message.httpMethod = String(object.httpMethod); + if (object.fuzzedUrl != null) + message.fuzzedUrl = String(object.fuzzedUrl); + if (object.body != null) + message.body = String(object.body); + if (object.description != null) + message.description = String(object.description); + if (object.reproductionUrl != null) + message.reproductionUrl = String(object.reproductionUrl); + if (object.frameUrl != null) + message.frameUrl = String(object.frameUrl); + if (object.finalUrl != null) + message.finalUrl = String(object.finalUrl); + if (object.trackingId != null) + message.trackingId = String(object.trackingId); + if (object.form != null) { + if (typeof object.form !== "object") + throw TypeError(".google.cloud.websecurityscanner.v1.Finding.form: object expected"); + message.form = $root.google.cloud.websecurityscanner.v1.Form.fromObject(object.form); + } + if (object.outdatedLibrary != null) { + if (typeof object.outdatedLibrary !== "object") + throw TypeError(".google.cloud.websecurityscanner.v1.Finding.outdatedLibrary: object expected"); + message.outdatedLibrary = $root.google.cloud.websecurityscanner.v1.OutdatedLibrary.fromObject(object.outdatedLibrary); + } + if (object.violatingResource != null) { + if (typeof object.violatingResource !== "object") + throw TypeError(".google.cloud.websecurityscanner.v1.Finding.violatingResource: object expected"); + message.violatingResource = $root.google.cloud.websecurityscanner.v1.ViolatingResource.fromObject(object.violatingResource); + } + if (object.vulnerableHeaders != null) { + if (typeof object.vulnerableHeaders !== "object") + throw TypeError(".google.cloud.websecurityscanner.v1.Finding.vulnerableHeaders: object expected"); + message.vulnerableHeaders = $root.google.cloud.websecurityscanner.v1.VulnerableHeaders.fromObject(object.vulnerableHeaders); + } + if (object.vulnerableParameters != null) { + if (typeof object.vulnerableParameters !== "object") + throw TypeError(".google.cloud.websecurityscanner.v1.Finding.vulnerableParameters: object expected"); + message.vulnerableParameters = $root.google.cloud.websecurityscanner.v1.VulnerableParameters.fromObject(object.vulnerableParameters); + } + if (object.xss != null) { + if (typeof object.xss !== "object") + throw TypeError(".google.cloud.websecurityscanner.v1.Finding.xss: object expected"); + message.xss = $root.google.cloud.websecurityscanner.v1.Xss.fromObject(object.xss); + } + if (object.xxe != null) { + if (typeof object.xxe !== "object") + throw TypeError(".google.cloud.websecurityscanner.v1.Finding.xxe: object expected"); + message.xxe = $root.google.cloud.websecurityscanner.v1.Xxe.fromObject(object.xxe); + } + return message; + }; + + /** + * Creates a plain object from a Finding message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.websecurityscanner.v1.Finding + * @static + * @param {google.cloud.websecurityscanner.v1.Finding} message Finding + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Finding.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.findingType = ""; + object.httpMethod = ""; + object.fuzzedUrl = ""; + object.body = ""; + object.description = ""; + object.reproductionUrl = ""; + object.frameUrl = ""; + object.finalUrl = ""; + object.trackingId = ""; + object.outdatedLibrary = null; + object.violatingResource = null; + object.vulnerableParameters = null; + object.xss = null; + object.vulnerableHeaders = null; + object.form = null; + object.severity = options.enums === String ? "SEVERITY_UNSPECIFIED" : 0; + object.xxe = null; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.findingType != null && message.hasOwnProperty("findingType")) + object.findingType = message.findingType; + if (message.httpMethod != null && message.hasOwnProperty("httpMethod")) + object.httpMethod = message.httpMethod; + if (message.fuzzedUrl != null && message.hasOwnProperty("fuzzedUrl")) + object.fuzzedUrl = message.fuzzedUrl; + if (message.body != null && message.hasOwnProperty("body")) + object.body = message.body; + if (message.description != null && message.hasOwnProperty("description")) + object.description = message.description; + if (message.reproductionUrl != null && message.hasOwnProperty("reproductionUrl")) + object.reproductionUrl = message.reproductionUrl; + if (message.frameUrl != null && message.hasOwnProperty("frameUrl")) + object.frameUrl = message.frameUrl; + if (message.finalUrl != null && message.hasOwnProperty("finalUrl")) + object.finalUrl = message.finalUrl; + if (message.trackingId != null && message.hasOwnProperty("trackingId")) + object.trackingId = message.trackingId; + if (message.outdatedLibrary != null && message.hasOwnProperty("outdatedLibrary")) + object.outdatedLibrary = $root.google.cloud.websecurityscanner.v1.OutdatedLibrary.toObject(message.outdatedLibrary, options); + if (message.violatingResource != null && message.hasOwnProperty("violatingResource")) + object.violatingResource = $root.google.cloud.websecurityscanner.v1.ViolatingResource.toObject(message.violatingResource, options); + if (message.vulnerableParameters != null && message.hasOwnProperty("vulnerableParameters")) + object.vulnerableParameters = $root.google.cloud.websecurityscanner.v1.VulnerableParameters.toObject(message.vulnerableParameters, options); + if (message.xss != null && message.hasOwnProperty("xss")) + object.xss = $root.google.cloud.websecurityscanner.v1.Xss.toObject(message.xss, options); + if (message.vulnerableHeaders != null && message.hasOwnProperty("vulnerableHeaders")) + object.vulnerableHeaders = $root.google.cloud.websecurityscanner.v1.VulnerableHeaders.toObject(message.vulnerableHeaders, options); + if (message.form != null && message.hasOwnProperty("form")) + object.form = $root.google.cloud.websecurityscanner.v1.Form.toObject(message.form, options); + if (message.severity != null && message.hasOwnProperty("severity")) + object.severity = options.enums === String ? $root.google.cloud.websecurityscanner.v1.Finding.Severity[message.severity] === undefined ? message.severity : $root.google.cloud.websecurityscanner.v1.Finding.Severity[message.severity] : message.severity; + if (message.xxe != null && message.hasOwnProperty("xxe")) + object.xxe = $root.google.cloud.websecurityscanner.v1.Xxe.toObject(message.xxe, options); + return object; + }; + + /** + * Converts this Finding to JSON. + * @function toJSON + * @memberof google.cloud.websecurityscanner.v1.Finding + * @instance + * @returns {Object.} JSON object + */ + Finding.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Finding + * @function getTypeUrl + * @memberof google.cloud.websecurityscanner.v1.Finding + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Finding.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.websecurityscanner.v1.Finding"; + }; + + /** + * Severity enum. + * @name google.cloud.websecurityscanner.v1.Finding.Severity + * @enum {number} + * @property {number} SEVERITY_UNSPECIFIED=0 SEVERITY_UNSPECIFIED value + * @property {number} CRITICAL=1 CRITICAL value + * @property {number} HIGH=2 HIGH value + * @property {number} MEDIUM=3 MEDIUM value + * @property {number} LOW=4 LOW value + */ + Finding.Severity = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "SEVERITY_UNSPECIFIED"] = 0; + values[valuesById[1] = "CRITICAL"] = 1; + values[valuesById[2] = "HIGH"] = 2; + values[valuesById[3] = "MEDIUM"] = 3; + values[valuesById[4] = "LOW"] = 4; + return values; + })(); + + return Finding; + })(); + + v1.Form = (function() { + + /** + * Properties of a Form. + * @memberof google.cloud.websecurityscanner.v1 + * @interface IForm + * @property {string|null} [actionUri] Form actionUri + * @property {Array.|null} [fields] Form fields + */ + + /** + * Constructs a new Form. + * @memberof google.cloud.websecurityscanner.v1 + * @classdesc Represents a Form. + * @implements IForm + * @constructor + * @param {google.cloud.websecurityscanner.v1.IForm=} [properties] Properties to set + */ + function Form(properties) { + this.fields = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Form actionUri. + * @member {string} actionUri + * @memberof google.cloud.websecurityscanner.v1.Form + * @instance + */ + Form.prototype.actionUri = ""; + + /** + * Form fields. + * @member {Array.} fields + * @memberof google.cloud.websecurityscanner.v1.Form + * @instance + */ + Form.prototype.fields = $util.emptyArray; + + /** + * Creates a new Form instance using the specified properties. + * @function create + * @memberof google.cloud.websecurityscanner.v1.Form + * @static + * @param {google.cloud.websecurityscanner.v1.IForm=} [properties] Properties to set + * @returns {google.cloud.websecurityscanner.v1.Form} Form instance + */ + Form.create = function create(properties) { + return new Form(properties); + }; + + /** + * Encodes the specified Form message. Does not implicitly {@link google.cloud.websecurityscanner.v1.Form.verify|verify} messages. + * @function encode + * @memberof google.cloud.websecurityscanner.v1.Form + * @static + * @param {google.cloud.websecurityscanner.v1.IForm} message Form message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Form.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.actionUri != null && Object.hasOwnProperty.call(message, "actionUri")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.actionUri); + if (message.fields != null && message.fields.length) + for (var i = 0; i < message.fields.length; ++i) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.fields[i]); + return writer; + }; + + /** + * Encodes the specified Form message, length delimited. Does not implicitly {@link google.cloud.websecurityscanner.v1.Form.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.websecurityscanner.v1.Form + * @static + * @param {google.cloud.websecurityscanner.v1.IForm} message Form message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Form.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Form message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.websecurityscanner.v1.Form + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.websecurityscanner.v1.Form} Form + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Form.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.websecurityscanner.v1.Form(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.actionUri = reader.string(); + break; + } + case 2: { + if (!(message.fields && message.fields.length)) + message.fields = []; + message.fields.push(reader.string()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Form message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.websecurityscanner.v1.Form + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.websecurityscanner.v1.Form} Form + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Form.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Form message. + * @function verify + * @memberof google.cloud.websecurityscanner.v1.Form + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Form.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.actionUri != null && message.hasOwnProperty("actionUri")) + if (!$util.isString(message.actionUri)) + return "actionUri: string expected"; + if (message.fields != null && message.hasOwnProperty("fields")) { + if (!Array.isArray(message.fields)) + return "fields: array expected"; + for (var i = 0; i < message.fields.length; ++i) + if (!$util.isString(message.fields[i])) + return "fields: string[] expected"; + } + return null; + }; + + /** + * Creates a Form message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.websecurityscanner.v1.Form + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.websecurityscanner.v1.Form} Form + */ + Form.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.websecurityscanner.v1.Form) + return object; + var message = new $root.google.cloud.websecurityscanner.v1.Form(); + if (object.actionUri != null) + message.actionUri = String(object.actionUri); + if (object.fields) { + if (!Array.isArray(object.fields)) + throw TypeError(".google.cloud.websecurityscanner.v1.Form.fields: array expected"); + message.fields = []; + for (var i = 0; i < object.fields.length; ++i) + message.fields[i] = String(object.fields[i]); + } + return message; + }; + + /** + * Creates a plain object from a Form message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.websecurityscanner.v1.Form + * @static + * @param {google.cloud.websecurityscanner.v1.Form} message Form + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Form.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.fields = []; + if (options.defaults) + object.actionUri = ""; + if (message.actionUri != null && message.hasOwnProperty("actionUri")) + object.actionUri = message.actionUri; + if (message.fields && message.fields.length) { + object.fields = []; + for (var j = 0; j < message.fields.length; ++j) + object.fields[j] = message.fields[j]; + } + return object; + }; + + /** + * Converts this Form to JSON. + * @function toJSON + * @memberof google.cloud.websecurityscanner.v1.Form + * @instance + * @returns {Object.} JSON object + */ + Form.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Form + * @function getTypeUrl + * @memberof google.cloud.websecurityscanner.v1.Form + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Form.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.websecurityscanner.v1.Form"; + }; + + return Form; + })(); + + v1.OutdatedLibrary = (function() { + + /** + * Properties of an OutdatedLibrary. + * @memberof google.cloud.websecurityscanner.v1 + * @interface IOutdatedLibrary + * @property {string|null} [libraryName] OutdatedLibrary libraryName + * @property {string|null} [version] OutdatedLibrary version + * @property {Array.|null} [learnMoreUrls] OutdatedLibrary learnMoreUrls + */ + + /** + * Constructs a new OutdatedLibrary. + * @memberof google.cloud.websecurityscanner.v1 + * @classdesc Represents an OutdatedLibrary. + * @implements IOutdatedLibrary + * @constructor + * @param {google.cloud.websecurityscanner.v1.IOutdatedLibrary=} [properties] Properties to set + */ + function OutdatedLibrary(properties) { + this.learnMoreUrls = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * OutdatedLibrary libraryName. + * @member {string} libraryName + * @memberof google.cloud.websecurityscanner.v1.OutdatedLibrary + * @instance + */ + OutdatedLibrary.prototype.libraryName = ""; + + /** + * OutdatedLibrary version. + * @member {string} version + * @memberof google.cloud.websecurityscanner.v1.OutdatedLibrary + * @instance + */ + OutdatedLibrary.prototype.version = ""; + + /** + * OutdatedLibrary learnMoreUrls. + * @member {Array.} learnMoreUrls + * @memberof google.cloud.websecurityscanner.v1.OutdatedLibrary + * @instance + */ + OutdatedLibrary.prototype.learnMoreUrls = $util.emptyArray; + + /** + * Creates a new OutdatedLibrary instance using the specified properties. + * @function create + * @memberof google.cloud.websecurityscanner.v1.OutdatedLibrary + * @static + * @param {google.cloud.websecurityscanner.v1.IOutdatedLibrary=} [properties] Properties to set + * @returns {google.cloud.websecurityscanner.v1.OutdatedLibrary} OutdatedLibrary instance + */ + OutdatedLibrary.create = function create(properties) { + return new OutdatedLibrary(properties); + }; + + /** + * Encodes the specified OutdatedLibrary message. Does not implicitly {@link google.cloud.websecurityscanner.v1.OutdatedLibrary.verify|verify} messages. + * @function encode + * @memberof google.cloud.websecurityscanner.v1.OutdatedLibrary + * @static + * @param {google.cloud.websecurityscanner.v1.IOutdatedLibrary} message OutdatedLibrary message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + OutdatedLibrary.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.libraryName != null && Object.hasOwnProperty.call(message, "libraryName")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.libraryName); + if (message.version != null && Object.hasOwnProperty.call(message, "version")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.version); + if (message.learnMoreUrls != null && message.learnMoreUrls.length) + for (var i = 0; i < message.learnMoreUrls.length; ++i) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.learnMoreUrls[i]); + return writer; + }; + + /** + * Encodes the specified OutdatedLibrary message, length delimited. Does not implicitly {@link google.cloud.websecurityscanner.v1.OutdatedLibrary.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.websecurityscanner.v1.OutdatedLibrary + * @static + * @param {google.cloud.websecurityscanner.v1.IOutdatedLibrary} message OutdatedLibrary message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + OutdatedLibrary.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an OutdatedLibrary message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.websecurityscanner.v1.OutdatedLibrary + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.websecurityscanner.v1.OutdatedLibrary} OutdatedLibrary + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + OutdatedLibrary.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.websecurityscanner.v1.OutdatedLibrary(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.libraryName = reader.string(); + break; + } + case 2: { + message.version = reader.string(); + break; + } + case 3: { + if (!(message.learnMoreUrls && message.learnMoreUrls.length)) + message.learnMoreUrls = []; + message.learnMoreUrls.push(reader.string()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an OutdatedLibrary message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.websecurityscanner.v1.OutdatedLibrary + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.websecurityscanner.v1.OutdatedLibrary} OutdatedLibrary + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + OutdatedLibrary.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an OutdatedLibrary message. + * @function verify + * @memberof google.cloud.websecurityscanner.v1.OutdatedLibrary + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + OutdatedLibrary.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.libraryName != null && message.hasOwnProperty("libraryName")) + if (!$util.isString(message.libraryName)) + return "libraryName: string expected"; + if (message.version != null && message.hasOwnProperty("version")) + if (!$util.isString(message.version)) + return "version: string expected"; + if (message.learnMoreUrls != null && message.hasOwnProperty("learnMoreUrls")) { + if (!Array.isArray(message.learnMoreUrls)) + return "learnMoreUrls: array expected"; + for (var i = 0; i < message.learnMoreUrls.length; ++i) + if (!$util.isString(message.learnMoreUrls[i])) + return "learnMoreUrls: string[] expected"; + } + return null; + }; + + /** + * Creates an OutdatedLibrary message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.websecurityscanner.v1.OutdatedLibrary + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.websecurityscanner.v1.OutdatedLibrary} OutdatedLibrary + */ + OutdatedLibrary.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.websecurityscanner.v1.OutdatedLibrary) + return object; + var message = new $root.google.cloud.websecurityscanner.v1.OutdatedLibrary(); + if (object.libraryName != null) + message.libraryName = String(object.libraryName); + if (object.version != null) + message.version = String(object.version); + if (object.learnMoreUrls) { + if (!Array.isArray(object.learnMoreUrls)) + throw TypeError(".google.cloud.websecurityscanner.v1.OutdatedLibrary.learnMoreUrls: array expected"); + message.learnMoreUrls = []; + for (var i = 0; i < object.learnMoreUrls.length; ++i) + message.learnMoreUrls[i] = String(object.learnMoreUrls[i]); + } + return message; + }; + + /** + * Creates a plain object from an OutdatedLibrary message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.websecurityscanner.v1.OutdatedLibrary + * @static + * @param {google.cloud.websecurityscanner.v1.OutdatedLibrary} message OutdatedLibrary + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + OutdatedLibrary.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.learnMoreUrls = []; + if (options.defaults) { + object.libraryName = ""; + object.version = ""; + } + if (message.libraryName != null && message.hasOwnProperty("libraryName")) + object.libraryName = message.libraryName; + if (message.version != null && message.hasOwnProperty("version")) + object.version = message.version; + if (message.learnMoreUrls && message.learnMoreUrls.length) { + object.learnMoreUrls = []; + for (var j = 0; j < message.learnMoreUrls.length; ++j) + object.learnMoreUrls[j] = message.learnMoreUrls[j]; + } + return object; + }; + + /** + * Converts this OutdatedLibrary to JSON. + * @function toJSON + * @memberof google.cloud.websecurityscanner.v1.OutdatedLibrary + * @instance + * @returns {Object.} JSON object + */ + OutdatedLibrary.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for OutdatedLibrary + * @function getTypeUrl + * @memberof google.cloud.websecurityscanner.v1.OutdatedLibrary + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + OutdatedLibrary.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.websecurityscanner.v1.OutdatedLibrary"; + }; + + return OutdatedLibrary; + })(); + + v1.ViolatingResource = (function() { + + /** + * Properties of a ViolatingResource. + * @memberof google.cloud.websecurityscanner.v1 + * @interface IViolatingResource + * @property {string|null} [contentType] ViolatingResource contentType + * @property {string|null} [resourceUrl] ViolatingResource resourceUrl + */ + + /** + * Constructs a new ViolatingResource. + * @memberof google.cloud.websecurityscanner.v1 + * @classdesc Represents a ViolatingResource. + * @implements IViolatingResource + * @constructor + * @param {google.cloud.websecurityscanner.v1.IViolatingResource=} [properties] Properties to set + */ + function ViolatingResource(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ViolatingResource contentType. + * @member {string} contentType + * @memberof google.cloud.websecurityscanner.v1.ViolatingResource + * @instance + */ + ViolatingResource.prototype.contentType = ""; + + /** + * ViolatingResource resourceUrl. + * @member {string} resourceUrl + * @memberof google.cloud.websecurityscanner.v1.ViolatingResource + * @instance + */ + ViolatingResource.prototype.resourceUrl = ""; + + /** + * Creates a new ViolatingResource instance using the specified properties. + * @function create + * @memberof google.cloud.websecurityscanner.v1.ViolatingResource + * @static + * @param {google.cloud.websecurityscanner.v1.IViolatingResource=} [properties] Properties to set + * @returns {google.cloud.websecurityscanner.v1.ViolatingResource} ViolatingResource instance + */ + ViolatingResource.create = function create(properties) { + return new ViolatingResource(properties); + }; + + /** + * Encodes the specified ViolatingResource message. Does not implicitly {@link google.cloud.websecurityscanner.v1.ViolatingResource.verify|verify} messages. + * @function encode + * @memberof google.cloud.websecurityscanner.v1.ViolatingResource + * @static + * @param {google.cloud.websecurityscanner.v1.IViolatingResource} message ViolatingResource message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ViolatingResource.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.contentType != null && Object.hasOwnProperty.call(message, "contentType")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.contentType); + if (message.resourceUrl != null && Object.hasOwnProperty.call(message, "resourceUrl")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.resourceUrl); + return writer; + }; + + /** + * Encodes the specified ViolatingResource message, length delimited. Does not implicitly {@link google.cloud.websecurityscanner.v1.ViolatingResource.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.websecurityscanner.v1.ViolatingResource + * @static + * @param {google.cloud.websecurityscanner.v1.IViolatingResource} message ViolatingResource message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ViolatingResource.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ViolatingResource message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.websecurityscanner.v1.ViolatingResource + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.websecurityscanner.v1.ViolatingResource} ViolatingResource + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ViolatingResource.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.websecurityscanner.v1.ViolatingResource(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.contentType = reader.string(); + break; + } + case 2: { + message.resourceUrl = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ViolatingResource message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.websecurityscanner.v1.ViolatingResource + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.websecurityscanner.v1.ViolatingResource} ViolatingResource + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ViolatingResource.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ViolatingResource message. + * @function verify + * @memberof google.cloud.websecurityscanner.v1.ViolatingResource + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ViolatingResource.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.contentType != null && message.hasOwnProperty("contentType")) + if (!$util.isString(message.contentType)) + return "contentType: string expected"; + if (message.resourceUrl != null && message.hasOwnProperty("resourceUrl")) + if (!$util.isString(message.resourceUrl)) + return "resourceUrl: string expected"; + return null; + }; + + /** + * Creates a ViolatingResource message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.websecurityscanner.v1.ViolatingResource + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.websecurityscanner.v1.ViolatingResource} ViolatingResource + */ + ViolatingResource.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.websecurityscanner.v1.ViolatingResource) + return object; + var message = new $root.google.cloud.websecurityscanner.v1.ViolatingResource(); + if (object.contentType != null) + message.contentType = String(object.contentType); + if (object.resourceUrl != null) + message.resourceUrl = String(object.resourceUrl); + return message; + }; + + /** + * Creates a plain object from a ViolatingResource message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.websecurityscanner.v1.ViolatingResource + * @static + * @param {google.cloud.websecurityscanner.v1.ViolatingResource} message ViolatingResource + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ViolatingResource.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.contentType = ""; + object.resourceUrl = ""; + } + if (message.contentType != null && message.hasOwnProperty("contentType")) + object.contentType = message.contentType; + if (message.resourceUrl != null && message.hasOwnProperty("resourceUrl")) + object.resourceUrl = message.resourceUrl; + return object; + }; + + /** + * Converts this ViolatingResource to JSON. + * @function toJSON + * @memberof google.cloud.websecurityscanner.v1.ViolatingResource + * @instance + * @returns {Object.} JSON object + */ + ViolatingResource.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ViolatingResource + * @function getTypeUrl + * @memberof google.cloud.websecurityscanner.v1.ViolatingResource + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ViolatingResource.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.websecurityscanner.v1.ViolatingResource"; + }; + + return ViolatingResource; + })(); + + v1.VulnerableParameters = (function() { + + /** + * Properties of a VulnerableParameters. + * @memberof google.cloud.websecurityscanner.v1 + * @interface IVulnerableParameters + * @property {Array.|null} [parameterNames] VulnerableParameters parameterNames + */ + + /** + * Constructs a new VulnerableParameters. + * @memberof google.cloud.websecurityscanner.v1 + * @classdesc Represents a VulnerableParameters. + * @implements IVulnerableParameters + * @constructor + * @param {google.cloud.websecurityscanner.v1.IVulnerableParameters=} [properties] Properties to set + */ + function VulnerableParameters(properties) { + this.parameterNames = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * VulnerableParameters parameterNames. + * @member {Array.} parameterNames + * @memberof google.cloud.websecurityscanner.v1.VulnerableParameters + * @instance + */ + VulnerableParameters.prototype.parameterNames = $util.emptyArray; + + /** + * Creates a new VulnerableParameters instance using the specified properties. + * @function create + * @memberof google.cloud.websecurityscanner.v1.VulnerableParameters + * @static + * @param {google.cloud.websecurityscanner.v1.IVulnerableParameters=} [properties] Properties to set + * @returns {google.cloud.websecurityscanner.v1.VulnerableParameters} VulnerableParameters instance + */ + VulnerableParameters.create = function create(properties) { + return new VulnerableParameters(properties); + }; + + /** + * Encodes the specified VulnerableParameters message. Does not implicitly {@link google.cloud.websecurityscanner.v1.VulnerableParameters.verify|verify} messages. + * @function encode + * @memberof google.cloud.websecurityscanner.v1.VulnerableParameters + * @static + * @param {google.cloud.websecurityscanner.v1.IVulnerableParameters} message VulnerableParameters message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + VulnerableParameters.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.parameterNames != null && message.parameterNames.length) + for (var i = 0; i < message.parameterNames.length; ++i) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.parameterNames[i]); + return writer; + }; + + /** + * Encodes the specified VulnerableParameters message, length delimited. Does not implicitly {@link google.cloud.websecurityscanner.v1.VulnerableParameters.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.websecurityscanner.v1.VulnerableParameters + * @static + * @param {google.cloud.websecurityscanner.v1.IVulnerableParameters} message VulnerableParameters message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + VulnerableParameters.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a VulnerableParameters message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.websecurityscanner.v1.VulnerableParameters + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.websecurityscanner.v1.VulnerableParameters} VulnerableParameters + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + VulnerableParameters.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.websecurityscanner.v1.VulnerableParameters(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.parameterNames && message.parameterNames.length)) + message.parameterNames = []; + message.parameterNames.push(reader.string()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a VulnerableParameters message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.websecurityscanner.v1.VulnerableParameters + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.websecurityscanner.v1.VulnerableParameters} VulnerableParameters + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + VulnerableParameters.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a VulnerableParameters message. + * @function verify + * @memberof google.cloud.websecurityscanner.v1.VulnerableParameters + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + VulnerableParameters.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.parameterNames != null && message.hasOwnProperty("parameterNames")) { + if (!Array.isArray(message.parameterNames)) + return "parameterNames: array expected"; + for (var i = 0; i < message.parameterNames.length; ++i) + if (!$util.isString(message.parameterNames[i])) + return "parameterNames: string[] expected"; + } + return null; + }; + + /** + * Creates a VulnerableParameters message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.websecurityscanner.v1.VulnerableParameters + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.websecurityscanner.v1.VulnerableParameters} VulnerableParameters + */ + VulnerableParameters.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.websecurityscanner.v1.VulnerableParameters) + return object; + var message = new $root.google.cloud.websecurityscanner.v1.VulnerableParameters(); + if (object.parameterNames) { + if (!Array.isArray(object.parameterNames)) + throw TypeError(".google.cloud.websecurityscanner.v1.VulnerableParameters.parameterNames: array expected"); + message.parameterNames = []; + for (var i = 0; i < object.parameterNames.length; ++i) + message.parameterNames[i] = String(object.parameterNames[i]); + } + return message; + }; + + /** + * Creates a plain object from a VulnerableParameters message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.websecurityscanner.v1.VulnerableParameters + * @static + * @param {google.cloud.websecurityscanner.v1.VulnerableParameters} message VulnerableParameters + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + VulnerableParameters.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.parameterNames = []; + if (message.parameterNames && message.parameterNames.length) { + object.parameterNames = []; + for (var j = 0; j < message.parameterNames.length; ++j) + object.parameterNames[j] = message.parameterNames[j]; + } + return object; + }; + + /** + * Converts this VulnerableParameters to JSON. + * @function toJSON + * @memberof google.cloud.websecurityscanner.v1.VulnerableParameters + * @instance + * @returns {Object.} JSON object + */ + VulnerableParameters.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for VulnerableParameters + * @function getTypeUrl + * @memberof google.cloud.websecurityscanner.v1.VulnerableParameters + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + VulnerableParameters.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.websecurityscanner.v1.VulnerableParameters"; + }; + + return VulnerableParameters; + })(); + + v1.VulnerableHeaders = (function() { + + /** + * Properties of a VulnerableHeaders. + * @memberof google.cloud.websecurityscanner.v1 + * @interface IVulnerableHeaders + * @property {Array.|null} [headers] VulnerableHeaders headers + * @property {Array.|null} [missingHeaders] VulnerableHeaders missingHeaders + */ + + /** + * Constructs a new VulnerableHeaders. + * @memberof google.cloud.websecurityscanner.v1 + * @classdesc Represents a VulnerableHeaders. + * @implements IVulnerableHeaders + * @constructor + * @param {google.cloud.websecurityscanner.v1.IVulnerableHeaders=} [properties] Properties to set + */ + function VulnerableHeaders(properties) { + this.headers = []; + this.missingHeaders = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * VulnerableHeaders headers. + * @member {Array.} headers + * @memberof google.cloud.websecurityscanner.v1.VulnerableHeaders + * @instance + */ + VulnerableHeaders.prototype.headers = $util.emptyArray; + + /** + * VulnerableHeaders missingHeaders. + * @member {Array.} missingHeaders + * @memberof google.cloud.websecurityscanner.v1.VulnerableHeaders + * @instance + */ + VulnerableHeaders.prototype.missingHeaders = $util.emptyArray; + + /** + * Creates a new VulnerableHeaders instance using the specified properties. + * @function create + * @memberof google.cloud.websecurityscanner.v1.VulnerableHeaders + * @static + * @param {google.cloud.websecurityscanner.v1.IVulnerableHeaders=} [properties] Properties to set + * @returns {google.cloud.websecurityscanner.v1.VulnerableHeaders} VulnerableHeaders instance + */ + VulnerableHeaders.create = function create(properties) { + return new VulnerableHeaders(properties); + }; + + /** + * Encodes the specified VulnerableHeaders message. Does not implicitly {@link google.cloud.websecurityscanner.v1.VulnerableHeaders.verify|verify} messages. + * @function encode + * @memberof google.cloud.websecurityscanner.v1.VulnerableHeaders + * @static + * @param {google.cloud.websecurityscanner.v1.IVulnerableHeaders} message VulnerableHeaders message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + VulnerableHeaders.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.headers != null && message.headers.length) + for (var i = 0; i < message.headers.length; ++i) + $root.google.cloud.websecurityscanner.v1.VulnerableHeaders.Header.encode(message.headers[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.missingHeaders != null && message.missingHeaders.length) + for (var i = 0; i < message.missingHeaders.length; ++i) + $root.google.cloud.websecurityscanner.v1.VulnerableHeaders.Header.encode(message.missingHeaders[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified VulnerableHeaders message, length delimited. Does not implicitly {@link google.cloud.websecurityscanner.v1.VulnerableHeaders.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.websecurityscanner.v1.VulnerableHeaders + * @static + * @param {google.cloud.websecurityscanner.v1.IVulnerableHeaders} message VulnerableHeaders message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + VulnerableHeaders.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a VulnerableHeaders message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.websecurityscanner.v1.VulnerableHeaders + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.websecurityscanner.v1.VulnerableHeaders} VulnerableHeaders + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + VulnerableHeaders.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.websecurityscanner.v1.VulnerableHeaders(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.headers && message.headers.length)) + message.headers = []; + message.headers.push($root.google.cloud.websecurityscanner.v1.VulnerableHeaders.Header.decode(reader, reader.uint32())); + break; + } + case 2: { + if (!(message.missingHeaders && message.missingHeaders.length)) + message.missingHeaders = []; + message.missingHeaders.push($root.google.cloud.websecurityscanner.v1.VulnerableHeaders.Header.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a VulnerableHeaders message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.websecurityscanner.v1.VulnerableHeaders + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.websecurityscanner.v1.VulnerableHeaders} VulnerableHeaders + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + VulnerableHeaders.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a VulnerableHeaders message. + * @function verify + * @memberof google.cloud.websecurityscanner.v1.VulnerableHeaders + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + VulnerableHeaders.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.headers != null && message.hasOwnProperty("headers")) { + if (!Array.isArray(message.headers)) + return "headers: array expected"; + for (var i = 0; i < message.headers.length; ++i) { + var error = $root.google.cloud.websecurityscanner.v1.VulnerableHeaders.Header.verify(message.headers[i]); + if (error) + return "headers." + error; + } + } + if (message.missingHeaders != null && message.hasOwnProperty("missingHeaders")) { + if (!Array.isArray(message.missingHeaders)) + return "missingHeaders: array expected"; + for (var i = 0; i < message.missingHeaders.length; ++i) { + var error = $root.google.cloud.websecurityscanner.v1.VulnerableHeaders.Header.verify(message.missingHeaders[i]); + if (error) + return "missingHeaders." + error; + } + } + return null; + }; + + /** + * Creates a VulnerableHeaders message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.websecurityscanner.v1.VulnerableHeaders + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.websecurityscanner.v1.VulnerableHeaders} VulnerableHeaders + */ + VulnerableHeaders.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.websecurityscanner.v1.VulnerableHeaders) + return object; + var message = new $root.google.cloud.websecurityscanner.v1.VulnerableHeaders(); + if (object.headers) { + if (!Array.isArray(object.headers)) + throw TypeError(".google.cloud.websecurityscanner.v1.VulnerableHeaders.headers: array expected"); + message.headers = []; + for (var i = 0; i < object.headers.length; ++i) { + if (typeof object.headers[i] !== "object") + throw TypeError(".google.cloud.websecurityscanner.v1.VulnerableHeaders.headers: object expected"); + message.headers[i] = $root.google.cloud.websecurityscanner.v1.VulnerableHeaders.Header.fromObject(object.headers[i]); + } + } + if (object.missingHeaders) { + if (!Array.isArray(object.missingHeaders)) + throw TypeError(".google.cloud.websecurityscanner.v1.VulnerableHeaders.missingHeaders: array expected"); + message.missingHeaders = []; + for (var i = 0; i < object.missingHeaders.length; ++i) { + if (typeof object.missingHeaders[i] !== "object") + throw TypeError(".google.cloud.websecurityscanner.v1.VulnerableHeaders.missingHeaders: object expected"); + message.missingHeaders[i] = $root.google.cloud.websecurityscanner.v1.VulnerableHeaders.Header.fromObject(object.missingHeaders[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a VulnerableHeaders message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.websecurityscanner.v1.VulnerableHeaders + * @static + * @param {google.cloud.websecurityscanner.v1.VulnerableHeaders} message VulnerableHeaders + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + VulnerableHeaders.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.headers = []; + object.missingHeaders = []; + } + if (message.headers && message.headers.length) { + object.headers = []; + for (var j = 0; j < message.headers.length; ++j) + object.headers[j] = $root.google.cloud.websecurityscanner.v1.VulnerableHeaders.Header.toObject(message.headers[j], options); + } + if (message.missingHeaders && message.missingHeaders.length) { + object.missingHeaders = []; + for (var j = 0; j < message.missingHeaders.length; ++j) + object.missingHeaders[j] = $root.google.cloud.websecurityscanner.v1.VulnerableHeaders.Header.toObject(message.missingHeaders[j], options); + } + return object; + }; + + /** + * Converts this VulnerableHeaders to JSON. + * @function toJSON + * @memberof google.cloud.websecurityscanner.v1.VulnerableHeaders + * @instance + * @returns {Object.} JSON object + */ + VulnerableHeaders.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for VulnerableHeaders + * @function getTypeUrl + * @memberof google.cloud.websecurityscanner.v1.VulnerableHeaders + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + VulnerableHeaders.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.websecurityscanner.v1.VulnerableHeaders"; + }; + + VulnerableHeaders.Header = (function() { + + /** + * Properties of a Header. + * @memberof google.cloud.websecurityscanner.v1.VulnerableHeaders + * @interface IHeader + * @property {string|null} [name] Header name + * @property {string|null} [value] Header value + */ + + /** + * Constructs a new Header. + * @memberof google.cloud.websecurityscanner.v1.VulnerableHeaders + * @classdesc Represents a Header. + * @implements IHeader + * @constructor + * @param {google.cloud.websecurityscanner.v1.VulnerableHeaders.IHeader=} [properties] Properties to set + */ + function Header(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Header name. + * @member {string} name + * @memberof google.cloud.websecurityscanner.v1.VulnerableHeaders.Header + * @instance + */ + Header.prototype.name = ""; + + /** + * Header value. + * @member {string} value + * @memberof google.cloud.websecurityscanner.v1.VulnerableHeaders.Header + * @instance + */ + Header.prototype.value = ""; + + /** + * Creates a new Header instance using the specified properties. + * @function create + * @memberof google.cloud.websecurityscanner.v1.VulnerableHeaders.Header + * @static + * @param {google.cloud.websecurityscanner.v1.VulnerableHeaders.IHeader=} [properties] Properties to set + * @returns {google.cloud.websecurityscanner.v1.VulnerableHeaders.Header} Header instance + */ + Header.create = function create(properties) { + return new Header(properties); + }; + + /** + * Encodes the specified Header message. Does not implicitly {@link google.cloud.websecurityscanner.v1.VulnerableHeaders.Header.verify|verify} messages. + * @function encode + * @memberof google.cloud.websecurityscanner.v1.VulnerableHeaders.Header + * @static + * @param {google.cloud.websecurityscanner.v1.VulnerableHeaders.IHeader} message Header message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Header.encode = function encode(message, writer) { + if (!writer) + 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 Header message, length delimited. Does not implicitly {@link google.cloud.websecurityscanner.v1.VulnerableHeaders.Header.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.websecurityscanner.v1.VulnerableHeaders.Header + * @static + * @param {google.cloud.websecurityscanner.v1.VulnerableHeaders.IHeader} message Header message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Header.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Header message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.websecurityscanner.v1.VulnerableHeaders.Header + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.websecurityscanner.v1.VulnerableHeaders.Header} Header + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Header.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.websecurityscanner.v1.VulnerableHeaders.Header(); + 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 Header message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.websecurityscanner.v1.VulnerableHeaders.Header + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.websecurityscanner.v1.VulnerableHeaders.Header} Header + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Header.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Header message. + * @function verify + * @memberof google.cloud.websecurityscanner.v1.VulnerableHeaders.Header + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Header.verify = function verify(message) { + if (typeof message !== "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 Header message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.websecurityscanner.v1.VulnerableHeaders.Header + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.websecurityscanner.v1.VulnerableHeaders.Header} Header + */ + Header.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.websecurityscanner.v1.VulnerableHeaders.Header) + return object; + var message = new $root.google.cloud.websecurityscanner.v1.VulnerableHeaders.Header(); + 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 Header message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.websecurityscanner.v1.VulnerableHeaders.Header + * @static + * @param {google.cloud.websecurityscanner.v1.VulnerableHeaders.Header} message Header + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Header.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 Header to JSON. + * @function toJSON + * @memberof google.cloud.websecurityscanner.v1.VulnerableHeaders.Header + * @instance + * @returns {Object.} JSON object + */ + Header.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Header + * @function getTypeUrl + * @memberof google.cloud.websecurityscanner.v1.VulnerableHeaders.Header + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Header.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.websecurityscanner.v1.VulnerableHeaders.Header"; + }; + + return Header; + })(); + + return VulnerableHeaders; + })(); + + v1.Xss = (function() { + + /** + * Properties of a Xss. + * @memberof google.cloud.websecurityscanner.v1 + * @interface IXss + * @property {Array.|null} [stackTraces] Xss stackTraces + * @property {string|null} [errorMessage] Xss errorMessage + * @property {google.cloud.websecurityscanner.v1.Xss.AttackVector|null} [attackVector] Xss attackVector + * @property {string|null} [storedXssSeedingUrl] Xss storedXssSeedingUrl + */ + + /** + * Constructs a new Xss. + * @memberof google.cloud.websecurityscanner.v1 + * @classdesc Represents a Xss. + * @implements IXss + * @constructor + * @param {google.cloud.websecurityscanner.v1.IXss=} [properties] Properties to set + */ + function Xss(properties) { + this.stackTraces = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Xss stackTraces. + * @member {Array.} stackTraces + * @memberof google.cloud.websecurityscanner.v1.Xss + * @instance + */ + Xss.prototype.stackTraces = $util.emptyArray; + + /** + * Xss errorMessage. + * @member {string} errorMessage + * @memberof google.cloud.websecurityscanner.v1.Xss + * @instance + */ + Xss.prototype.errorMessage = ""; + + /** + * Xss attackVector. + * @member {google.cloud.websecurityscanner.v1.Xss.AttackVector} attackVector + * @memberof google.cloud.websecurityscanner.v1.Xss + * @instance + */ + Xss.prototype.attackVector = 0; + + /** + * Xss storedXssSeedingUrl. + * @member {string} storedXssSeedingUrl + * @memberof google.cloud.websecurityscanner.v1.Xss + * @instance + */ + Xss.prototype.storedXssSeedingUrl = ""; + + /** + * Creates a new Xss instance using the specified properties. + * @function create + * @memberof google.cloud.websecurityscanner.v1.Xss + * @static + * @param {google.cloud.websecurityscanner.v1.IXss=} [properties] Properties to set + * @returns {google.cloud.websecurityscanner.v1.Xss} Xss instance + */ + Xss.create = function create(properties) { + return new Xss(properties); + }; + + /** + * Encodes the specified Xss message. Does not implicitly {@link google.cloud.websecurityscanner.v1.Xss.verify|verify} messages. + * @function encode + * @memberof google.cloud.websecurityscanner.v1.Xss + * @static + * @param {google.cloud.websecurityscanner.v1.IXss} message Xss message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Xss.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.stackTraces != null && message.stackTraces.length) + for (var i = 0; i < message.stackTraces.length; ++i) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.stackTraces[i]); + if (message.errorMessage != null && Object.hasOwnProperty.call(message, "errorMessage")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.errorMessage); + if (message.attackVector != null && Object.hasOwnProperty.call(message, "attackVector")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.attackVector); + if (message.storedXssSeedingUrl != null && Object.hasOwnProperty.call(message, "storedXssSeedingUrl")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.storedXssSeedingUrl); + return writer; + }; + + /** + * Encodes the specified Xss message, length delimited. Does not implicitly {@link google.cloud.websecurityscanner.v1.Xss.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.websecurityscanner.v1.Xss + * @static + * @param {google.cloud.websecurityscanner.v1.IXss} message Xss message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Xss.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Xss message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.websecurityscanner.v1.Xss + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.websecurityscanner.v1.Xss} Xss + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Xss.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.websecurityscanner.v1.Xss(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.stackTraces && message.stackTraces.length)) + message.stackTraces = []; + message.stackTraces.push(reader.string()); + break; + } + case 2: { + message.errorMessage = reader.string(); + break; + } + case 3: { + message.attackVector = reader.int32(); + break; + } + case 4: { + message.storedXssSeedingUrl = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Xss message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.websecurityscanner.v1.Xss + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.websecurityscanner.v1.Xss} Xss + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Xss.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Xss message. + * @function verify + * @memberof google.cloud.websecurityscanner.v1.Xss + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Xss.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.stackTraces != null && message.hasOwnProperty("stackTraces")) { + if (!Array.isArray(message.stackTraces)) + return "stackTraces: array expected"; + for (var i = 0; i < message.stackTraces.length; ++i) + if (!$util.isString(message.stackTraces[i])) + return "stackTraces: string[] expected"; + } + if (message.errorMessage != null && message.hasOwnProperty("errorMessage")) + if (!$util.isString(message.errorMessage)) + return "errorMessage: string expected"; + if (message.attackVector != null && message.hasOwnProperty("attackVector")) + switch (message.attackVector) { + default: + return "attackVector: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + case 5: + case 6: + case 7: + case 8: + case 9: + case 10: + case 11: + case 12: + case 13: + case 14: + case 15: + break; + } + if (message.storedXssSeedingUrl != null && message.hasOwnProperty("storedXssSeedingUrl")) + if (!$util.isString(message.storedXssSeedingUrl)) + return "storedXssSeedingUrl: string expected"; + return null; + }; + + /** + * Creates a Xss message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.websecurityscanner.v1.Xss + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.websecurityscanner.v1.Xss} Xss + */ + Xss.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.websecurityscanner.v1.Xss) + return object; + var message = new $root.google.cloud.websecurityscanner.v1.Xss(); + if (object.stackTraces) { + if (!Array.isArray(object.stackTraces)) + throw TypeError(".google.cloud.websecurityscanner.v1.Xss.stackTraces: array expected"); + message.stackTraces = []; + for (var i = 0; i < object.stackTraces.length; ++i) + message.stackTraces[i] = String(object.stackTraces[i]); + } + if (object.errorMessage != null) + message.errorMessage = String(object.errorMessage); + switch (object.attackVector) { + default: + if (typeof object.attackVector === "number") { + message.attackVector = object.attackVector; + break; + } + break; + case "ATTACK_VECTOR_UNSPECIFIED": + case 0: + message.attackVector = 0; + break; + case "LOCAL_STORAGE": + case 1: + message.attackVector = 1; + break; + case "SESSION_STORAGE": + case 2: + message.attackVector = 2; + break; + case "WINDOW_NAME": + case 3: + message.attackVector = 3; + break; + case "REFERRER": + case 4: + message.attackVector = 4; + break; + case "FORM_INPUT": + case 5: + message.attackVector = 5; + break; + case "COOKIE": + case 6: + message.attackVector = 6; + break; + case "POST_MESSAGE": + case 7: + message.attackVector = 7; + break; + case "GET_PARAMETERS": + case 8: + message.attackVector = 8; + break; + case "URL_FRAGMENT": + case 9: + message.attackVector = 9; + break; + case "HTML_COMMENT": + case 10: + message.attackVector = 10; + break; + case "POST_PARAMETERS": + case 11: + message.attackVector = 11; + break; + case "PROTOCOL": + case 12: + message.attackVector = 12; + break; + case "STORED_XSS": + case 13: + message.attackVector = 13; + break; + case "SAME_ORIGIN": + case 14: + message.attackVector = 14; + break; + case "USER_CONTROLLABLE_URL": + case 15: + message.attackVector = 15; + break; + } + if (object.storedXssSeedingUrl != null) + message.storedXssSeedingUrl = String(object.storedXssSeedingUrl); + return message; + }; + + /** + * Creates a plain object from a Xss message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.websecurityscanner.v1.Xss + * @static + * @param {google.cloud.websecurityscanner.v1.Xss} message Xss + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Xss.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.stackTraces = []; + if (options.defaults) { + object.errorMessage = ""; + object.attackVector = options.enums === String ? "ATTACK_VECTOR_UNSPECIFIED" : 0; + object.storedXssSeedingUrl = ""; + } + if (message.stackTraces && message.stackTraces.length) { + object.stackTraces = []; + for (var j = 0; j < message.stackTraces.length; ++j) + object.stackTraces[j] = message.stackTraces[j]; + } + if (message.errorMessage != null && message.hasOwnProperty("errorMessage")) + object.errorMessage = message.errorMessage; + if (message.attackVector != null && message.hasOwnProperty("attackVector")) + object.attackVector = options.enums === String ? $root.google.cloud.websecurityscanner.v1.Xss.AttackVector[message.attackVector] === undefined ? message.attackVector : $root.google.cloud.websecurityscanner.v1.Xss.AttackVector[message.attackVector] : message.attackVector; + if (message.storedXssSeedingUrl != null && message.hasOwnProperty("storedXssSeedingUrl")) + object.storedXssSeedingUrl = message.storedXssSeedingUrl; + return object; + }; + + /** + * Converts this Xss to JSON. + * @function toJSON + * @memberof google.cloud.websecurityscanner.v1.Xss + * @instance + * @returns {Object.} JSON object + */ + Xss.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Xss + * @function getTypeUrl + * @memberof google.cloud.websecurityscanner.v1.Xss + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Xss.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.websecurityscanner.v1.Xss"; + }; + + /** + * AttackVector enum. + * @name google.cloud.websecurityscanner.v1.Xss.AttackVector + * @enum {number} + * @property {number} ATTACK_VECTOR_UNSPECIFIED=0 ATTACK_VECTOR_UNSPECIFIED value + * @property {number} LOCAL_STORAGE=1 LOCAL_STORAGE value + * @property {number} SESSION_STORAGE=2 SESSION_STORAGE value + * @property {number} WINDOW_NAME=3 WINDOW_NAME value + * @property {number} REFERRER=4 REFERRER value + * @property {number} FORM_INPUT=5 FORM_INPUT value + * @property {number} COOKIE=6 COOKIE value + * @property {number} POST_MESSAGE=7 POST_MESSAGE value + * @property {number} GET_PARAMETERS=8 GET_PARAMETERS value + * @property {number} URL_FRAGMENT=9 URL_FRAGMENT value + * @property {number} HTML_COMMENT=10 HTML_COMMENT value + * @property {number} POST_PARAMETERS=11 POST_PARAMETERS value + * @property {number} PROTOCOL=12 PROTOCOL value + * @property {number} STORED_XSS=13 STORED_XSS value + * @property {number} SAME_ORIGIN=14 SAME_ORIGIN value + * @property {number} USER_CONTROLLABLE_URL=15 USER_CONTROLLABLE_URL value + */ + Xss.AttackVector = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "ATTACK_VECTOR_UNSPECIFIED"] = 0; + values[valuesById[1] = "LOCAL_STORAGE"] = 1; + values[valuesById[2] = "SESSION_STORAGE"] = 2; + values[valuesById[3] = "WINDOW_NAME"] = 3; + values[valuesById[4] = "REFERRER"] = 4; + values[valuesById[5] = "FORM_INPUT"] = 5; + values[valuesById[6] = "COOKIE"] = 6; + values[valuesById[7] = "POST_MESSAGE"] = 7; + values[valuesById[8] = "GET_PARAMETERS"] = 8; + values[valuesById[9] = "URL_FRAGMENT"] = 9; + values[valuesById[10] = "HTML_COMMENT"] = 10; + values[valuesById[11] = "POST_PARAMETERS"] = 11; + values[valuesById[12] = "PROTOCOL"] = 12; + values[valuesById[13] = "STORED_XSS"] = 13; + values[valuesById[14] = "SAME_ORIGIN"] = 14; + values[valuesById[15] = "USER_CONTROLLABLE_URL"] = 15; + return values; + })(); + + return Xss; + })(); + + v1.Xxe = (function() { + + /** + * Properties of a Xxe. + * @memberof google.cloud.websecurityscanner.v1 + * @interface IXxe + * @property {string|null} [payloadValue] Xxe payloadValue + * @property {google.cloud.websecurityscanner.v1.Xxe.Location|null} [payloadLocation] Xxe payloadLocation + */ + + /** + * Constructs a new Xxe. + * @memberof google.cloud.websecurityscanner.v1 + * @classdesc Represents a Xxe. + * @implements IXxe + * @constructor + * @param {google.cloud.websecurityscanner.v1.IXxe=} [properties] Properties to set + */ + function Xxe(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Xxe payloadValue. + * @member {string} payloadValue + * @memberof google.cloud.websecurityscanner.v1.Xxe + * @instance + */ + Xxe.prototype.payloadValue = ""; + + /** + * Xxe payloadLocation. + * @member {google.cloud.websecurityscanner.v1.Xxe.Location} payloadLocation + * @memberof google.cloud.websecurityscanner.v1.Xxe + * @instance + */ + Xxe.prototype.payloadLocation = 0; + + /** + * Creates a new Xxe instance using the specified properties. + * @function create + * @memberof google.cloud.websecurityscanner.v1.Xxe + * @static + * @param {google.cloud.websecurityscanner.v1.IXxe=} [properties] Properties to set + * @returns {google.cloud.websecurityscanner.v1.Xxe} Xxe instance + */ + Xxe.create = function create(properties) { + return new Xxe(properties); + }; + + /** + * Encodes the specified Xxe message. Does not implicitly {@link google.cloud.websecurityscanner.v1.Xxe.verify|verify} messages. + * @function encode + * @memberof google.cloud.websecurityscanner.v1.Xxe + * @static + * @param {google.cloud.websecurityscanner.v1.IXxe} message Xxe message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Xxe.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.payloadValue != null && Object.hasOwnProperty.call(message, "payloadValue")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.payloadValue); + if (message.payloadLocation != null && Object.hasOwnProperty.call(message, "payloadLocation")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.payloadLocation); + return writer; + }; + + /** + * Encodes the specified Xxe message, length delimited. Does not implicitly {@link google.cloud.websecurityscanner.v1.Xxe.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.websecurityscanner.v1.Xxe + * @static + * @param {google.cloud.websecurityscanner.v1.IXxe} message Xxe message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Xxe.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Xxe message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.websecurityscanner.v1.Xxe + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.websecurityscanner.v1.Xxe} Xxe + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Xxe.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.websecurityscanner.v1.Xxe(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.payloadValue = reader.string(); + break; + } + case 2: { + message.payloadLocation = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Xxe message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.websecurityscanner.v1.Xxe + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.websecurityscanner.v1.Xxe} Xxe + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Xxe.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Xxe message. + * @function verify + * @memberof google.cloud.websecurityscanner.v1.Xxe + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Xxe.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.payloadValue != null && message.hasOwnProperty("payloadValue")) + if (!$util.isString(message.payloadValue)) + return "payloadValue: string expected"; + if (message.payloadLocation != null && message.hasOwnProperty("payloadLocation")) + switch (message.payloadLocation) { + default: + return "payloadLocation: enum value expected"; + case 0: + case 1: + break; + } + return null; + }; + + /** + * Creates a Xxe message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.websecurityscanner.v1.Xxe + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.websecurityscanner.v1.Xxe} Xxe + */ + Xxe.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.websecurityscanner.v1.Xxe) + return object; + var message = new $root.google.cloud.websecurityscanner.v1.Xxe(); + if (object.payloadValue != null) + message.payloadValue = String(object.payloadValue); + switch (object.payloadLocation) { + default: + if (typeof object.payloadLocation === "number") { + message.payloadLocation = object.payloadLocation; + break; + } + break; + case "LOCATION_UNSPECIFIED": + case 0: + message.payloadLocation = 0; + break; + case "COMPLETE_REQUEST_BODY": + case 1: + message.payloadLocation = 1; + break; + } + return message; + }; + + /** + * Creates a plain object from a Xxe message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.websecurityscanner.v1.Xxe + * @static + * @param {google.cloud.websecurityscanner.v1.Xxe} message Xxe + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Xxe.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.payloadValue = ""; + object.payloadLocation = options.enums === String ? "LOCATION_UNSPECIFIED" : 0; + } + if (message.payloadValue != null && message.hasOwnProperty("payloadValue")) + object.payloadValue = message.payloadValue; + if (message.payloadLocation != null && message.hasOwnProperty("payloadLocation")) + object.payloadLocation = options.enums === String ? $root.google.cloud.websecurityscanner.v1.Xxe.Location[message.payloadLocation] === undefined ? message.payloadLocation : $root.google.cloud.websecurityscanner.v1.Xxe.Location[message.payloadLocation] : message.payloadLocation; + return object; + }; + + /** + * Converts this Xxe to JSON. + * @function toJSON + * @memberof google.cloud.websecurityscanner.v1.Xxe + * @instance + * @returns {Object.} JSON object + */ + Xxe.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Xxe + * @function getTypeUrl + * @memberof google.cloud.websecurityscanner.v1.Xxe + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Xxe.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.websecurityscanner.v1.Xxe"; + }; + + /** + * Location enum. + * @name google.cloud.websecurityscanner.v1.Xxe.Location + * @enum {number} + * @property {number} LOCATION_UNSPECIFIED=0 LOCATION_UNSPECIFIED value + * @property {number} COMPLETE_REQUEST_BODY=1 COMPLETE_REQUEST_BODY value + */ + Xxe.Location = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "LOCATION_UNSPECIFIED"] = 0; + values[valuesById[1] = "COMPLETE_REQUEST_BODY"] = 1; + return values; + })(); + + return Xxe; + })(); + + v1.FindingTypeStats = (function() { + + /** + * Properties of a FindingTypeStats. + * @memberof google.cloud.websecurityscanner.v1 + * @interface IFindingTypeStats + * @property {string|null} [findingType] FindingTypeStats findingType + * @property {number|null} [findingCount] FindingTypeStats findingCount + */ + + /** + * Constructs a new FindingTypeStats. + * @memberof google.cloud.websecurityscanner.v1 + * @classdesc Represents a FindingTypeStats. + * @implements IFindingTypeStats + * @constructor + * @param {google.cloud.websecurityscanner.v1.IFindingTypeStats=} [properties] Properties to set + */ + function FindingTypeStats(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * FindingTypeStats findingType. + * @member {string} findingType + * @memberof google.cloud.websecurityscanner.v1.FindingTypeStats + * @instance + */ + FindingTypeStats.prototype.findingType = ""; + + /** + * FindingTypeStats findingCount. + * @member {number} findingCount + * @memberof google.cloud.websecurityscanner.v1.FindingTypeStats + * @instance + */ + FindingTypeStats.prototype.findingCount = 0; + + /** + * Creates a new FindingTypeStats instance using the specified properties. + * @function create + * @memberof google.cloud.websecurityscanner.v1.FindingTypeStats + * @static + * @param {google.cloud.websecurityscanner.v1.IFindingTypeStats=} [properties] Properties to set + * @returns {google.cloud.websecurityscanner.v1.FindingTypeStats} FindingTypeStats instance + */ + FindingTypeStats.create = function create(properties) { + return new FindingTypeStats(properties); + }; + + /** + * Encodes the specified FindingTypeStats message. Does not implicitly {@link google.cloud.websecurityscanner.v1.FindingTypeStats.verify|verify} messages. + * @function encode + * @memberof google.cloud.websecurityscanner.v1.FindingTypeStats + * @static + * @param {google.cloud.websecurityscanner.v1.IFindingTypeStats} message FindingTypeStats message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FindingTypeStats.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.findingType != null && Object.hasOwnProperty.call(message, "findingType")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.findingType); + if (message.findingCount != null && Object.hasOwnProperty.call(message, "findingCount")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.findingCount); + return writer; + }; + + /** + * Encodes the specified FindingTypeStats message, length delimited. Does not implicitly {@link google.cloud.websecurityscanner.v1.FindingTypeStats.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.websecurityscanner.v1.FindingTypeStats + * @static + * @param {google.cloud.websecurityscanner.v1.IFindingTypeStats} message FindingTypeStats message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FindingTypeStats.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a FindingTypeStats message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.websecurityscanner.v1.FindingTypeStats + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.websecurityscanner.v1.FindingTypeStats} FindingTypeStats + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FindingTypeStats.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.websecurityscanner.v1.FindingTypeStats(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.findingType = reader.string(); + break; + } + case 2: { + message.findingCount = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a FindingTypeStats message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.websecurityscanner.v1.FindingTypeStats + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.websecurityscanner.v1.FindingTypeStats} FindingTypeStats + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FindingTypeStats.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a FindingTypeStats message. + * @function verify + * @memberof google.cloud.websecurityscanner.v1.FindingTypeStats + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + FindingTypeStats.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.findingType != null && message.hasOwnProperty("findingType")) + if (!$util.isString(message.findingType)) + return "findingType: string expected"; + if (message.findingCount != null && message.hasOwnProperty("findingCount")) + if (!$util.isInteger(message.findingCount)) + return "findingCount: integer expected"; + return null; + }; + + /** + * Creates a FindingTypeStats message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.websecurityscanner.v1.FindingTypeStats + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.websecurityscanner.v1.FindingTypeStats} FindingTypeStats + */ + FindingTypeStats.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.websecurityscanner.v1.FindingTypeStats) + return object; + var message = new $root.google.cloud.websecurityscanner.v1.FindingTypeStats(); + if (object.findingType != null) + message.findingType = String(object.findingType); + if (object.findingCount != null) + message.findingCount = object.findingCount | 0; + return message; + }; + + /** + * Creates a plain object from a FindingTypeStats message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.websecurityscanner.v1.FindingTypeStats + * @static + * @param {google.cloud.websecurityscanner.v1.FindingTypeStats} message FindingTypeStats + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + FindingTypeStats.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.findingType = ""; + object.findingCount = 0; + } + if (message.findingType != null && message.hasOwnProperty("findingType")) + object.findingType = message.findingType; + if (message.findingCount != null && message.hasOwnProperty("findingCount")) + object.findingCount = message.findingCount; + return object; + }; + + /** + * Converts this FindingTypeStats to JSON. + * @function toJSON + * @memberof google.cloud.websecurityscanner.v1.FindingTypeStats + * @instance + * @returns {Object.} JSON object + */ + FindingTypeStats.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for FindingTypeStats + * @function getTypeUrl + * @memberof google.cloud.websecurityscanner.v1.FindingTypeStats + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FindingTypeStats.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.websecurityscanner.v1.FindingTypeStats"; + }; + + return FindingTypeStats; + })(); + + v1.ScanConfig = (function() { + + /** + * Properties of a ScanConfig. + * @memberof google.cloud.websecurityscanner.v1 + * @interface IScanConfig + * @property {string|null} [name] ScanConfig name + * @property {string|null} [displayName] ScanConfig displayName + * @property {number|null} [maxQps] ScanConfig maxQps + * @property {Array.|null} [startingUrls] ScanConfig startingUrls + * @property {google.cloud.websecurityscanner.v1.ScanConfig.IAuthentication|null} [authentication] ScanConfig authentication + * @property {google.cloud.websecurityscanner.v1.ScanConfig.UserAgent|null} [userAgent] ScanConfig userAgent + * @property {Array.|null} [blacklistPatterns] ScanConfig blacklistPatterns + * @property {google.cloud.websecurityscanner.v1.ScanConfig.ISchedule|null} [schedule] ScanConfig schedule + * @property {google.cloud.websecurityscanner.v1.ScanConfig.ExportToSecurityCommandCenter|null} [exportToSecurityCommandCenter] ScanConfig exportToSecurityCommandCenter + * @property {google.cloud.websecurityscanner.v1.ScanConfig.RiskLevel|null} [riskLevel] ScanConfig riskLevel + * @property {boolean|null} [managedScan] ScanConfig managedScan + * @property {boolean|null} [staticIpScan] ScanConfig staticIpScan + * @property {boolean|null} [ignoreHttpStatusErrors] ScanConfig ignoreHttpStatusErrors + */ + + /** + * Constructs a new ScanConfig. + * @memberof google.cloud.websecurityscanner.v1 + * @classdesc Represents a ScanConfig. + * @implements IScanConfig + * @constructor + * @param {google.cloud.websecurityscanner.v1.IScanConfig=} [properties] Properties to set + */ + function ScanConfig(properties) { + this.startingUrls = []; + this.blacklistPatterns = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ScanConfig name. + * @member {string} name + * @memberof google.cloud.websecurityscanner.v1.ScanConfig + * @instance + */ + ScanConfig.prototype.name = ""; + + /** + * ScanConfig displayName. + * @member {string} displayName + * @memberof google.cloud.websecurityscanner.v1.ScanConfig + * @instance + */ + ScanConfig.prototype.displayName = ""; + + /** + * ScanConfig maxQps. + * @member {number} maxQps + * @memberof google.cloud.websecurityscanner.v1.ScanConfig + * @instance + */ + ScanConfig.prototype.maxQps = 0; + + /** + * ScanConfig startingUrls. + * @member {Array.} startingUrls + * @memberof google.cloud.websecurityscanner.v1.ScanConfig + * @instance + */ + ScanConfig.prototype.startingUrls = $util.emptyArray; + + /** + * ScanConfig authentication. + * @member {google.cloud.websecurityscanner.v1.ScanConfig.IAuthentication|null|undefined} authentication + * @memberof google.cloud.websecurityscanner.v1.ScanConfig + * @instance + */ + ScanConfig.prototype.authentication = null; + + /** + * ScanConfig userAgent. + * @member {google.cloud.websecurityscanner.v1.ScanConfig.UserAgent} userAgent + * @memberof google.cloud.websecurityscanner.v1.ScanConfig + * @instance + */ + ScanConfig.prototype.userAgent = 0; + + /** + * ScanConfig blacklistPatterns. + * @member {Array.} blacklistPatterns + * @memberof google.cloud.websecurityscanner.v1.ScanConfig + * @instance + */ + ScanConfig.prototype.blacklistPatterns = $util.emptyArray; + + /** + * ScanConfig schedule. + * @member {google.cloud.websecurityscanner.v1.ScanConfig.ISchedule|null|undefined} schedule + * @memberof google.cloud.websecurityscanner.v1.ScanConfig + * @instance + */ + ScanConfig.prototype.schedule = null; + + /** + * ScanConfig exportToSecurityCommandCenter. + * @member {google.cloud.websecurityscanner.v1.ScanConfig.ExportToSecurityCommandCenter} exportToSecurityCommandCenter + * @memberof google.cloud.websecurityscanner.v1.ScanConfig + * @instance + */ + ScanConfig.prototype.exportToSecurityCommandCenter = 0; + + /** + * ScanConfig riskLevel. + * @member {google.cloud.websecurityscanner.v1.ScanConfig.RiskLevel} riskLevel + * @memberof google.cloud.websecurityscanner.v1.ScanConfig + * @instance + */ + ScanConfig.prototype.riskLevel = 0; + + /** + * ScanConfig managedScan. + * @member {boolean} managedScan + * @memberof google.cloud.websecurityscanner.v1.ScanConfig + * @instance + */ + ScanConfig.prototype.managedScan = false; + + /** + * ScanConfig staticIpScan. + * @member {boolean} staticIpScan + * @memberof google.cloud.websecurityscanner.v1.ScanConfig + * @instance + */ + ScanConfig.prototype.staticIpScan = false; + + /** + * ScanConfig ignoreHttpStatusErrors. + * @member {boolean} ignoreHttpStatusErrors + * @memberof google.cloud.websecurityscanner.v1.ScanConfig + * @instance + */ + ScanConfig.prototype.ignoreHttpStatusErrors = false; + + /** + * Creates a new ScanConfig instance using the specified properties. + * @function create + * @memberof google.cloud.websecurityscanner.v1.ScanConfig + * @static + * @param {google.cloud.websecurityscanner.v1.IScanConfig=} [properties] Properties to set + * @returns {google.cloud.websecurityscanner.v1.ScanConfig} ScanConfig instance + */ + ScanConfig.create = function create(properties) { + return new ScanConfig(properties); + }; + + /** + * Encodes the specified ScanConfig message. Does not implicitly {@link google.cloud.websecurityscanner.v1.ScanConfig.verify|verify} messages. + * @function encode + * @memberof google.cloud.websecurityscanner.v1.ScanConfig + * @static + * @param {google.cloud.websecurityscanner.v1.IScanConfig} message ScanConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ScanConfig.encode = function encode(message, writer) { + if (!writer) + 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.maxQps != null && Object.hasOwnProperty.call(message, "maxQps")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.maxQps); + if (message.startingUrls != null && message.startingUrls.length) + for (var i = 0; i < message.startingUrls.length; ++i) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.startingUrls[i]); + if (message.authentication != null && Object.hasOwnProperty.call(message, "authentication")) + $root.google.cloud.websecurityscanner.v1.ScanConfig.Authentication.encode(message.authentication, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.userAgent != null && Object.hasOwnProperty.call(message, "userAgent")) + writer.uint32(/* id 6, wireType 0 =*/48).int32(message.userAgent); + if (message.blacklistPatterns != null && message.blacklistPatterns.length) + for (var i = 0; i < message.blacklistPatterns.length; ++i) + writer.uint32(/* id 7, wireType 2 =*/58).string(message.blacklistPatterns[i]); + if (message.schedule != null && Object.hasOwnProperty.call(message, "schedule")) + $root.google.cloud.websecurityscanner.v1.ScanConfig.Schedule.encode(message.schedule, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); + if (message.exportToSecurityCommandCenter != null && Object.hasOwnProperty.call(message, "exportToSecurityCommandCenter")) + writer.uint32(/* id 10, wireType 0 =*/80).int32(message.exportToSecurityCommandCenter); + if (message.riskLevel != null && Object.hasOwnProperty.call(message, "riskLevel")) + writer.uint32(/* id 12, wireType 0 =*/96).int32(message.riskLevel); + if (message.managedScan != null && Object.hasOwnProperty.call(message, "managedScan")) + writer.uint32(/* id 13, wireType 0 =*/104).bool(message.managedScan); + if (message.staticIpScan != null && Object.hasOwnProperty.call(message, "staticIpScan")) + writer.uint32(/* id 14, wireType 0 =*/112).bool(message.staticIpScan); + if (message.ignoreHttpStatusErrors != null && Object.hasOwnProperty.call(message, "ignoreHttpStatusErrors")) + writer.uint32(/* id 15, wireType 0 =*/120).bool(message.ignoreHttpStatusErrors); + return writer; + }; + + /** + * Encodes the specified ScanConfig message, length delimited. Does not implicitly {@link google.cloud.websecurityscanner.v1.ScanConfig.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.websecurityscanner.v1.ScanConfig + * @static + * @param {google.cloud.websecurityscanner.v1.IScanConfig} message ScanConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ScanConfig.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ScanConfig message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.websecurityscanner.v1.ScanConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.websecurityscanner.v1.ScanConfig} ScanConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ScanConfig.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.websecurityscanner.v1.ScanConfig(); + 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.maxQps = reader.int32(); + break; + } + case 4: { + if (!(message.startingUrls && message.startingUrls.length)) + message.startingUrls = []; + message.startingUrls.push(reader.string()); + break; + } + case 5: { + message.authentication = $root.google.cloud.websecurityscanner.v1.ScanConfig.Authentication.decode(reader, reader.uint32()); + break; + } + case 6: { + message.userAgent = reader.int32(); + break; + } + case 7: { + if (!(message.blacklistPatterns && message.blacklistPatterns.length)) + message.blacklistPatterns = []; + message.blacklistPatterns.push(reader.string()); + break; + } + case 8: { + message.schedule = $root.google.cloud.websecurityscanner.v1.ScanConfig.Schedule.decode(reader, reader.uint32()); + break; + } + case 10: { + message.exportToSecurityCommandCenter = reader.int32(); + break; + } + case 12: { + message.riskLevel = reader.int32(); + break; + } + case 13: { + message.managedScan = reader.bool(); + break; + } + case 14: { + message.staticIpScan = reader.bool(); + break; + } + case 15: { + message.ignoreHttpStatusErrors = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ScanConfig message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.websecurityscanner.v1.ScanConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.websecurityscanner.v1.ScanConfig} ScanConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ScanConfig.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ScanConfig message. + * @function verify + * @memberof google.cloud.websecurityscanner.v1.ScanConfig + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ScanConfig.verify = function verify(message) { + if (typeof message !== "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.maxQps != null && message.hasOwnProperty("maxQps")) + if (!$util.isInteger(message.maxQps)) + return "maxQps: integer expected"; + if (message.startingUrls != null && message.hasOwnProperty("startingUrls")) { + if (!Array.isArray(message.startingUrls)) + return "startingUrls: array expected"; + for (var i = 0; i < message.startingUrls.length; ++i) + if (!$util.isString(message.startingUrls[i])) + return "startingUrls: string[] expected"; + } + if (message.authentication != null && message.hasOwnProperty("authentication")) { + var error = $root.google.cloud.websecurityscanner.v1.ScanConfig.Authentication.verify(message.authentication); + if (error) + return "authentication." + error; + } + if (message.userAgent != null && message.hasOwnProperty("userAgent")) + switch (message.userAgent) { + default: + return "userAgent: enum value expected"; + case 0: + case 1: + case 2: + case 3: + break; + } + if (message.blacklistPatterns != null && message.hasOwnProperty("blacklistPatterns")) { + if (!Array.isArray(message.blacklistPatterns)) + return "blacklistPatterns: array expected"; + for (var i = 0; i < message.blacklistPatterns.length; ++i) + if (!$util.isString(message.blacklistPatterns[i])) + return "blacklistPatterns: string[] expected"; + } + if (message.schedule != null && message.hasOwnProperty("schedule")) { + var error = $root.google.cloud.websecurityscanner.v1.ScanConfig.Schedule.verify(message.schedule); + if (error) + return "schedule." + error; + } + if (message.exportToSecurityCommandCenter != null && message.hasOwnProperty("exportToSecurityCommandCenter")) + switch (message.exportToSecurityCommandCenter) { + default: + return "exportToSecurityCommandCenter: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.riskLevel != null && message.hasOwnProperty("riskLevel")) + switch (message.riskLevel) { + default: + return "riskLevel: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.managedScan != null && message.hasOwnProperty("managedScan")) + if (typeof message.managedScan !== "boolean") + return "managedScan: boolean expected"; + if (message.staticIpScan != null && message.hasOwnProperty("staticIpScan")) + if (typeof message.staticIpScan !== "boolean") + return "staticIpScan: boolean expected"; + if (message.ignoreHttpStatusErrors != null && message.hasOwnProperty("ignoreHttpStatusErrors")) + if (typeof message.ignoreHttpStatusErrors !== "boolean") + return "ignoreHttpStatusErrors: boolean expected"; + return null; + }; + + /** + * Creates a ScanConfig message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.websecurityscanner.v1.ScanConfig + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.websecurityscanner.v1.ScanConfig} ScanConfig + */ + ScanConfig.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.websecurityscanner.v1.ScanConfig) + return object; + var message = new $root.google.cloud.websecurityscanner.v1.ScanConfig(); + if (object.name != null) + message.name = String(object.name); + if (object.displayName != null) + message.displayName = String(object.displayName); + if (object.maxQps != null) + message.maxQps = object.maxQps | 0; + if (object.startingUrls) { + if (!Array.isArray(object.startingUrls)) + throw TypeError(".google.cloud.websecurityscanner.v1.ScanConfig.startingUrls: array expected"); + message.startingUrls = []; + for (var i = 0; i < object.startingUrls.length; ++i) + message.startingUrls[i] = String(object.startingUrls[i]); + } + if (object.authentication != null) { + if (typeof object.authentication !== "object") + throw TypeError(".google.cloud.websecurityscanner.v1.ScanConfig.authentication: object expected"); + message.authentication = $root.google.cloud.websecurityscanner.v1.ScanConfig.Authentication.fromObject(object.authentication); + } + switch (object.userAgent) { + default: + if (typeof object.userAgent === "number") { + message.userAgent = object.userAgent; + break; + } + break; + case "USER_AGENT_UNSPECIFIED": + case 0: + message.userAgent = 0; + break; + case "CHROME_LINUX": + case 1: + message.userAgent = 1; + break; + case "CHROME_ANDROID": + case 2: + message.userAgent = 2; + break; + case "SAFARI_IPHONE": + case 3: + message.userAgent = 3; + break; + } + if (object.blacklistPatterns) { + if (!Array.isArray(object.blacklistPatterns)) + throw TypeError(".google.cloud.websecurityscanner.v1.ScanConfig.blacklistPatterns: array expected"); + message.blacklistPatterns = []; + for (var i = 0; i < object.blacklistPatterns.length; ++i) + message.blacklistPatterns[i] = String(object.blacklistPatterns[i]); + } + if (object.schedule != null) { + if (typeof object.schedule !== "object") + throw TypeError(".google.cloud.websecurityscanner.v1.ScanConfig.schedule: object expected"); + message.schedule = $root.google.cloud.websecurityscanner.v1.ScanConfig.Schedule.fromObject(object.schedule); + } + switch (object.exportToSecurityCommandCenter) { + default: + if (typeof object.exportToSecurityCommandCenter === "number") { + message.exportToSecurityCommandCenter = object.exportToSecurityCommandCenter; + break; + } + break; + case "EXPORT_TO_SECURITY_COMMAND_CENTER_UNSPECIFIED": + case 0: + message.exportToSecurityCommandCenter = 0; + break; + case "ENABLED": + case 1: + message.exportToSecurityCommandCenter = 1; + break; + case "DISABLED": + case 2: + message.exportToSecurityCommandCenter = 2; + break; + } + switch (object.riskLevel) { + default: + if (typeof object.riskLevel === "number") { + message.riskLevel = object.riskLevel; + break; + } + break; + case "RISK_LEVEL_UNSPECIFIED": + case 0: + message.riskLevel = 0; + break; + case "NORMAL": + case 1: + message.riskLevel = 1; + break; + case "LOW": + case 2: + message.riskLevel = 2; + break; + } + if (object.managedScan != null) + message.managedScan = Boolean(object.managedScan); + if (object.staticIpScan != null) + message.staticIpScan = Boolean(object.staticIpScan); + if (object.ignoreHttpStatusErrors != null) + message.ignoreHttpStatusErrors = Boolean(object.ignoreHttpStatusErrors); + return message; + }; + + /** + * Creates a plain object from a ScanConfig message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.websecurityscanner.v1.ScanConfig + * @static + * @param {google.cloud.websecurityscanner.v1.ScanConfig} message ScanConfig + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ScanConfig.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.startingUrls = []; + object.blacklistPatterns = []; + } + if (options.defaults) { + object.name = ""; + object.displayName = ""; + object.maxQps = 0; + object.authentication = null; + object.userAgent = options.enums === String ? "USER_AGENT_UNSPECIFIED" : 0; + object.schedule = null; + object.exportToSecurityCommandCenter = options.enums === String ? "EXPORT_TO_SECURITY_COMMAND_CENTER_UNSPECIFIED" : 0; + object.riskLevel = options.enums === String ? "RISK_LEVEL_UNSPECIFIED" : 0; + object.managedScan = false; + object.staticIpScan = false; + object.ignoreHttpStatusErrors = 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.maxQps != null && message.hasOwnProperty("maxQps")) + object.maxQps = message.maxQps; + if (message.startingUrls && message.startingUrls.length) { + object.startingUrls = []; + for (var j = 0; j < message.startingUrls.length; ++j) + object.startingUrls[j] = message.startingUrls[j]; + } + if (message.authentication != null && message.hasOwnProperty("authentication")) + object.authentication = $root.google.cloud.websecurityscanner.v1.ScanConfig.Authentication.toObject(message.authentication, options); + if (message.userAgent != null && message.hasOwnProperty("userAgent")) + object.userAgent = options.enums === String ? $root.google.cloud.websecurityscanner.v1.ScanConfig.UserAgent[message.userAgent] === undefined ? message.userAgent : $root.google.cloud.websecurityscanner.v1.ScanConfig.UserAgent[message.userAgent] : message.userAgent; + if (message.blacklistPatterns && message.blacklistPatterns.length) { + object.blacklistPatterns = []; + for (var j = 0; j < message.blacklistPatterns.length; ++j) + object.blacklistPatterns[j] = message.blacklistPatterns[j]; + } + if (message.schedule != null && message.hasOwnProperty("schedule")) + object.schedule = $root.google.cloud.websecurityscanner.v1.ScanConfig.Schedule.toObject(message.schedule, options); + if (message.exportToSecurityCommandCenter != null && message.hasOwnProperty("exportToSecurityCommandCenter")) + object.exportToSecurityCommandCenter = options.enums === String ? $root.google.cloud.websecurityscanner.v1.ScanConfig.ExportToSecurityCommandCenter[message.exportToSecurityCommandCenter] === undefined ? message.exportToSecurityCommandCenter : $root.google.cloud.websecurityscanner.v1.ScanConfig.ExportToSecurityCommandCenter[message.exportToSecurityCommandCenter] : message.exportToSecurityCommandCenter; + if (message.riskLevel != null && message.hasOwnProperty("riskLevel")) + object.riskLevel = options.enums === String ? $root.google.cloud.websecurityscanner.v1.ScanConfig.RiskLevel[message.riskLevel] === undefined ? message.riskLevel : $root.google.cloud.websecurityscanner.v1.ScanConfig.RiskLevel[message.riskLevel] : message.riskLevel; + if (message.managedScan != null && message.hasOwnProperty("managedScan")) + object.managedScan = message.managedScan; + if (message.staticIpScan != null && message.hasOwnProperty("staticIpScan")) + object.staticIpScan = message.staticIpScan; + if (message.ignoreHttpStatusErrors != null && message.hasOwnProperty("ignoreHttpStatusErrors")) + object.ignoreHttpStatusErrors = message.ignoreHttpStatusErrors; + return object; + }; + + /** + * Converts this ScanConfig to JSON. + * @function toJSON + * @memberof google.cloud.websecurityscanner.v1.ScanConfig + * @instance + * @returns {Object.} JSON object + */ + ScanConfig.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ScanConfig + * @function getTypeUrl + * @memberof google.cloud.websecurityscanner.v1.ScanConfig + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ScanConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.websecurityscanner.v1.ScanConfig"; + }; + + ScanConfig.Authentication = (function() { + + /** + * Properties of an Authentication. + * @memberof google.cloud.websecurityscanner.v1.ScanConfig + * @interface IAuthentication + * @property {google.cloud.websecurityscanner.v1.ScanConfig.Authentication.IGoogleAccount|null} [googleAccount] Authentication googleAccount + * @property {google.cloud.websecurityscanner.v1.ScanConfig.Authentication.ICustomAccount|null} [customAccount] Authentication customAccount + * @property {google.cloud.websecurityscanner.v1.ScanConfig.Authentication.IIapCredential|null} [iapCredential] Authentication iapCredential + */ + + /** + * Constructs a new Authentication. + * @memberof google.cloud.websecurityscanner.v1.ScanConfig + * @classdesc Represents an Authentication. + * @implements IAuthentication + * @constructor + * @param {google.cloud.websecurityscanner.v1.ScanConfig.IAuthentication=} [properties] Properties to set + */ + function Authentication(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Authentication googleAccount. + * @member {google.cloud.websecurityscanner.v1.ScanConfig.Authentication.IGoogleAccount|null|undefined} googleAccount + * @memberof google.cloud.websecurityscanner.v1.ScanConfig.Authentication + * @instance + */ + Authentication.prototype.googleAccount = null; + + /** + * Authentication customAccount. + * @member {google.cloud.websecurityscanner.v1.ScanConfig.Authentication.ICustomAccount|null|undefined} customAccount + * @memberof google.cloud.websecurityscanner.v1.ScanConfig.Authentication + * @instance + */ + Authentication.prototype.customAccount = null; + + /** + * Authentication iapCredential. + * @member {google.cloud.websecurityscanner.v1.ScanConfig.Authentication.IIapCredential|null|undefined} iapCredential + * @memberof google.cloud.websecurityscanner.v1.ScanConfig.Authentication + * @instance + */ + Authentication.prototype.iapCredential = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * Authentication authentication. + * @member {"googleAccount"|"customAccount"|"iapCredential"|undefined} authentication + * @memberof google.cloud.websecurityscanner.v1.ScanConfig.Authentication + * @instance + */ + Object.defineProperty(Authentication.prototype, "authentication", { + get: $util.oneOfGetter($oneOfFields = ["googleAccount", "customAccount", "iapCredential"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new Authentication instance using the specified properties. + * @function create + * @memberof google.cloud.websecurityscanner.v1.ScanConfig.Authentication + * @static + * @param {google.cloud.websecurityscanner.v1.ScanConfig.IAuthentication=} [properties] Properties to set + * @returns {google.cloud.websecurityscanner.v1.ScanConfig.Authentication} Authentication instance + */ + Authentication.create = function create(properties) { + return new Authentication(properties); + }; + + /** + * Encodes the specified Authentication message. Does not implicitly {@link google.cloud.websecurityscanner.v1.ScanConfig.Authentication.verify|verify} messages. + * @function encode + * @memberof google.cloud.websecurityscanner.v1.ScanConfig.Authentication + * @static + * @param {google.cloud.websecurityscanner.v1.ScanConfig.IAuthentication} message Authentication message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Authentication.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.googleAccount != null && Object.hasOwnProperty.call(message, "googleAccount")) + $root.google.cloud.websecurityscanner.v1.ScanConfig.Authentication.GoogleAccount.encode(message.googleAccount, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.customAccount != null && Object.hasOwnProperty.call(message, "customAccount")) + $root.google.cloud.websecurityscanner.v1.ScanConfig.Authentication.CustomAccount.encode(message.customAccount, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.iapCredential != null && Object.hasOwnProperty.call(message, "iapCredential")) + $root.google.cloud.websecurityscanner.v1.ScanConfig.Authentication.IapCredential.encode(message.iapCredential, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified Authentication message, length delimited. Does not implicitly {@link google.cloud.websecurityscanner.v1.ScanConfig.Authentication.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.websecurityscanner.v1.ScanConfig.Authentication + * @static + * @param {google.cloud.websecurityscanner.v1.ScanConfig.IAuthentication} message Authentication message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Authentication.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an Authentication message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.websecurityscanner.v1.ScanConfig.Authentication + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.websecurityscanner.v1.ScanConfig.Authentication} Authentication + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Authentication.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.websecurityscanner.v1.ScanConfig.Authentication(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.googleAccount = $root.google.cloud.websecurityscanner.v1.ScanConfig.Authentication.GoogleAccount.decode(reader, reader.uint32()); + break; + } + case 2: { + message.customAccount = $root.google.cloud.websecurityscanner.v1.ScanConfig.Authentication.CustomAccount.decode(reader, reader.uint32()); + break; + } + case 4: { + message.iapCredential = $root.google.cloud.websecurityscanner.v1.ScanConfig.Authentication.IapCredential.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an Authentication message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.websecurityscanner.v1.ScanConfig.Authentication + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.websecurityscanner.v1.ScanConfig.Authentication} Authentication + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Authentication.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an Authentication message. + * @function verify + * @memberof google.cloud.websecurityscanner.v1.ScanConfig.Authentication + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Authentication.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.googleAccount != null && message.hasOwnProperty("googleAccount")) { + properties.authentication = 1; + { + var error = $root.google.cloud.websecurityscanner.v1.ScanConfig.Authentication.GoogleAccount.verify(message.googleAccount); + if (error) + return "googleAccount." + error; + } + } + if (message.customAccount != null && message.hasOwnProperty("customAccount")) { + if (properties.authentication === 1) + return "authentication: multiple values"; + properties.authentication = 1; + { + var error = $root.google.cloud.websecurityscanner.v1.ScanConfig.Authentication.CustomAccount.verify(message.customAccount); + if (error) + return "customAccount." + error; + } + } + if (message.iapCredential != null && message.hasOwnProperty("iapCredential")) { + if (properties.authentication === 1) + return "authentication: multiple values"; + properties.authentication = 1; + { + var error = $root.google.cloud.websecurityscanner.v1.ScanConfig.Authentication.IapCredential.verify(message.iapCredential); + if (error) + return "iapCredential." + error; + } + } + return null; + }; + + /** + * Creates an Authentication message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.websecurityscanner.v1.ScanConfig.Authentication + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.websecurityscanner.v1.ScanConfig.Authentication} Authentication + */ + Authentication.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.websecurityscanner.v1.ScanConfig.Authentication) + return object; + var message = new $root.google.cloud.websecurityscanner.v1.ScanConfig.Authentication(); + if (object.googleAccount != null) { + if (typeof object.googleAccount !== "object") + throw TypeError(".google.cloud.websecurityscanner.v1.ScanConfig.Authentication.googleAccount: object expected"); + message.googleAccount = $root.google.cloud.websecurityscanner.v1.ScanConfig.Authentication.GoogleAccount.fromObject(object.googleAccount); + } + if (object.customAccount != null) { + if (typeof object.customAccount !== "object") + throw TypeError(".google.cloud.websecurityscanner.v1.ScanConfig.Authentication.customAccount: object expected"); + message.customAccount = $root.google.cloud.websecurityscanner.v1.ScanConfig.Authentication.CustomAccount.fromObject(object.customAccount); + } + if (object.iapCredential != null) { + if (typeof object.iapCredential !== "object") + throw TypeError(".google.cloud.websecurityscanner.v1.ScanConfig.Authentication.iapCredential: object expected"); + message.iapCredential = $root.google.cloud.websecurityscanner.v1.ScanConfig.Authentication.IapCredential.fromObject(object.iapCredential); + } + return message; + }; + + /** + * Creates a plain object from an Authentication message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.websecurityscanner.v1.ScanConfig.Authentication + * @static + * @param {google.cloud.websecurityscanner.v1.ScanConfig.Authentication} message Authentication + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Authentication.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.googleAccount != null && message.hasOwnProperty("googleAccount")) { + object.googleAccount = $root.google.cloud.websecurityscanner.v1.ScanConfig.Authentication.GoogleAccount.toObject(message.googleAccount, options); + if (options.oneofs) + object.authentication = "googleAccount"; + } + if (message.customAccount != null && message.hasOwnProperty("customAccount")) { + object.customAccount = $root.google.cloud.websecurityscanner.v1.ScanConfig.Authentication.CustomAccount.toObject(message.customAccount, options); + if (options.oneofs) + object.authentication = "customAccount"; + } + if (message.iapCredential != null && message.hasOwnProperty("iapCredential")) { + object.iapCredential = $root.google.cloud.websecurityscanner.v1.ScanConfig.Authentication.IapCredential.toObject(message.iapCredential, options); + if (options.oneofs) + object.authentication = "iapCredential"; + } + return object; + }; + + /** + * Converts this Authentication to JSON. + * @function toJSON + * @memberof google.cloud.websecurityscanner.v1.ScanConfig.Authentication + * @instance + * @returns {Object.} JSON object + */ + Authentication.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Authentication + * @function getTypeUrl + * @memberof google.cloud.websecurityscanner.v1.ScanConfig.Authentication + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Authentication.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.websecurityscanner.v1.ScanConfig.Authentication"; + }; + + Authentication.GoogleAccount = (function() { + + /** + * Properties of a GoogleAccount. + * @memberof google.cloud.websecurityscanner.v1.ScanConfig.Authentication + * @interface IGoogleAccount + * @property {string|null} [username] GoogleAccount username + * @property {string|null} [password] GoogleAccount password + */ + + /** + * Constructs a new GoogleAccount. + * @memberof google.cloud.websecurityscanner.v1.ScanConfig.Authentication + * @classdesc Represents a GoogleAccount. + * @implements IGoogleAccount + * @constructor + * @param {google.cloud.websecurityscanner.v1.ScanConfig.Authentication.IGoogleAccount=} [properties] Properties to set + */ + function GoogleAccount(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GoogleAccount username. + * @member {string} username + * @memberof google.cloud.websecurityscanner.v1.ScanConfig.Authentication.GoogleAccount + * @instance + */ + GoogleAccount.prototype.username = ""; + + /** + * GoogleAccount password. + * @member {string} password + * @memberof google.cloud.websecurityscanner.v1.ScanConfig.Authentication.GoogleAccount + * @instance + */ + GoogleAccount.prototype.password = ""; + + /** + * Creates a new GoogleAccount instance using the specified properties. + * @function create + * @memberof google.cloud.websecurityscanner.v1.ScanConfig.Authentication.GoogleAccount + * @static + * @param {google.cloud.websecurityscanner.v1.ScanConfig.Authentication.IGoogleAccount=} [properties] Properties to set + * @returns {google.cloud.websecurityscanner.v1.ScanConfig.Authentication.GoogleAccount} GoogleAccount instance + */ + GoogleAccount.create = function create(properties) { + return new GoogleAccount(properties); + }; + + /** + * Encodes the specified GoogleAccount message. Does not implicitly {@link google.cloud.websecurityscanner.v1.ScanConfig.Authentication.GoogleAccount.verify|verify} messages. + * @function encode + * @memberof google.cloud.websecurityscanner.v1.ScanConfig.Authentication.GoogleAccount + * @static + * @param {google.cloud.websecurityscanner.v1.ScanConfig.Authentication.IGoogleAccount} message GoogleAccount message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GoogleAccount.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.username != null && Object.hasOwnProperty.call(message, "username")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.username); + if (message.password != null && Object.hasOwnProperty.call(message, "password")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.password); + return writer; + }; + + /** + * Encodes the specified GoogleAccount message, length delimited. Does not implicitly {@link google.cloud.websecurityscanner.v1.ScanConfig.Authentication.GoogleAccount.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.websecurityscanner.v1.ScanConfig.Authentication.GoogleAccount + * @static + * @param {google.cloud.websecurityscanner.v1.ScanConfig.Authentication.IGoogleAccount} message GoogleAccount message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GoogleAccount.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GoogleAccount message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.websecurityscanner.v1.ScanConfig.Authentication.GoogleAccount + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.websecurityscanner.v1.ScanConfig.Authentication.GoogleAccount} GoogleAccount + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GoogleAccount.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.websecurityscanner.v1.ScanConfig.Authentication.GoogleAccount(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.username = reader.string(); + break; + } + case 2: { + message.password = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GoogleAccount message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.websecurityscanner.v1.ScanConfig.Authentication.GoogleAccount + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.websecurityscanner.v1.ScanConfig.Authentication.GoogleAccount} GoogleAccount + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GoogleAccount.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GoogleAccount message. + * @function verify + * @memberof google.cloud.websecurityscanner.v1.ScanConfig.Authentication.GoogleAccount + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GoogleAccount.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.username != null && message.hasOwnProperty("username")) + if (!$util.isString(message.username)) + return "username: string expected"; + if (message.password != null && message.hasOwnProperty("password")) + if (!$util.isString(message.password)) + return "password: string expected"; + return null; + }; + + /** + * Creates a GoogleAccount message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.websecurityscanner.v1.ScanConfig.Authentication.GoogleAccount + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.websecurityscanner.v1.ScanConfig.Authentication.GoogleAccount} GoogleAccount + */ + GoogleAccount.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.websecurityscanner.v1.ScanConfig.Authentication.GoogleAccount) + return object; + var message = new $root.google.cloud.websecurityscanner.v1.ScanConfig.Authentication.GoogleAccount(); + if (object.username != null) + message.username = String(object.username); + if (object.password != null) + message.password = String(object.password); + return message; + }; + + /** + * Creates a plain object from a GoogleAccount message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.websecurityscanner.v1.ScanConfig.Authentication.GoogleAccount + * @static + * @param {google.cloud.websecurityscanner.v1.ScanConfig.Authentication.GoogleAccount} message GoogleAccount + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GoogleAccount.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.username = ""; + object.password = ""; + } + if (message.username != null && message.hasOwnProperty("username")) + object.username = message.username; + if (message.password != null && message.hasOwnProperty("password")) + object.password = message.password; + return object; + }; + + /** + * Converts this GoogleAccount to JSON. + * @function toJSON + * @memberof google.cloud.websecurityscanner.v1.ScanConfig.Authentication.GoogleAccount + * @instance + * @returns {Object.} JSON object + */ + GoogleAccount.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GoogleAccount + * @function getTypeUrl + * @memberof google.cloud.websecurityscanner.v1.ScanConfig.Authentication.GoogleAccount + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GoogleAccount.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.websecurityscanner.v1.ScanConfig.Authentication.GoogleAccount"; + }; + + return GoogleAccount; + })(); + + Authentication.CustomAccount = (function() { + + /** + * Properties of a CustomAccount. + * @memberof google.cloud.websecurityscanner.v1.ScanConfig.Authentication + * @interface ICustomAccount + * @property {string|null} [username] CustomAccount username + * @property {string|null} [password] CustomAccount password + * @property {string|null} [loginUrl] CustomAccount loginUrl + */ + + /** + * Constructs a new CustomAccount. + * @memberof google.cloud.websecurityscanner.v1.ScanConfig.Authentication + * @classdesc Represents a CustomAccount. + * @implements ICustomAccount + * @constructor + * @param {google.cloud.websecurityscanner.v1.ScanConfig.Authentication.ICustomAccount=} [properties] Properties to set + */ + function CustomAccount(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * CustomAccount username. + * @member {string} username + * @memberof google.cloud.websecurityscanner.v1.ScanConfig.Authentication.CustomAccount + * @instance + */ + CustomAccount.prototype.username = ""; + + /** + * CustomAccount password. + * @member {string} password + * @memberof google.cloud.websecurityscanner.v1.ScanConfig.Authentication.CustomAccount + * @instance + */ + CustomAccount.prototype.password = ""; + + /** + * CustomAccount loginUrl. + * @member {string} loginUrl + * @memberof google.cloud.websecurityscanner.v1.ScanConfig.Authentication.CustomAccount + * @instance + */ + CustomAccount.prototype.loginUrl = ""; + + /** + * Creates a new CustomAccount instance using the specified properties. + * @function create + * @memberof google.cloud.websecurityscanner.v1.ScanConfig.Authentication.CustomAccount + * @static + * @param {google.cloud.websecurityscanner.v1.ScanConfig.Authentication.ICustomAccount=} [properties] Properties to set + * @returns {google.cloud.websecurityscanner.v1.ScanConfig.Authentication.CustomAccount} CustomAccount instance + */ + CustomAccount.create = function create(properties) { + return new CustomAccount(properties); + }; + + /** + * Encodes the specified CustomAccount message. Does not implicitly {@link google.cloud.websecurityscanner.v1.ScanConfig.Authentication.CustomAccount.verify|verify} messages. + * @function encode + * @memberof google.cloud.websecurityscanner.v1.ScanConfig.Authentication.CustomAccount + * @static + * @param {google.cloud.websecurityscanner.v1.ScanConfig.Authentication.ICustomAccount} message CustomAccount message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CustomAccount.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.username != null && Object.hasOwnProperty.call(message, "username")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.username); + if (message.password != null && Object.hasOwnProperty.call(message, "password")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.password); + if (message.loginUrl != null && Object.hasOwnProperty.call(message, "loginUrl")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.loginUrl); + return writer; + }; + + /** + * Encodes the specified CustomAccount message, length delimited. Does not implicitly {@link google.cloud.websecurityscanner.v1.ScanConfig.Authentication.CustomAccount.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.websecurityscanner.v1.ScanConfig.Authentication.CustomAccount + * @static + * @param {google.cloud.websecurityscanner.v1.ScanConfig.Authentication.ICustomAccount} message CustomAccount message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CustomAccount.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CustomAccount message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.websecurityscanner.v1.ScanConfig.Authentication.CustomAccount + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.websecurityscanner.v1.ScanConfig.Authentication.CustomAccount} CustomAccount + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CustomAccount.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.websecurityscanner.v1.ScanConfig.Authentication.CustomAccount(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.username = reader.string(); + break; + } + case 2: { + message.password = reader.string(); + break; + } + case 3: { + message.loginUrl = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CustomAccount message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.websecurityscanner.v1.ScanConfig.Authentication.CustomAccount + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.websecurityscanner.v1.ScanConfig.Authentication.CustomAccount} CustomAccount + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CustomAccount.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CustomAccount message. + * @function verify + * @memberof google.cloud.websecurityscanner.v1.ScanConfig.Authentication.CustomAccount + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CustomAccount.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.username != null && message.hasOwnProperty("username")) + if (!$util.isString(message.username)) + return "username: string expected"; + if (message.password != null && message.hasOwnProperty("password")) + if (!$util.isString(message.password)) + return "password: string expected"; + if (message.loginUrl != null && message.hasOwnProperty("loginUrl")) + if (!$util.isString(message.loginUrl)) + return "loginUrl: string expected"; + return null; + }; + + /** + * Creates a CustomAccount message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.websecurityscanner.v1.ScanConfig.Authentication.CustomAccount + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.websecurityscanner.v1.ScanConfig.Authentication.CustomAccount} CustomAccount + */ + CustomAccount.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.websecurityscanner.v1.ScanConfig.Authentication.CustomAccount) + return object; + var message = new $root.google.cloud.websecurityscanner.v1.ScanConfig.Authentication.CustomAccount(); + if (object.username != null) + message.username = String(object.username); + if (object.password != null) + message.password = String(object.password); + if (object.loginUrl != null) + message.loginUrl = String(object.loginUrl); + return message; + }; + + /** + * Creates a plain object from a CustomAccount message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.websecurityscanner.v1.ScanConfig.Authentication.CustomAccount + * @static + * @param {google.cloud.websecurityscanner.v1.ScanConfig.Authentication.CustomAccount} message CustomAccount + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CustomAccount.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.username = ""; + object.password = ""; + object.loginUrl = ""; + } + if (message.username != null && message.hasOwnProperty("username")) + object.username = message.username; + if (message.password != null && message.hasOwnProperty("password")) + object.password = message.password; + if (message.loginUrl != null && message.hasOwnProperty("loginUrl")) + object.loginUrl = message.loginUrl; + return object; + }; + + /** + * Converts this CustomAccount to JSON. + * @function toJSON + * @memberof google.cloud.websecurityscanner.v1.ScanConfig.Authentication.CustomAccount + * @instance + * @returns {Object.} JSON object + */ + CustomAccount.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CustomAccount + * @function getTypeUrl + * @memberof google.cloud.websecurityscanner.v1.ScanConfig.Authentication.CustomAccount + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CustomAccount.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.websecurityscanner.v1.ScanConfig.Authentication.CustomAccount"; + }; + + return CustomAccount; + })(); + + Authentication.IapCredential = (function() { + + /** + * Properties of an IapCredential. + * @memberof google.cloud.websecurityscanner.v1.ScanConfig.Authentication + * @interface IIapCredential + * @property {google.cloud.websecurityscanner.v1.ScanConfig.Authentication.IapCredential.IIapTestServiceAccountInfo|null} [iapTestServiceAccountInfo] IapCredential iapTestServiceAccountInfo + */ + + /** + * Constructs a new IapCredential. + * @memberof google.cloud.websecurityscanner.v1.ScanConfig.Authentication + * @classdesc Represents an IapCredential. + * @implements IIapCredential + * @constructor + * @param {google.cloud.websecurityscanner.v1.ScanConfig.Authentication.IIapCredential=} [properties] Properties to set + */ + function IapCredential(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * IapCredential iapTestServiceAccountInfo. + * @member {google.cloud.websecurityscanner.v1.ScanConfig.Authentication.IapCredential.IIapTestServiceAccountInfo|null|undefined} iapTestServiceAccountInfo + * @memberof google.cloud.websecurityscanner.v1.ScanConfig.Authentication.IapCredential + * @instance + */ + IapCredential.prototype.iapTestServiceAccountInfo = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * IapCredential iapCredentials. + * @member {"iapTestServiceAccountInfo"|undefined} iapCredentials + * @memberof google.cloud.websecurityscanner.v1.ScanConfig.Authentication.IapCredential + * @instance + */ + Object.defineProperty(IapCredential.prototype, "iapCredentials", { + get: $util.oneOfGetter($oneOfFields = ["iapTestServiceAccountInfo"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new IapCredential instance using the specified properties. + * @function create + * @memberof google.cloud.websecurityscanner.v1.ScanConfig.Authentication.IapCredential + * @static + * @param {google.cloud.websecurityscanner.v1.ScanConfig.Authentication.IIapCredential=} [properties] Properties to set + * @returns {google.cloud.websecurityscanner.v1.ScanConfig.Authentication.IapCredential} IapCredential instance + */ + IapCredential.create = function create(properties) { + return new IapCredential(properties); + }; + + /** + * Encodes the specified IapCredential message. Does not implicitly {@link google.cloud.websecurityscanner.v1.ScanConfig.Authentication.IapCredential.verify|verify} messages. + * @function encode + * @memberof google.cloud.websecurityscanner.v1.ScanConfig.Authentication.IapCredential + * @static + * @param {google.cloud.websecurityscanner.v1.ScanConfig.Authentication.IIapCredential} message IapCredential message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + IapCredential.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.iapTestServiceAccountInfo != null && Object.hasOwnProperty.call(message, "iapTestServiceAccountInfo")) + $root.google.cloud.websecurityscanner.v1.ScanConfig.Authentication.IapCredential.IapTestServiceAccountInfo.encode(message.iapTestServiceAccountInfo, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified IapCredential message, length delimited. Does not implicitly {@link google.cloud.websecurityscanner.v1.ScanConfig.Authentication.IapCredential.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.websecurityscanner.v1.ScanConfig.Authentication.IapCredential + * @static + * @param {google.cloud.websecurityscanner.v1.ScanConfig.Authentication.IIapCredential} message IapCredential message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + IapCredential.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an IapCredential message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.websecurityscanner.v1.ScanConfig.Authentication.IapCredential + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.websecurityscanner.v1.ScanConfig.Authentication.IapCredential} IapCredential + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + IapCredential.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.websecurityscanner.v1.ScanConfig.Authentication.IapCredential(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.iapTestServiceAccountInfo = $root.google.cloud.websecurityscanner.v1.ScanConfig.Authentication.IapCredential.IapTestServiceAccountInfo.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an IapCredential message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.websecurityscanner.v1.ScanConfig.Authentication.IapCredential + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.websecurityscanner.v1.ScanConfig.Authentication.IapCredential} IapCredential + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + IapCredential.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an IapCredential message. + * @function verify + * @memberof google.cloud.websecurityscanner.v1.ScanConfig.Authentication.IapCredential + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + IapCredential.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.iapTestServiceAccountInfo != null && message.hasOwnProperty("iapTestServiceAccountInfo")) { + properties.iapCredentials = 1; + { + var error = $root.google.cloud.websecurityscanner.v1.ScanConfig.Authentication.IapCredential.IapTestServiceAccountInfo.verify(message.iapTestServiceAccountInfo); + if (error) + return "iapTestServiceAccountInfo." + error; + } + } + return null; + }; + + /** + * Creates an IapCredential message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.websecurityscanner.v1.ScanConfig.Authentication.IapCredential + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.websecurityscanner.v1.ScanConfig.Authentication.IapCredential} IapCredential + */ + IapCredential.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.websecurityscanner.v1.ScanConfig.Authentication.IapCredential) + return object; + var message = new $root.google.cloud.websecurityscanner.v1.ScanConfig.Authentication.IapCredential(); + if (object.iapTestServiceAccountInfo != null) { + if (typeof object.iapTestServiceAccountInfo !== "object") + throw TypeError(".google.cloud.websecurityscanner.v1.ScanConfig.Authentication.IapCredential.iapTestServiceAccountInfo: object expected"); + message.iapTestServiceAccountInfo = $root.google.cloud.websecurityscanner.v1.ScanConfig.Authentication.IapCredential.IapTestServiceAccountInfo.fromObject(object.iapTestServiceAccountInfo); + } + return message; + }; + + /** + * Creates a plain object from an IapCredential message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.websecurityscanner.v1.ScanConfig.Authentication.IapCredential + * @static + * @param {google.cloud.websecurityscanner.v1.ScanConfig.Authentication.IapCredential} message IapCredential + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + IapCredential.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.iapTestServiceAccountInfo != null && message.hasOwnProperty("iapTestServiceAccountInfo")) { + object.iapTestServiceAccountInfo = $root.google.cloud.websecurityscanner.v1.ScanConfig.Authentication.IapCredential.IapTestServiceAccountInfo.toObject(message.iapTestServiceAccountInfo, options); + if (options.oneofs) + object.iapCredentials = "iapTestServiceAccountInfo"; + } + return object; + }; + + /** + * Converts this IapCredential to JSON. + * @function toJSON + * @memberof google.cloud.websecurityscanner.v1.ScanConfig.Authentication.IapCredential + * @instance + * @returns {Object.} JSON object + */ + IapCredential.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for IapCredential + * @function getTypeUrl + * @memberof google.cloud.websecurityscanner.v1.ScanConfig.Authentication.IapCredential + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + IapCredential.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.websecurityscanner.v1.ScanConfig.Authentication.IapCredential"; + }; + + IapCredential.IapTestServiceAccountInfo = (function() { + + /** + * Properties of an IapTestServiceAccountInfo. + * @memberof google.cloud.websecurityscanner.v1.ScanConfig.Authentication.IapCredential + * @interface IIapTestServiceAccountInfo + * @property {string|null} [targetAudienceClientId] IapTestServiceAccountInfo targetAudienceClientId + */ + + /** + * Constructs a new IapTestServiceAccountInfo. + * @memberof google.cloud.websecurityscanner.v1.ScanConfig.Authentication.IapCredential + * @classdesc Represents an IapTestServiceAccountInfo. + * @implements IIapTestServiceAccountInfo + * @constructor + * @param {google.cloud.websecurityscanner.v1.ScanConfig.Authentication.IapCredential.IIapTestServiceAccountInfo=} [properties] Properties to set + */ + function IapTestServiceAccountInfo(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * IapTestServiceAccountInfo targetAudienceClientId. + * @member {string} targetAudienceClientId + * @memberof google.cloud.websecurityscanner.v1.ScanConfig.Authentication.IapCredential.IapTestServiceAccountInfo + * @instance + */ + IapTestServiceAccountInfo.prototype.targetAudienceClientId = ""; + + /** + * Creates a new IapTestServiceAccountInfo instance using the specified properties. + * @function create + * @memberof google.cloud.websecurityscanner.v1.ScanConfig.Authentication.IapCredential.IapTestServiceAccountInfo + * @static + * @param {google.cloud.websecurityscanner.v1.ScanConfig.Authentication.IapCredential.IIapTestServiceAccountInfo=} [properties] Properties to set + * @returns {google.cloud.websecurityscanner.v1.ScanConfig.Authentication.IapCredential.IapTestServiceAccountInfo} IapTestServiceAccountInfo instance + */ + IapTestServiceAccountInfo.create = function create(properties) { + return new IapTestServiceAccountInfo(properties); + }; + + /** + * Encodes the specified IapTestServiceAccountInfo message. Does not implicitly {@link google.cloud.websecurityscanner.v1.ScanConfig.Authentication.IapCredential.IapTestServiceAccountInfo.verify|verify} messages. + * @function encode + * @memberof google.cloud.websecurityscanner.v1.ScanConfig.Authentication.IapCredential.IapTestServiceAccountInfo + * @static + * @param {google.cloud.websecurityscanner.v1.ScanConfig.Authentication.IapCredential.IIapTestServiceAccountInfo} message IapTestServiceAccountInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + IapTestServiceAccountInfo.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.targetAudienceClientId != null && Object.hasOwnProperty.call(message, "targetAudienceClientId")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.targetAudienceClientId); + return writer; + }; + + /** + * Encodes the specified IapTestServiceAccountInfo message, length delimited. Does not implicitly {@link google.cloud.websecurityscanner.v1.ScanConfig.Authentication.IapCredential.IapTestServiceAccountInfo.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.websecurityscanner.v1.ScanConfig.Authentication.IapCredential.IapTestServiceAccountInfo + * @static + * @param {google.cloud.websecurityscanner.v1.ScanConfig.Authentication.IapCredential.IIapTestServiceAccountInfo} message IapTestServiceAccountInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + IapTestServiceAccountInfo.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an IapTestServiceAccountInfo message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.websecurityscanner.v1.ScanConfig.Authentication.IapCredential.IapTestServiceAccountInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.websecurityscanner.v1.ScanConfig.Authentication.IapCredential.IapTestServiceAccountInfo} IapTestServiceAccountInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + IapTestServiceAccountInfo.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.websecurityscanner.v1.ScanConfig.Authentication.IapCredential.IapTestServiceAccountInfo(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.targetAudienceClientId = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an IapTestServiceAccountInfo message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.websecurityscanner.v1.ScanConfig.Authentication.IapCredential.IapTestServiceAccountInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.websecurityscanner.v1.ScanConfig.Authentication.IapCredential.IapTestServiceAccountInfo} IapTestServiceAccountInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + IapTestServiceAccountInfo.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an IapTestServiceAccountInfo message. + * @function verify + * @memberof google.cloud.websecurityscanner.v1.ScanConfig.Authentication.IapCredential.IapTestServiceAccountInfo + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + IapTestServiceAccountInfo.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.targetAudienceClientId != null && message.hasOwnProperty("targetAudienceClientId")) + if (!$util.isString(message.targetAudienceClientId)) + return "targetAudienceClientId: string expected"; + return null; + }; + + /** + * Creates an IapTestServiceAccountInfo message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.websecurityscanner.v1.ScanConfig.Authentication.IapCredential.IapTestServiceAccountInfo + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.websecurityscanner.v1.ScanConfig.Authentication.IapCredential.IapTestServiceAccountInfo} IapTestServiceAccountInfo + */ + IapTestServiceAccountInfo.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.websecurityscanner.v1.ScanConfig.Authentication.IapCredential.IapTestServiceAccountInfo) + return object; + var message = new $root.google.cloud.websecurityscanner.v1.ScanConfig.Authentication.IapCredential.IapTestServiceAccountInfo(); + if (object.targetAudienceClientId != null) + message.targetAudienceClientId = String(object.targetAudienceClientId); + return message; + }; + + /** + * Creates a plain object from an IapTestServiceAccountInfo message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.websecurityscanner.v1.ScanConfig.Authentication.IapCredential.IapTestServiceAccountInfo + * @static + * @param {google.cloud.websecurityscanner.v1.ScanConfig.Authentication.IapCredential.IapTestServiceAccountInfo} message IapTestServiceAccountInfo + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + IapTestServiceAccountInfo.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.targetAudienceClientId = ""; + if (message.targetAudienceClientId != null && message.hasOwnProperty("targetAudienceClientId")) + object.targetAudienceClientId = message.targetAudienceClientId; + return object; + }; + + /** + * Converts this IapTestServiceAccountInfo to JSON. + * @function toJSON + * @memberof google.cloud.websecurityscanner.v1.ScanConfig.Authentication.IapCredential.IapTestServiceAccountInfo + * @instance + * @returns {Object.} JSON object + */ + IapTestServiceAccountInfo.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for IapTestServiceAccountInfo + * @function getTypeUrl + * @memberof google.cloud.websecurityscanner.v1.ScanConfig.Authentication.IapCredential.IapTestServiceAccountInfo + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + IapTestServiceAccountInfo.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.websecurityscanner.v1.ScanConfig.Authentication.IapCredential.IapTestServiceAccountInfo"; + }; + + return IapTestServiceAccountInfo; + })(); + + return IapCredential; + })(); + + return Authentication; + })(); + + ScanConfig.Schedule = (function() { + + /** + * Properties of a Schedule. + * @memberof google.cloud.websecurityscanner.v1.ScanConfig + * @interface ISchedule + * @property {google.protobuf.ITimestamp|null} [scheduleTime] Schedule scheduleTime + * @property {number|null} [intervalDurationDays] Schedule intervalDurationDays + */ + + /** + * Constructs a new Schedule. + * @memberof google.cloud.websecurityscanner.v1.ScanConfig + * @classdesc Represents a Schedule. + * @implements ISchedule + * @constructor + * @param {google.cloud.websecurityscanner.v1.ScanConfig.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]]; + } + + /** + * Schedule scheduleTime. + * @member {google.protobuf.ITimestamp|null|undefined} scheduleTime + * @memberof google.cloud.websecurityscanner.v1.ScanConfig.Schedule + * @instance + */ + Schedule.prototype.scheduleTime = null; + + /** + * Schedule intervalDurationDays. + * @member {number} intervalDurationDays + * @memberof google.cloud.websecurityscanner.v1.ScanConfig.Schedule + * @instance + */ + Schedule.prototype.intervalDurationDays = 0; + + /** + * Creates a new Schedule instance using the specified properties. + * @function create + * @memberof google.cloud.websecurityscanner.v1.ScanConfig.Schedule + * @static + * @param {google.cloud.websecurityscanner.v1.ScanConfig.ISchedule=} [properties] Properties to set + * @returns {google.cloud.websecurityscanner.v1.ScanConfig.Schedule} Schedule instance + */ + Schedule.create = function create(properties) { + return new Schedule(properties); + }; + + /** + * Encodes the specified Schedule message. Does not implicitly {@link google.cloud.websecurityscanner.v1.ScanConfig.Schedule.verify|verify} messages. + * @function encode + * @memberof google.cloud.websecurityscanner.v1.ScanConfig.Schedule + * @static + * @param {google.cloud.websecurityscanner.v1.ScanConfig.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.scheduleTime != null && Object.hasOwnProperty.call(message, "scheduleTime")) + $root.google.protobuf.Timestamp.encode(message.scheduleTime, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.intervalDurationDays != null && Object.hasOwnProperty.call(message, "intervalDurationDays")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.intervalDurationDays); + return writer; + }; + + /** + * Encodes the specified Schedule message, length delimited. Does not implicitly {@link google.cloud.websecurityscanner.v1.ScanConfig.Schedule.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.websecurityscanner.v1.ScanConfig.Schedule + * @static + * @param {google.cloud.websecurityscanner.v1.ScanConfig.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(); + }; + + /** + * Decodes a Schedule message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.websecurityscanner.v1.ScanConfig.Schedule + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.websecurityscanner.v1.ScanConfig.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.websecurityscanner.v1.ScanConfig.Schedule(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.scheduleTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 2: { + message.intervalDurationDays = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Schedule message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.websecurityscanner.v1.ScanConfig.Schedule + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.websecurityscanner.v1.ScanConfig.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()); + }; + + /** + * Verifies a Schedule message. + * @function verify + * @memberof google.cloud.websecurityscanner.v1.ScanConfig.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"; + if (message.scheduleTime != null && message.hasOwnProperty("scheduleTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.scheduleTime); + if (error) + return "scheduleTime." + error; + } + if (message.intervalDurationDays != null && message.hasOwnProperty("intervalDurationDays")) + if (!$util.isInteger(message.intervalDurationDays)) + return "intervalDurationDays: integer expected"; + return null; + }; + + /** + * Creates a Schedule message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.websecurityscanner.v1.ScanConfig.Schedule + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.websecurityscanner.v1.ScanConfig.Schedule} Schedule + */ + Schedule.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.websecurityscanner.v1.ScanConfig.Schedule) + return object; + var message = new $root.google.cloud.websecurityscanner.v1.ScanConfig.Schedule(); + if (object.scheduleTime != null) { + if (typeof object.scheduleTime !== "object") + throw TypeError(".google.cloud.websecurityscanner.v1.ScanConfig.Schedule.scheduleTime: object expected"); + message.scheduleTime = $root.google.protobuf.Timestamp.fromObject(object.scheduleTime); + } + if (object.intervalDurationDays != null) + message.intervalDurationDays = object.intervalDurationDays | 0; + return message; + }; + + /** + * Creates a plain object from a Schedule message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.websecurityscanner.v1.ScanConfig.Schedule + * @static + * @param {google.cloud.websecurityscanner.v1.ScanConfig.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.scheduleTime = null; + object.intervalDurationDays = 0; + } + if (message.scheduleTime != null && message.hasOwnProperty("scheduleTime")) + object.scheduleTime = $root.google.protobuf.Timestamp.toObject(message.scheduleTime, options); + if (message.intervalDurationDays != null && message.hasOwnProperty("intervalDurationDays")) + object.intervalDurationDays = message.intervalDurationDays; + return object; + }; + + /** + * Converts this Schedule to JSON. + * @function toJSON + * @memberof google.cloud.websecurityscanner.v1.ScanConfig.Schedule + * @instance + * @returns {Object.} JSON object + */ + Schedule.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Schedule + * @function getTypeUrl + * @memberof google.cloud.websecurityscanner.v1.ScanConfig.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.websecurityscanner.v1.ScanConfig.Schedule"; + }; + + return Schedule; + })(); + + /** + * UserAgent enum. + * @name google.cloud.websecurityscanner.v1.ScanConfig.UserAgent + * @enum {number} + * @property {number} USER_AGENT_UNSPECIFIED=0 USER_AGENT_UNSPECIFIED value + * @property {number} CHROME_LINUX=1 CHROME_LINUX value + * @property {number} CHROME_ANDROID=2 CHROME_ANDROID value + * @property {number} SAFARI_IPHONE=3 SAFARI_IPHONE value + */ + ScanConfig.UserAgent = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "USER_AGENT_UNSPECIFIED"] = 0; + values[valuesById[1] = "CHROME_LINUX"] = 1; + values[valuesById[2] = "CHROME_ANDROID"] = 2; + values[valuesById[3] = "SAFARI_IPHONE"] = 3; + return values; + })(); + + /** + * RiskLevel enum. + * @name google.cloud.websecurityscanner.v1.ScanConfig.RiskLevel + * @enum {number} + * @property {number} RISK_LEVEL_UNSPECIFIED=0 RISK_LEVEL_UNSPECIFIED value + * @property {number} NORMAL=1 NORMAL value + * @property {number} LOW=2 LOW value + */ + ScanConfig.RiskLevel = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "RISK_LEVEL_UNSPECIFIED"] = 0; + values[valuesById[1] = "NORMAL"] = 1; + values[valuesById[2] = "LOW"] = 2; + return values; + })(); + + /** + * ExportToSecurityCommandCenter enum. + * @name google.cloud.websecurityscanner.v1.ScanConfig.ExportToSecurityCommandCenter + * @enum {number} + * @property {number} EXPORT_TO_SECURITY_COMMAND_CENTER_UNSPECIFIED=0 EXPORT_TO_SECURITY_COMMAND_CENTER_UNSPECIFIED value + * @property {number} ENABLED=1 ENABLED value + * @property {number} DISABLED=2 DISABLED value + */ + ScanConfig.ExportToSecurityCommandCenter = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "EXPORT_TO_SECURITY_COMMAND_CENTER_UNSPECIFIED"] = 0; + values[valuesById[1] = "ENABLED"] = 1; + values[valuesById[2] = "DISABLED"] = 2; + return values; + })(); + + return ScanConfig; + })(); + + v1.ScanConfigError = (function() { + + /** + * Properties of a ScanConfigError. + * @memberof google.cloud.websecurityscanner.v1 + * @interface IScanConfigError + * @property {google.cloud.websecurityscanner.v1.ScanConfigError.Code|null} [code] ScanConfigError code + * @property {string|null} [fieldName] ScanConfigError fieldName + */ + + /** + * Constructs a new ScanConfigError. + * @memberof google.cloud.websecurityscanner.v1 + * @classdesc Represents a ScanConfigError. + * @implements IScanConfigError + * @constructor + * @param {google.cloud.websecurityscanner.v1.IScanConfigError=} [properties] Properties to set + */ + function ScanConfigError(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ScanConfigError code. + * @member {google.cloud.websecurityscanner.v1.ScanConfigError.Code} code + * @memberof google.cloud.websecurityscanner.v1.ScanConfigError + * @instance + */ + ScanConfigError.prototype.code = 0; + + /** + * ScanConfigError fieldName. + * @member {string} fieldName + * @memberof google.cloud.websecurityscanner.v1.ScanConfigError + * @instance + */ + ScanConfigError.prototype.fieldName = ""; + + /** + * Creates a new ScanConfigError instance using the specified properties. + * @function create + * @memberof google.cloud.websecurityscanner.v1.ScanConfigError + * @static + * @param {google.cloud.websecurityscanner.v1.IScanConfigError=} [properties] Properties to set + * @returns {google.cloud.websecurityscanner.v1.ScanConfigError} ScanConfigError instance + */ + ScanConfigError.create = function create(properties) { + return new ScanConfigError(properties); + }; + + /** + * Encodes the specified ScanConfigError message. Does not implicitly {@link google.cloud.websecurityscanner.v1.ScanConfigError.verify|verify} messages. + * @function encode + * @memberof google.cloud.websecurityscanner.v1.ScanConfigError + * @static + * @param {google.cloud.websecurityscanner.v1.IScanConfigError} message ScanConfigError message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ScanConfigError.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.fieldName != null && Object.hasOwnProperty.call(message, "fieldName")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.fieldName); + return writer; + }; + + /** + * Encodes the specified ScanConfigError message, length delimited. Does not implicitly {@link google.cloud.websecurityscanner.v1.ScanConfigError.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.websecurityscanner.v1.ScanConfigError + * @static + * @param {google.cloud.websecurityscanner.v1.IScanConfigError} message ScanConfigError message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ScanConfigError.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ScanConfigError message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.websecurityscanner.v1.ScanConfigError + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.websecurityscanner.v1.ScanConfigError} ScanConfigError + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ScanConfigError.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.websecurityscanner.v1.ScanConfigError(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.code = reader.int32(); + break; + } + case 2: { + message.fieldName = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ScanConfigError message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.websecurityscanner.v1.ScanConfigError + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.websecurityscanner.v1.ScanConfigError} ScanConfigError + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ScanConfigError.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ScanConfigError message. + * @function verify + * @memberof google.cloud.websecurityscanner.v1.ScanConfigError + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ScanConfigError.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.code != null && message.hasOwnProperty("code")) + switch (message.code) { + default: + return "code: enum value expected"; + case 0: + case 0: + case 1: + case 2: + case 3: + case 4: + case 6: + case 7: + case 8: + case 9: + case 10: + case 11: + case 12: + case 13: + case 14: + case 15: + case 16: + case 18: + case 19: + case 20: + case 21: + case 43: + case 22: + case 23: + case 24: + case 25: + case 26: + case 27: + case 28: + case 29: + case 30: + case 31: + case 32: + case 33: + case 35: + case 36: + case 37: + case 38: + case 39: + case 40: + case 41: + case 42: + break; + } + if (message.fieldName != null && message.hasOwnProperty("fieldName")) + if (!$util.isString(message.fieldName)) + return "fieldName: string expected"; + return null; + }; + + /** + * Creates a ScanConfigError message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.websecurityscanner.v1.ScanConfigError + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.websecurityscanner.v1.ScanConfigError} ScanConfigError + */ + ScanConfigError.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.websecurityscanner.v1.ScanConfigError) + return object; + var message = new $root.google.cloud.websecurityscanner.v1.ScanConfigError(); + switch (object.code) { + default: + if (typeof object.code === "number") { + message.code = object.code; + break; + } + break; + case "CODE_UNSPECIFIED": + case 0: + message.code = 0; + break; + case "OK": + case 0: + message.code = 0; + break; + case "INTERNAL_ERROR": + case 1: + message.code = 1; + break; + case "APPENGINE_API_BACKEND_ERROR": + case 2: + message.code = 2; + break; + case "APPENGINE_API_NOT_ACCESSIBLE": + case 3: + message.code = 3; + break; + case "APPENGINE_DEFAULT_HOST_MISSING": + case 4: + message.code = 4; + break; + case "CANNOT_USE_GOOGLE_COM_ACCOUNT": + case 6: + message.code = 6; + break; + case "CANNOT_USE_OWNER_ACCOUNT": + case 7: + message.code = 7; + break; + case "COMPUTE_API_BACKEND_ERROR": + case 8: + message.code = 8; + break; + case "COMPUTE_API_NOT_ACCESSIBLE": + case 9: + message.code = 9; + break; + case "CUSTOM_LOGIN_URL_DOES_NOT_BELONG_TO_CURRENT_PROJECT": + case 10: + message.code = 10; + break; + case "CUSTOM_LOGIN_URL_MALFORMED": + case 11: + message.code = 11; + break; + case "CUSTOM_LOGIN_URL_MAPPED_TO_NON_ROUTABLE_ADDRESS": + case 12: + message.code = 12; + break; + case "CUSTOM_LOGIN_URL_MAPPED_TO_UNRESERVED_ADDRESS": + case 13: + message.code = 13; + break; + case "CUSTOM_LOGIN_URL_HAS_NON_ROUTABLE_IP_ADDRESS": + case 14: + message.code = 14; + break; + case "CUSTOM_LOGIN_URL_HAS_UNRESERVED_IP_ADDRESS": + case 15: + message.code = 15; + break; + case "DUPLICATE_SCAN_NAME": + case 16: + message.code = 16; + break; + case "INVALID_FIELD_VALUE": + case 18: + message.code = 18; + break; + case "FAILED_TO_AUTHENTICATE_TO_TARGET": + case 19: + message.code = 19; + break; + case "FINDING_TYPE_UNSPECIFIED": + case 20: + message.code = 20; + break; + case "FORBIDDEN_TO_SCAN_COMPUTE": + case 21: + message.code = 21; + break; + case "FORBIDDEN_UPDATE_TO_MANAGED_SCAN": + case 43: + message.code = 43; + break; + case "MALFORMED_FILTER": + case 22: + message.code = 22; + break; + case "MALFORMED_RESOURCE_NAME": + case 23: + message.code = 23; + break; + case "PROJECT_INACTIVE": + case 24: + message.code = 24; + break; + case "REQUIRED_FIELD": + case 25: + message.code = 25; + break; + case "RESOURCE_NAME_INCONSISTENT": + case 26: + message.code = 26; + break; + case "SCAN_ALREADY_RUNNING": + case 27: + message.code = 27; + break; + case "SCAN_NOT_RUNNING": + case 28: + message.code = 28; + break; + case "SEED_URL_DOES_NOT_BELONG_TO_CURRENT_PROJECT": + case 29: + message.code = 29; + break; + case "SEED_URL_MALFORMED": + case 30: + message.code = 30; + break; + case "SEED_URL_MAPPED_TO_NON_ROUTABLE_ADDRESS": + case 31: + message.code = 31; + break; + case "SEED_URL_MAPPED_TO_UNRESERVED_ADDRESS": + case 32: + message.code = 32; + break; + case "SEED_URL_HAS_NON_ROUTABLE_IP_ADDRESS": + case 33: + message.code = 33; + break; + case "SEED_URL_HAS_UNRESERVED_IP_ADDRESS": + case 35: + message.code = 35; + break; + case "SERVICE_ACCOUNT_NOT_CONFIGURED": + case 36: + message.code = 36; + break; + case "TOO_MANY_SCANS": + case 37: + message.code = 37; + break; + case "UNABLE_TO_RESOLVE_PROJECT_INFO": + case 38: + message.code = 38; + break; + case "UNSUPPORTED_BLACKLIST_PATTERN_FORMAT": + case 39: + message.code = 39; + break; + case "UNSUPPORTED_FILTER": + case 40: + message.code = 40; + break; + case "UNSUPPORTED_FINDING_TYPE": + case 41: + message.code = 41; + break; + case "UNSUPPORTED_URL_SCHEME": + case 42: + message.code = 42; + break; + } + if (object.fieldName != null) + message.fieldName = String(object.fieldName); + return message; + }; + + /** + * Creates a plain object from a ScanConfigError message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.websecurityscanner.v1.ScanConfigError + * @static + * @param {google.cloud.websecurityscanner.v1.ScanConfigError} message ScanConfigError + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ScanConfigError.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.code = options.enums === String ? "CODE_UNSPECIFIED" : 0; + object.fieldName = ""; + } + if (message.code != null && message.hasOwnProperty("code")) + object.code = options.enums === String ? $root.google.cloud.websecurityscanner.v1.ScanConfigError.Code[message.code] === undefined ? message.code : $root.google.cloud.websecurityscanner.v1.ScanConfigError.Code[message.code] : message.code; + if (message.fieldName != null && message.hasOwnProperty("fieldName")) + object.fieldName = message.fieldName; + return object; + }; + + /** + * Converts this ScanConfigError to JSON. + * @function toJSON + * @memberof google.cloud.websecurityscanner.v1.ScanConfigError + * @instance + * @returns {Object.} JSON object + */ + ScanConfigError.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ScanConfigError + * @function getTypeUrl + * @memberof google.cloud.websecurityscanner.v1.ScanConfigError + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ScanConfigError.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.websecurityscanner.v1.ScanConfigError"; + }; + + /** + * Code enum. + * @name google.cloud.websecurityscanner.v1.ScanConfigError.Code + * @enum {number} + * @property {number} CODE_UNSPECIFIED=0 CODE_UNSPECIFIED value + * @property {number} OK=0 OK value + * @property {number} INTERNAL_ERROR=1 INTERNAL_ERROR value + * @property {number} APPENGINE_API_BACKEND_ERROR=2 APPENGINE_API_BACKEND_ERROR value + * @property {number} APPENGINE_API_NOT_ACCESSIBLE=3 APPENGINE_API_NOT_ACCESSIBLE value + * @property {number} APPENGINE_DEFAULT_HOST_MISSING=4 APPENGINE_DEFAULT_HOST_MISSING value + * @property {number} CANNOT_USE_GOOGLE_COM_ACCOUNT=6 CANNOT_USE_GOOGLE_COM_ACCOUNT value + * @property {number} CANNOT_USE_OWNER_ACCOUNT=7 CANNOT_USE_OWNER_ACCOUNT value + * @property {number} COMPUTE_API_BACKEND_ERROR=8 COMPUTE_API_BACKEND_ERROR value + * @property {number} COMPUTE_API_NOT_ACCESSIBLE=9 COMPUTE_API_NOT_ACCESSIBLE value + * @property {number} CUSTOM_LOGIN_URL_DOES_NOT_BELONG_TO_CURRENT_PROJECT=10 CUSTOM_LOGIN_URL_DOES_NOT_BELONG_TO_CURRENT_PROJECT value + * @property {number} CUSTOM_LOGIN_URL_MALFORMED=11 CUSTOM_LOGIN_URL_MALFORMED value + * @property {number} CUSTOM_LOGIN_URL_MAPPED_TO_NON_ROUTABLE_ADDRESS=12 CUSTOM_LOGIN_URL_MAPPED_TO_NON_ROUTABLE_ADDRESS value + * @property {number} CUSTOM_LOGIN_URL_MAPPED_TO_UNRESERVED_ADDRESS=13 CUSTOM_LOGIN_URL_MAPPED_TO_UNRESERVED_ADDRESS value + * @property {number} CUSTOM_LOGIN_URL_HAS_NON_ROUTABLE_IP_ADDRESS=14 CUSTOM_LOGIN_URL_HAS_NON_ROUTABLE_IP_ADDRESS value + * @property {number} CUSTOM_LOGIN_URL_HAS_UNRESERVED_IP_ADDRESS=15 CUSTOM_LOGIN_URL_HAS_UNRESERVED_IP_ADDRESS value + * @property {number} DUPLICATE_SCAN_NAME=16 DUPLICATE_SCAN_NAME value + * @property {number} INVALID_FIELD_VALUE=18 INVALID_FIELD_VALUE value + * @property {number} FAILED_TO_AUTHENTICATE_TO_TARGET=19 FAILED_TO_AUTHENTICATE_TO_TARGET value + * @property {number} FINDING_TYPE_UNSPECIFIED=20 FINDING_TYPE_UNSPECIFIED value + * @property {number} FORBIDDEN_TO_SCAN_COMPUTE=21 FORBIDDEN_TO_SCAN_COMPUTE value + * @property {number} FORBIDDEN_UPDATE_TO_MANAGED_SCAN=43 FORBIDDEN_UPDATE_TO_MANAGED_SCAN value + * @property {number} MALFORMED_FILTER=22 MALFORMED_FILTER value + * @property {number} MALFORMED_RESOURCE_NAME=23 MALFORMED_RESOURCE_NAME value + * @property {number} PROJECT_INACTIVE=24 PROJECT_INACTIVE value + * @property {number} REQUIRED_FIELD=25 REQUIRED_FIELD value + * @property {number} RESOURCE_NAME_INCONSISTENT=26 RESOURCE_NAME_INCONSISTENT value + * @property {number} SCAN_ALREADY_RUNNING=27 SCAN_ALREADY_RUNNING value + * @property {number} SCAN_NOT_RUNNING=28 SCAN_NOT_RUNNING value + * @property {number} SEED_URL_DOES_NOT_BELONG_TO_CURRENT_PROJECT=29 SEED_URL_DOES_NOT_BELONG_TO_CURRENT_PROJECT value + * @property {number} SEED_URL_MALFORMED=30 SEED_URL_MALFORMED value + * @property {number} SEED_URL_MAPPED_TO_NON_ROUTABLE_ADDRESS=31 SEED_URL_MAPPED_TO_NON_ROUTABLE_ADDRESS value + * @property {number} SEED_URL_MAPPED_TO_UNRESERVED_ADDRESS=32 SEED_URL_MAPPED_TO_UNRESERVED_ADDRESS value + * @property {number} SEED_URL_HAS_NON_ROUTABLE_IP_ADDRESS=33 SEED_URL_HAS_NON_ROUTABLE_IP_ADDRESS value + * @property {number} SEED_URL_HAS_UNRESERVED_IP_ADDRESS=35 SEED_URL_HAS_UNRESERVED_IP_ADDRESS value + * @property {number} SERVICE_ACCOUNT_NOT_CONFIGURED=36 SERVICE_ACCOUNT_NOT_CONFIGURED value + * @property {number} TOO_MANY_SCANS=37 TOO_MANY_SCANS value + * @property {number} UNABLE_TO_RESOLVE_PROJECT_INFO=38 UNABLE_TO_RESOLVE_PROJECT_INFO value + * @property {number} UNSUPPORTED_BLACKLIST_PATTERN_FORMAT=39 UNSUPPORTED_BLACKLIST_PATTERN_FORMAT value + * @property {number} UNSUPPORTED_FILTER=40 UNSUPPORTED_FILTER value + * @property {number} UNSUPPORTED_FINDING_TYPE=41 UNSUPPORTED_FINDING_TYPE value + * @property {number} UNSUPPORTED_URL_SCHEME=42 UNSUPPORTED_URL_SCHEME value + */ + ScanConfigError.Code = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "CODE_UNSPECIFIED"] = 0; + values["OK"] = 0; + values[valuesById[1] = "INTERNAL_ERROR"] = 1; + values[valuesById[2] = "APPENGINE_API_BACKEND_ERROR"] = 2; + values[valuesById[3] = "APPENGINE_API_NOT_ACCESSIBLE"] = 3; + values[valuesById[4] = "APPENGINE_DEFAULT_HOST_MISSING"] = 4; + values[valuesById[6] = "CANNOT_USE_GOOGLE_COM_ACCOUNT"] = 6; + values[valuesById[7] = "CANNOT_USE_OWNER_ACCOUNT"] = 7; + values[valuesById[8] = "COMPUTE_API_BACKEND_ERROR"] = 8; + values[valuesById[9] = "COMPUTE_API_NOT_ACCESSIBLE"] = 9; + values[valuesById[10] = "CUSTOM_LOGIN_URL_DOES_NOT_BELONG_TO_CURRENT_PROJECT"] = 10; + values[valuesById[11] = "CUSTOM_LOGIN_URL_MALFORMED"] = 11; + values[valuesById[12] = "CUSTOM_LOGIN_URL_MAPPED_TO_NON_ROUTABLE_ADDRESS"] = 12; + values[valuesById[13] = "CUSTOM_LOGIN_URL_MAPPED_TO_UNRESERVED_ADDRESS"] = 13; + values[valuesById[14] = "CUSTOM_LOGIN_URL_HAS_NON_ROUTABLE_IP_ADDRESS"] = 14; + values[valuesById[15] = "CUSTOM_LOGIN_URL_HAS_UNRESERVED_IP_ADDRESS"] = 15; + values[valuesById[16] = "DUPLICATE_SCAN_NAME"] = 16; + values[valuesById[18] = "INVALID_FIELD_VALUE"] = 18; + values[valuesById[19] = "FAILED_TO_AUTHENTICATE_TO_TARGET"] = 19; + values[valuesById[20] = "FINDING_TYPE_UNSPECIFIED"] = 20; + values[valuesById[21] = "FORBIDDEN_TO_SCAN_COMPUTE"] = 21; + values[valuesById[43] = "FORBIDDEN_UPDATE_TO_MANAGED_SCAN"] = 43; + values[valuesById[22] = "MALFORMED_FILTER"] = 22; + values[valuesById[23] = "MALFORMED_RESOURCE_NAME"] = 23; + values[valuesById[24] = "PROJECT_INACTIVE"] = 24; + values[valuesById[25] = "REQUIRED_FIELD"] = 25; + values[valuesById[26] = "RESOURCE_NAME_INCONSISTENT"] = 26; + values[valuesById[27] = "SCAN_ALREADY_RUNNING"] = 27; + values[valuesById[28] = "SCAN_NOT_RUNNING"] = 28; + values[valuesById[29] = "SEED_URL_DOES_NOT_BELONG_TO_CURRENT_PROJECT"] = 29; + values[valuesById[30] = "SEED_URL_MALFORMED"] = 30; + values[valuesById[31] = "SEED_URL_MAPPED_TO_NON_ROUTABLE_ADDRESS"] = 31; + values[valuesById[32] = "SEED_URL_MAPPED_TO_UNRESERVED_ADDRESS"] = 32; + values[valuesById[33] = "SEED_URL_HAS_NON_ROUTABLE_IP_ADDRESS"] = 33; + values[valuesById[35] = "SEED_URL_HAS_UNRESERVED_IP_ADDRESS"] = 35; + values[valuesById[36] = "SERVICE_ACCOUNT_NOT_CONFIGURED"] = 36; + values[valuesById[37] = "TOO_MANY_SCANS"] = 37; + values[valuesById[38] = "UNABLE_TO_RESOLVE_PROJECT_INFO"] = 38; + values[valuesById[39] = "UNSUPPORTED_BLACKLIST_PATTERN_FORMAT"] = 39; + values[valuesById[40] = "UNSUPPORTED_FILTER"] = 40; + values[valuesById[41] = "UNSUPPORTED_FINDING_TYPE"] = 41; + values[valuesById[42] = "UNSUPPORTED_URL_SCHEME"] = 42; + return values; + })(); + + return ScanConfigError; + })(); + + v1.ScanRun = (function() { + + /** + * Properties of a ScanRun. + * @memberof google.cloud.websecurityscanner.v1 + * @interface IScanRun + * @property {string|null} [name] ScanRun name + * @property {google.cloud.websecurityscanner.v1.ScanRun.ExecutionState|null} [executionState] ScanRun executionState + * @property {google.cloud.websecurityscanner.v1.ScanRun.ResultState|null} [resultState] ScanRun resultState + * @property {google.protobuf.ITimestamp|null} [startTime] ScanRun startTime + * @property {google.protobuf.ITimestamp|null} [endTime] ScanRun endTime + * @property {number|Long|null} [urlsCrawledCount] ScanRun urlsCrawledCount + * @property {number|Long|null} [urlsTestedCount] ScanRun urlsTestedCount + * @property {boolean|null} [hasVulnerabilities] ScanRun hasVulnerabilities + * @property {number|null} [progressPercent] ScanRun progressPercent + * @property {google.cloud.websecurityscanner.v1.IScanRunErrorTrace|null} [errorTrace] ScanRun errorTrace + * @property {Array.|null} [warningTraces] ScanRun warningTraces + */ + + /** + * Constructs a new ScanRun. + * @memberof google.cloud.websecurityscanner.v1 + * @classdesc Represents a ScanRun. + * @implements IScanRun + * @constructor + * @param {google.cloud.websecurityscanner.v1.IScanRun=} [properties] Properties to set + */ + function ScanRun(properties) { + this.warningTraces = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ScanRun name. + * @member {string} name + * @memberof google.cloud.websecurityscanner.v1.ScanRun + * @instance + */ + ScanRun.prototype.name = ""; + + /** + * ScanRun executionState. + * @member {google.cloud.websecurityscanner.v1.ScanRun.ExecutionState} executionState + * @memberof google.cloud.websecurityscanner.v1.ScanRun + * @instance + */ + ScanRun.prototype.executionState = 0; + + /** + * ScanRun resultState. + * @member {google.cloud.websecurityscanner.v1.ScanRun.ResultState} resultState + * @memberof google.cloud.websecurityscanner.v1.ScanRun + * @instance + */ + ScanRun.prototype.resultState = 0; + + /** + * ScanRun startTime. + * @member {google.protobuf.ITimestamp|null|undefined} startTime + * @memberof google.cloud.websecurityscanner.v1.ScanRun + * @instance + */ + ScanRun.prototype.startTime = null; + + /** + * ScanRun endTime. + * @member {google.protobuf.ITimestamp|null|undefined} endTime + * @memberof google.cloud.websecurityscanner.v1.ScanRun + * @instance + */ + ScanRun.prototype.endTime = null; + + /** + * ScanRun urlsCrawledCount. + * @member {number|Long} urlsCrawledCount + * @memberof google.cloud.websecurityscanner.v1.ScanRun + * @instance + */ + ScanRun.prototype.urlsCrawledCount = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * ScanRun urlsTestedCount. + * @member {number|Long} urlsTestedCount + * @memberof google.cloud.websecurityscanner.v1.ScanRun + * @instance + */ + ScanRun.prototype.urlsTestedCount = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * ScanRun hasVulnerabilities. + * @member {boolean} hasVulnerabilities + * @memberof google.cloud.websecurityscanner.v1.ScanRun + * @instance + */ + ScanRun.prototype.hasVulnerabilities = false; + + /** + * ScanRun progressPercent. + * @member {number} progressPercent + * @memberof google.cloud.websecurityscanner.v1.ScanRun + * @instance + */ + ScanRun.prototype.progressPercent = 0; + + /** + * ScanRun errorTrace. + * @member {google.cloud.websecurityscanner.v1.IScanRunErrorTrace|null|undefined} errorTrace + * @memberof google.cloud.websecurityscanner.v1.ScanRun + * @instance + */ + ScanRun.prototype.errorTrace = null; + + /** + * ScanRun warningTraces. + * @member {Array.} warningTraces + * @memberof google.cloud.websecurityscanner.v1.ScanRun + * @instance + */ + ScanRun.prototype.warningTraces = $util.emptyArray; + + /** + * Creates a new ScanRun instance using the specified properties. + * @function create + * @memberof google.cloud.websecurityscanner.v1.ScanRun + * @static + * @param {google.cloud.websecurityscanner.v1.IScanRun=} [properties] Properties to set + * @returns {google.cloud.websecurityscanner.v1.ScanRun} ScanRun instance + */ + ScanRun.create = function create(properties) { + return new ScanRun(properties); + }; + + /** + * Encodes the specified ScanRun message. Does not implicitly {@link google.cloud.websecurityscanner.v1.ScanRun.verify|verify} messages. + * @function encode + * @memberof google.cloud.websecurityscanner.v1.ScanRun + * @static + * @param {google.cloud.websecurityscanner.v1.IScanRun} message ScanRun message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ScanRun.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.executionState != null && Object.hasOwnProperty.call(message, "executionState")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.executionState); + if (message.resultState != null && Object.hasOwnProperty.call(message, "resultState")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.resultState); + if (message.startTime != null && Object.hasOwnProperty.call(message, "startTime")) + $root.google.protobuf.Timestamp.encode(message.startTime, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.endTime != null && Object.hasOwnProperty.call(message, "endTime")) + $root.google.protobuf.Timestamp.encode(message.endTime, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.urlsCrawledCount != null && Object.hasOwnProperty.call(message, "urlsCrawledCount")) + writer.uint32(/* id 6, wireType 0 =*/48).int64(message.urlsCrawledCount); + if (message.urlsTestedCount != null && Object.hasOwnProperty.call(message, "urlsTestedCount")) + writer.uint32(/* id 7, wireType 0 =*/56).int64(message.urlsTestedCount); + if (message.hasVulnerabilities != null && Object.hasOwnProperty.call(message, "hasVulnerabilities")) + writer.uint32(/* id 8, wireType 0 =*/64).bool(message.hasVulnerabilities); + if (message.progressPercent != null && Object.hasOwnProperty.call(message, "progressPercent")) + writer.uint32(/* id 9, wireType 0 =*/72).int32(message.progressPercent); + if (message.errorTrace != null && Object.hasOwnProperty.call(message, "errorTrace")) + $root.google.cloud.websecurityscanner.v1.ScanRunErrorTrace.encode(message.errorTrace, writer.uint32(/* id 10, wireType 2 =*/82).fork()).ldelim(); + if (message.warningTraces != null && message.warningTraces.length) + for (var i = 0; i < message.warningTraces.length; ++i) + $root.google.cloud.websecurityscanner.v1.ScanRunWarningTrace.encode(message.warningTraces[i], writer.uint32(/* id 11, wireType 2 =*/90).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified ScanRun message, length delimited. Does not implicitly {@link google.cloud.websecurityscanner.v1.ScanRun.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.websecurityscanner.v1.ScanRun + * @static + * @param {google.cloud.websecurityscanner.v1.IScanRun} message ScanRun message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ScanRun.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ScanRun message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.websecurityscanner.v1.ScanRun + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.websecurityscanner.v1.ScanRun} ScanRun + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ScanRun.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.websecurityscanner.v1.ScanRun(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.executionState = reader.int32(); + break; + } + case 3: { + message.resultState = reader.int32(); + break; + } + case 4: { + message.startTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 5: { + message.endTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 6: { + message.urlsCrawledCount = reader.int64(); + break; + } + case 7: { + message.urlsTestedCount = reader.int64(); + break; + } + case 8: { + message.hasVulnerabilities = reader.bool(); + break; + } + case 9: { + message.progressPercent = reader.int32(); + break; + } + case 10: { + message.errorTrace = $root.google.cloud.websecurityscanner.v1.ScanRunErrorTrace.decode(reader, reader.uint32()); + break; + } + case 11: { + if (!(message.warningTraces && message.warningTraces.length)) + message.warningTraces = []; + message.warningTraces.push($root.google.cloud.websecurityscanner.v1.ScanRunWarningTrace.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ScanRun message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.websecurityscanner.v1.ScanRun + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.websecurityscanner.v1.ScanRun} ScanRun + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ScanRun.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ScanRun message. + * @function verify + * @memberof google.cloud.websecurityscanner.v1.ScanRun + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ScanRun.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.executionState != null && message.hasOwnProperty("executionState")) + switch (message.executionState) { + default: + return "executionState: enum value expected"; + case 0: + case 1: + case 2: + case 3: + break; + } + if (message.resultState != null && message.hasOwnProperty("resultState")) + switch (message.resultState) { + default: + return "resultState: enum value expected"; + case 0: + case 1: + case 2: + case 3: + break; + } + 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.urlsCrawledCount != null && message.hasOwnProperty("urlsCrawledCount")) + if (!$util.isInteger(message.urlsCrawledCount) && !(message.urlsCrawledCount && $util.isInteger(message.urlsCrawledCount.low) && $util.isInteger(message.urlsCrawledCount.high))) + return "urlsCrawledCount: integer|Long expected"; + if (message.urlsTestedCount != null && message.hasOwnProperty("urlsTestedCount")) + if (!$util.isInteger(message.urlsTestedCount) && !(message.urlsTestedCount && $util.isInteger(message.urlsTestedCount.low) && $util.isInteger(message.urlsTestedCount.high))) + return "urlsTestedCount: integer|Long expected"; + if (message.hasVulnerabilities != null && message.hasOwnProperty("hasVulnerabilities")) + if (typeof message.hasVulnerabilities !== "boolean") + return "hasVulnerabilities: boolean expected"; + if (message.progressPercent != null && message.hasOwnProperty("progressPercent")) + if (!$util.isInteger(message.progressPercent)) + return "progressPercent: integer expected"; + if (message.errorTrace != null && message.hasOwnProperty("errorTrace")) { + var error = $root.google.cloud.websecurityscanner.v1.ScanRunErrorTrace.verify(message.errorTrace); + if (error) + return "errorTrace." + error; + } + if (message.warningTraces != null && message.hasOwnProperty("warningTraces")) { + if (!Array.isArray(message.warningTraces)) + return "warningTraces: array expected"; + for (var i = 0; i < message.warningTraces.length; ++i) { + var error = $root.google.cloud.websecurityscanner.v1.ScanRunWarningTrace.verify(message.warningTraces[i]); + if (error) + return "warningTraces." + error; + } + } + return null; + }; + + /** + * Creates a ScanRun message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.websecurityscanner.v1.ScanRun + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.websecurityscanner.v1.ScanRun} ScanRun + */ + ScanRun.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.websecurityscanner.v1.ScanRun) + return object; + var message = new $root.google.cloud.websecurityscanner.v1.ScanRun(); + if (object.name != null) + message.name = String(object.name); + switch (object.executionState) { + default: + if (typeof object.executionState === "number") { + message.executionState = object.executionState; + break; + } + break; + case "EXECUTION_STATE_UNSPECIFIED": + case 0: + message.executionState = 0; + break; + case "QUEUED": + case 1: + message.executionState = 1; + break; + case "SCANNING": + case 2: + message.executionState = 2; + break; + case "FINISHED": + case 3: + message.executionState = 3; + break; + } + switch (object.resultState) { + default: + if (typeof object.resultState === "number") { + message.resultState = object.resultState; + break; + } + break; + case "RESULT_STATE_UNSPECIFIED": + case 0: + message.resultState = 0; + break; + case "SUCCESS": + case 1: + message.resultState = 1; + break; + case "ERROR": + case 2: + message.resultState = 2; + break; + case "KILLED": + case 3: + message.resultState = 3; + break; + } + if (object.startTime != null) { + if (typeof object.startTime !== "object") + throw TypeError(".google.cloud.websecurityscanner.v1.ScanRun.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.websecurityscanner.v1.ScanRun.endTime: object expected"); + message.endTime = $root.google.protobuf.Timestamp.fromObject(object.endTime); + } + if (object.urlsCrawledCount != null) + if ($util.Long) + (message.urlsCrawledCount = $util.Long.fromValue(object.urlsCrawledCount)).unsigned = false; + else if (typeof object.urlsCrawledCount === "string") + message.urlsCrawledCount = parseInt(object.urlsCrawledCount, 10); + else if (typeof object.urlsCrawledCount === "number") + message.urlsCrawledCount = object.urlsCrawledCount; + else if (typeof object.urlsCrawledCount === "object") + message.urlsCrawledCount = new $util.LongBits(object.urlsCrawledCount.low >>> 0, object.urlsCrawledCount.high >>> 0).toNumber(); + if (object.urlsTestedCount != null) + if ($util.Long) + (message.urlsTestedCount = $util.Long.fromValue(object.urlsTestedCount)).unsigned = false; + else if (typeof object.urlsTestedCount === "string") + message.urlsTestedCount = parseInt(object.urlsTestedCount, 10); + else if (typeof object.urlsTestedCount === "number") + message.urlsTestedCount = object.urlsTestedCount; + else if (typeof object.urlsTestedCount === "object") + message.urlsTestedCount = new $util.LongBits(object.urlsTestedCount.low >>> 0, object.urlsTestedCount.high >>> 0).toNumber(); + if (object.hasVulnerabilities != null) + message.hasVulnerabilities = Boolean(object.hasVulnerabilities); + if (object.progressPercent != null) + message.progressPercent = object.progressPercent | 0; + if (object.errorTrace != null) { + if (typeof object.errorTrace !== "object") + throw TypeError(".google.cloud.websecurityscanner.v1.ScanRun.errorTrace: object expected"); + message.errorTrace = $root.google.cloud.websecurityscanner.v1.ScanRunErrorTrace.fromObject(object.errorTrace); + } + if (object.warningTraces) { + if (!Array.isArray(object.warningTraces)) + throw TypeError(".google.cloud.websecurityscanner.v1.ScanRun.warningTraces: array expected"); + message.warningTraces = []; + for (var i = 0; i < object.warningTraces.length; ++i) { + if (typeof object.warningTraces[i] !== "object") + throw TypeError(".google.cloud.websecurityscanner.v1.ScanRun.warningTraces: object expected"); + message.warningTraces[i] = $root.google.cloud.websecurityscanner.v1.ScanRunWarningTrace.fromObject(object.warningTraces[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a ScanRun message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.websecurityscanner.v1.ScanRun + * @static + * @param {google.cloud.websecurityscanner.v1.ScanRun} message ScanRun + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ScanRun.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.warningTraces = []; + if (options.defaults) { + object.name = ""; + object.executionState = options.enums === String ? "EXECUTION_STATE_UNSPECIFIED" : 0; + object.resultState = options.enums === String ? "RESULT_STATE_UNSPECIFIED" : 0; + object.startTime = null; + object.endTime = null; + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.urlsCrawledCount = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.urlsCrawledCount = options.longs === String ? "0" : 0; + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.urlsTestedCount = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.urlsTestedCount = options.longs === String ? "0" : 0; + object.hasVulnerabilities = false; + object.progressPercent = 0; + object.errorTrace = null; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.executionState != null && message.hasOwnProperty("executionState")) + object.executionState = options.enums === String ? $root.google.cloud.websecurityscanner.v1.ScanRun.ExecutionState[message.executionState] === undefined ? message.executionState : $root.google.cloud.websecurityscanner.v1.ScanRun.ExecutionState[message.executionState] : message.executionState; + if (message.resultState != null && message.hasOwnProperty("resultState")) + object.resultState = options.enums === String ? $root.google.cloud.websecurityscanner.v1.ScanRun.ResultState[message.resultState] === undefined ? message.resultState : $root.google.cloud.websecurityscanner.v1.ScanRun.ResultState[message.resultState] : message.resultState; + 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.urlsCrawledCount != null && message.hasOwnProperty("urlsCrawledCount")) + if (typeof message.urlsCrawledCount === "number") + object.urlsCrawledCount = options.longs === String ? String(message.urlsCrawledCount) : message.urlsCrawledCount; + else + object.urlsCrawledCount = options.longs === String ? $util.Long.prototype.toString.call(message.urlsCrawledCount) : options.longs === Number ? new $util.LongBits(message.urlsCrawledCount.low >>> 0, message.urlsCrawledCount.high >>> 0).toNumber() : message.urlsCrawledCount; + if (message.urlsTestedCount != null && message.hasOwnProperty("urlsTestedCount")) + if (typeof message.urlsTestedCount === "number") + object.urlsTestedCount = options.longs === String ? String(message.urlsTestedCount) : message.urlsTestedCount; + else + object.urlsTestedCount = options.longs === String ? $util.Long.prototype.toString.call(message.urlsTestedCount) : options.longs === Number ? new $util.LongBits(message.urlsTestedCount.low >>> 0, message.urlsTestedCount.high >>> 0).toNumber() : message.urlsTestedCount; + if (message.hasVulnerabilities != null && message.hasOwnProperty("hasVulnerabilities")) + object.hasVulnerabilities = message.hasVulnerabilities; + if (message.progressPercent != null && message.hasOwnProperty("progressPercent")) + object.progressPercent = message.progressPercent; + if (message.errorTrace != null && message.hasOwnProperty("errorTrace")) + object.errorTrace = $root.google.cloud.websecurityscanner.v1.ScanRunErrorTrace.toObject(message.errorTrace, options); + if (message.warningTraces && message.warningTraces.length) { + object.warningTraces = []; + for (var j = 0; j < message.warningTraces.length; ++j) + object.warningTraces[j] = $root.google.cloud.websecurityscanner.v1.ScanRunWarningTrace.toObject(message.warningTraces[j], options); + } + return object; + }; + + /** + * Converts this ScanRun to JSON. + * @function toJSON + * @memberof google.cloud.websecurityscanner.v1.ScanRun + * @instance + * @returns {Object.} JSON object + */ + ScanRun.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ScanRun + * @function getTypeUrl + * @memberof google.cloud.websecurityscanner.v1.ScanRun + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ScanRun.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.websecurityscanner.v1.ScanRun"; + }; + + /** + * ExecutionState enum. + * @name google.cloud.websecurityscanner.v1.ScanRun.ExecutionState + * @enum {number} + * @property {number} EXECUTION_STATE_UNSPECIFIED=0 EXECUTION_STATE_UNSPECIFIED value + * @property {number} QUEUED=1 QUEUED value + * @property {number} SCANNING=2 SCANNING value + * @property {number} FINISHED=3 FINISHED value + */ + ScanRun.ExecutionState = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "EXECUTION_STATE_UNSPECIFIED"] = 0; + values[valuesById[1] = "QUEUED"] = 1; + values[valuesById[2] = "SCANNING"] = 2; + values[valuesById[3] = "FINISHED"] = 3; + return values; + })(); + + /** + * ResultState enum. + * @name google.cloud.websecurityscanner.v1.ScanRun.ResultState + * @enum {number} + * @property {number} RESULT_STATE_UNSPECIFIED=0 RESULT_STATE_UNSPECIFIED value + * @property {number} SUCCESS=1 SUCCESS value + * @property {number} ERROR=2 ERROR value + * @property {number} KILLED=3 KILLED value + */ + ScanRun.ResultState = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "RESULT_STATE_UNSPECIFIED"] = 0; + values[valuesById[1] = "SUCCESS"] = 1; + values[valuesById[2] = "ERROR"] = 2; + values[valuesById[3] = "KILLED"] = 3; + return values; + })(); + + return ScanRun; + })(); + + v1.ScanRunErrorTrace = (function() { + + /** + * Properties of a ScanRunErrorTrace. + * @memberof google.cloud.websecurityscanner.v1 + * @interface IScanRunErrorTrace + * @property {google.cloud.websecurityscanner.v1.ScanRunErrorTrace.Code|null} [code] ScanRunErrorTrace code + * @property {google.cloud.websecurityscanner.v1.IScanConfigError|null} [scanConfigError] ScanRunErrorTrace scanConfigError + * @property {number|null} [mostCommonHttpErrorCode] ScanRunErrorTrace mostCommonHttpErrorCode + */ + + /** + * Constructs a new ScanRunErrorTrace. + * @memberof google.cloud.websecurityscanner.v1 + * @classdesc Represents a ScanRunErrorTrace. + * @implements IScanRunErrorTrace + * @constructor + * @param {google.cloud.websecurityscanner.v1.IScanRunErrorTrace=} [properties] Properties to set + */ + function ScanRunErrorTrace(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ScanRunErrorTrace code. + * @member {google.cloud.websecurityscanner.v1.ScanRunErrorTrace.Code} code + * @memberof google.cloud.websecurityscanner.v1.ScanRunErrorTrace + * @instance + */ + ScanRunErrorTrace.prototype.code = 0; + + /** + * ScanRunErrorTrace scanConfigError. + * @member {google.cloud.websecurityscanner.v1.IScanConfigError|null|undefined} scanConfigError + * @memberof google.cloud.websecurityscanner.v1.ScanRunErrorTrace + * @instance + */ + ScanRunErrorTrace.prototype.scanConfigError = null; + + /** + * ScanRunErrorTrace mostCommonHttpErrorCode. + * @member {number} mostCommonHttpErrorCode + * @memberof google.cloud.websecurityscanner.v1.ScanRunErrorTrace + * @instance + */ + ScanRunErrorTrace.prototype.mostCommonHttpErrorCode = 0; + + /** + * Creates a new ScanRunErrorTrace instance using the specified properties. + * @function create + * @memberof google.cloud.websecurityscanner.v1.ScanRunErrorTrace + * @static + * @param {google.cloud.websecurityscanner.v1.IScanRunErrorTrace=} [properties] Properties to set + * @returns {google.cloud.websecurityscanner.v1.ScanRunErrorTrace} ScanRunErrorTrace instance + */ + ScanRunErrorTrace.create = function create(properties) { + return new ScanRunErrorTrace(properties); + }; + + /** + * Encodes the specified ScanRunErrorTrace message. Does not implicitly {@link google.cloud.websecurityscanner.v1.ScanRunErrorTrace.verify|verify} messages. + * @function encode + * @memberof google.cloud.websecurityscanner.v1.ScanRunErrorTrace + * @static + * @param {google.cloud.websecurityscanner.v1.IScanRunErrorTrace} message ScanRunErrorTrace message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ScanRunErrorTrace.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.scanConfigError != null && Object.hasOwnProperty.call(message, "scanConfigError")) + $root.google.cloud.websecurityscanner.v1.ScanConfigError.encode(message.scanConfigError, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.mostCommonHttpErrorCode != null && Object.hasOwnProperty.call(message, "mostCommonHttpErrorCode")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.mostCommonHttpErrorCode); + return writer; + }; + + /** + * Encodes the specified ScanRunErrorTrace message, length delimited. Does not implicitly {@link google.cloud.websecurityscanner.v1.ScanRunErrorTrace.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.websecurityscanner.v1.ScanRunErrorTrace + * @static + * @param {google.cloud.websecurityscanner.v1.IScanRunErrorTrace} message ScanRunErrorTrace message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ScanRunErrorTrace.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ScanRunErrorTrace message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.websecurityscanner.v1.ScanRunErrorTrace + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.websecurityscanner.v1.ScanRunErrorTrace} ScanRunErrorTrace + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ScanRunErrorTrace.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.websecurityscanner.v1.ScanRunErrorTrace(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.code = reader.int32(); + break; + } + case 2: { + message.scanConfigError = $root.google.cloud.websecurityscanner.v1.ScanConfigError.decode(reader, reader.uint32()); + break; + } + case 3: { + message.mostCommonHttpErrorCode = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ScanRunErrorTrace message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.websecurityscanner.v1.ScanRunErrorTrace + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.websecurityscanner.v1.ScanRunErrorTrace} ScanRunErrorTrace + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ScanRunErrorTrace.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ScanRunErrorTrace message. + * @function verify + * @memberof google.cloud.websecurityscanner.v1.ScanRunErrorTrace + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ScanRunErrorTrace.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.code != null && message.hasOwnProperty("code")) + switch (message.code) { + default: + return "code: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + case 5: + case 6: + break; + } + if (message.scanConfigError != null && message.hasOwnProperty("scanConfigError")) { + var error = $root.google.cloud.websecurityscanner.v1.ScanConfigError.verify(message.scanConfigError); + if (error) + return "scanConfigError." + error; + } + if (message.mostCommonHttpErrorCode != null && message.hasOwnProperty("mostCommonHttpErrorCode")) + if (!$util.isInteger(message.mostCommonHttpErrorCode)) + return "mostCommonHttpErrorCode: integer expected"; + return null; + }; + + /** + * Creates a ScanRunErrorTrace message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.websecurityscanner.v1.ScanRunErrorTrace + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.websecurityscanner.v1.ScanRunErrorTrace} ScanRunErrorTrace + */ + ScanRunErrorTrace.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.websecurityscanner.v1.ScanRunErrorTrace) + return object; + var message = new $root.google.cloud.websecurityscanner.v1.ScanRunErrorTrace(); + switch (object.code) { + default: + if (typeof object.code === "number") { + message.code = object.code; + break; + } + break; + case "CODE_UNSPECIFIED": + case 0: + message.code = 0; + break; + case "INTERNAL_ERROR": + case 1: + message.code = 1; + break; + case "SCAN_CONFIG_ISSUE": + case 2: + message.code = 2; + break; + case "AUTHENTICATION_CONFIG_ISSUE": + case 3: + message.code = 3; + break; + case "TIMED_OUT_WHILE_SCANNING": + case 4: + message.code = 4; + break; + case "TOO_MANY_REDIRECTS": + case 5: + message.code = 5; + break; + case "TOO_MANY_HTTP_ERRORS": + case 6: + message.code = 6; + break; + } + if (object.scanConfigError != null) { + if (typeof object.scanConfigError !== "object") + throw TypeError(".google.cloud.websecurityscanner.v1.ScanRunErrorTrace.scanConfigError: object expected"); + message.scanConfigError = $root.google.cloud.websecurityscanner.v1.ScanConfigError.fromObject(object.scanConfigError); + } + if (object.mostCommonHttpErrorCode != null) + message.mostCommonHttpErrorCode = object.mostCommonHttpErrorCode | 0; + return message; + }; + + /** + * Creates a plain object from a ScanRunErrorTrace message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.websecurityscanner.v1.ScanRunErrorTrace + * @static + * @param {google.cloud.websecurityscanner.v1.ScanRunErrorTrace} message ScanRunErrorTrace + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ScanRunErrorTrace.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.code = options.enums === String ? "CODE_UNSPECIFIED" : 0; + object.scanConfigError = null; + object.mostCommonHttpErrorCode = 0; + } + if (message.code != null && message.hasOwnProperty("code")) + object.code = options.enums === String ? $root.google.cloud.websecurityscanner.v1.ScanRunErrorTrace.Code[message.code] === undefined ? message.code : $root.google.cloud.websecurityscanner.v1.ScanRunErrorTrace.Code[message.code] : message.code; + if (message.scanConfigError != null && message.hasOwnProperty("scanConfigError")) + object.scanConfigError = $root.google.cloud.websecurityscanner.v1.ScanConfigError.toObject(message.scanConfigError, options); + if (message.mostCommonHttpErrorCode != null && message.hasOwnProperty("mostCommonHttpErrorCode")) + object.mostCommonHttpErrorCode = message.mostCommonHttpErrorCode; + return object; + }; + + /** + * Converts this ScanRunErrorTrace to JSON. + * @function toJSON + * @memberof google.cloud.websecurityscanner.v1.ScanRunErrorTrace + * @instance + * @returns {Object.} JSON object + */ + ScanRunErrorTrace.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ScanRunErrorTrace + * @function getTypeUrl + * @memberof google.cloud.websecurityscanner.v1.ScanRunErrorTrace + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ScanRunErrorTrace.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.websecurityscanner.v1.ScanRunErrorTrace"; + }; + + /** + * Code enum. + * @name google.cloud.websecurityscanner.v1.ScanRunErrorTrace.Code + * @enum {number} + * @property {number} CODE_UNSPECIFIED=0 CODE_UNSPECIFIED value + * @property {number} INTERNAL_ERROR=1 INTERNAL_ERROR value + * @property {number} SCAN_CONFIG_ISSUE=2 SCAN_CONFIG_ISSUE value + * @property {number} AUTHENTICATION_CONFIG_ISSUE=3 AUTHENTICATION_CONFIG_ISSUE value + * @property {number} TIMED_OUT_WHILE_SCANNING=4 TIMED_OUT_WHILE_SCANNING value + * @property {number} TOO_MANY_REDIRECTS=5 TOO_MANY_REDIRECTS value + * @property {number} TOO_MANY_HTTP_ERRORS=6 TOO_MANY_HTTP_ERRORS value + */ + ScanRunErrorTrace.Code = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "CODE_UNSPECIFIED"] = 0; + values[valuesById[1] = "INTERNAL_ERROR"] = 1; + values[valuesById[2] = "SCAN_CONFIG_ISSUE"] = 2; + values[valuesById[3] = "AUTHENTICATION_CONFIG_ISSUE"] = 3; + values[valuesById[4] = "TIMED_OUT_WHILE_SCANNING"] = 4; + values[valuesById[5] = "TOO_MANY_REDIRECTS"] = 5; + values[valuesById[6] = "TOO_MANY_HTTP_ERRORS"] = 6; + return values; + })(); + + return ScanRunErrorTrace; + })(); + + v1.ScanRunWarningTrace = (function() { + + /** + * Properties of a ScanRunWarningTrace. + * @memberof google.cloud.websecurityscanner.v1 + * @interface IScanRunWarningTrace + * @property {google.cloud.websecurityscanner.v1.ScanRunWarningTrace.Code|null} [code] ScanRunWarningTrace code + */ + + /** + * Constructs a new ScanRunWarningTrace. + * @memberof google.cloud.websecurityscanner.v1 + * @classdesc Represents a ScanRunWarningTrace. + * @implements IScanRunWarningTrace + * @constructor + * @param {google.cloud.websecurityscanner.v1.IScanRunWarningTrace=} [properties] Properties to set + */ + function ScanRunWarningTrace(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ScanRunWarningTrace code. + * @member {google.cloud.websecurityscanner.v1.ScanRunWarningTrace.Code} code + * @memberof google.cloud.websecurityscanner.v1.ScanRunWarningTrace + * @instance + */ + ScanRunWarningTrace.prototype.code = 0; + + /** + * Creates a new ScanRunWarningTrace instance using the specified properties. + * @function create + * @memberof google.cloud.websecurityscanner.v1.ScanRunWarningTrace + * @static + * @param {google.cloud.websecurityscanner.v1.IScanRunWarningTrace=} [properties] Properties to set + * @returns {google.cloud.websecurityscanner.v1.ScanRunWarningTrace} ScanRunWarningTrace instance + */ + ScanRunWarningTrace.create = function create(properties) { + return new ScanRunWarningTrace(properties); + }; + + /** + * Encodes the specified ScanRunWarningTrace message. Does not implicitly {@link google.cloud.websecurityscanner.v1.ScanRunWarningTrace.verify|verify} messages. + * @function encode + * @memberof google.cloud.websecurityscanner.v1.ScanRunWarningTrace + * @static + * @param {google.cloud.websecurityscanner.v1.IScanRunWarningTrace} message ScanRunWarningTrace message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ScanRunWarningTrace.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); + return writer; + }; + + /** + * Encodes the specified ScanRunWarningTrace message, length delimited. Does not implicitly {@link google.cloud.websecurityscanner.v1.ScanRunWarningTrace.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.websecurityscanner.v1.ScanRunWarningTrace + * @static + * @param {google.cloud.websecurityscanner.v1.IScanRunWarningTrace} message ScanRunWarningTrace message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ScanRunWarningTrace.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ScanRunWarningTrace message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.websecurityscanner.v1.ScanRunWarningTrace + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.websecurityscanner.v1.ScanRunWarningTrace} ScanRunWarningTrace + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ScanRunWarningTrace.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.websecurityscanner.v1.ScanRunWarningTrace(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.code = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ScanRunWarningTrace message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.websecurityscanner.v1.ScanRunWarningTrace + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.websecurityscanner.v1.ScanRunWarningTrace} ScanRunWarningTrace + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ScanRunWarningTrace.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ScanRunWarningTrace message. + * @function verify + * @memberof google.cloud.websecurityscanner.v1.ScanRunWarningTrace + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ScanRunWarningTrace.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.code != null && message.hasOwnProperty("code")) + switch (message.code) { + default: + return "code: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + case 5: + break; + } + return null; + }; + + /** + * Creates a ScanRunWarningTrace message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.websecurityscanner.v1.ScanRunWarningTrace + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.websecurityscanner.v1.ScanRunWarningTrace} ScanRunWarningTrace + */ + ScanRunWarningTrace.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.websecurityscanner.v1.ScanRunWarningTrace) + return object; + var message = new $root.google.cloud.websecurityscanner.v1.ScanRunWarningTrace(); + switch (object.code) { + default: + if (typeof object.code === "number") { + message.code = object.code; + break; + } + break; + case "CODE_UNSPECIFIED": + case 0: + message.code = 0; + break; + case "INSUFFICIENT_CRAWL_RESULTS": + case 1: + message.code = 1; + break; + case "TOO_MANY_CRAWL_RESULTS": + case 2: + message.code = 2; + break; + case "TOO_MANY_FUZZ_TASKS": + case 3: + message.code = 3; + break; + case "BLOCKED_BY_IAP": + case 4: + message.code = 4; + break; + case "NO_STARTING_URL_FOUND_FOR_MANAGED_SCAN": + case 5: + message.code = 5; + break; + } + return message; + }; + + /** + * Creates a plain object from a ScanRunWarningTrace message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.websecurityscanner.v1.ScanRunWarningTrace + * @static + * @param {google.cloud.websecurityscanner.v1.ScanRunWarningTrace} message ScanRunWarningTrace + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ScanRunWarningTrace.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.code = options.enums === String ? "CODE_UNSPECIFIED" : 0; + if (message.code != null && message.hasOwnProperty("code")) + object.code = options.enums === String ? $root.google.cloud.websecurityscanner.v1.ScanRunWarningTrace.Code[message.code] === undefined ? message.code : $root.google.cloud.websecurityscanner.v1.ScanRunWarningTrace.Code[message.code] : message.code; + return object; + }; + + /** + * Converts this ScanRunWarningTrace to JSON. + * @function toJSON + * @memberof google.cloud.websecurityscanner.v1.ScanRunWarningTrace + * @instance + * @returns {Object.} JSON object + */ + ScanRunWarningTrace.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ScanRunWarningTrace + * @function getTypeUrl + * @memberof google.cloud.websecurityscanner.v1.ScanRunWarningTrace + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ScanRunWarningTrace.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.websecurityscanner.v1.ScanRunWarningTrace"; + }; + + /** + * Code enum. + * @name google.cloud.websecurityscanner.v1.ScanRunWarningTrace.Code + * @enum {number} + * @property {number} CODE_UNSPECIFIED=0 CODE_UNSPECIFIED value + * @property {number} INSUFFICIENT_CRAWL_RESULTS=1 INSUFFICIENT_CRAWL_RESULTS value + * @property {number} TOO_MANY_CRAWL_RESULTS=2 TOO_MANY_CRAWL_RESULTS value + * @property {number} TOO_MANY_FUZZ_TASKS=3 TOO_MANY_FUZZ_TASKS value + * @property {number} BLOCKED_BY_IAP=4 BLOCKED_BY_IAP value + * @property {number} NO_STARTING_URL_FOUND_FOR_MANAGED_SCAN=5 NO_STARTING_URL_FOUND_FOR_MANAGED_SCAN value + */ + ScanRunWarningTrace.Code = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "CODE_UNSPECIFIED"] = 0; + values[valuesById[1] = "INSUFFICIENT_CRAWL_RESULTS"] = 1; + values[valuesById[2] = "TOO_MANY_CRAWL_RESULTS"] = 2; + values[valuesById[3] = "TOO_MANY_FUZZ_TASKS"] = 3; + values[valuesById[4] = "BLOCKED_BY_IAP"] = 4; + values[valuesById[5] = "NO_STARTING_URL_FOUND_FOR_MANAGED_SCAN"] = 5; + return values; + })(); + + return ScanRunWarningTrace; + })(); + + v1.ScanRunLog = (function() { + + /** + * Properties of a ScanRunLog. + * @memberof google.cloud.websecurityscanner.v1 + * @interface IScanRunLog + * @property {string|null} [summary] ScanRunLog summary + * @property {string|null} [name] ScanRunLog name + * @property {google.cloud.websecurityscanner.v1.ScanRun.ExecutionState|null} [executionState] ScanRunLog executionState + * @property {google.cloud.websecurityscanner.v1.ScanRun.ResultState|null} [resultState] ScanRunLog resultState + * @property {number|Long|null} [urlsCrawledCount] ScanRunLog urlsCrawledCount + * @property {number|Long|null} [urlsTestedCount] ScanRunLog urlsTestedCount + * @property {boolean|null} [hasFindings] ScanRunLog hasFindings + * @property {google.cloud.websecurityscanner.v1.IScanRunErrorTrace|null} [errorTrace] ScanRunLog errorTrace + */ + + /** + * Constructs a new ScanRunLog. + * @memberof google.cloud.websecurityscanner.v1 + * @classdesc Represents a ScanRunLog. + * @implements IScanRunLog + * @constructor + * @param {google.cloud.websecurityscanner.v1.IScanRunLog=} [properties] Properties to set + */ + function ScanRunLog(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ScanRunLog summary. + * @member {string} summary + * @memberof google.cloud.websecurityscanner.v1.ScanRunLog + * @instance + */ + ScanRunLog.prototype.summary = ""; + + /** + * ScanRunLog name. + * @member {string} name + * @memberof google.cloud.websecurityscanner.v1.ScanRunLog + * @instance + */ + ScanRunLog.prototype.name = ""; + + /** + * ScanRunLog executionState. + * @member {google.cloud.websecurityscanner.v1.ScanRun.ExecutionState} executionState + * @memberof google.cloud.websecurityscanner.v1.ScanRunLog + * @instance + */ + ScanRunLog.prototype.executionState = 0; + + /** + * ScanRunLog resultState. + * @member {google.cloud.websecurityscanner.v1.ScanRun.ResultState} resultState + * @memberof google.cloud.websecurityscanner.v1.ScanRunLog + * @instance + */ + ScanRunLog.prototype.resultState = 0; + + /** + * ScanRunLog urlsCrawledCount. + * @member {number|Long} urlsCrawledCount + * @memberof google.cloud.websecurityscanner.v1.ScanRunLog + * @instance + */ + ScanRunLog.prototype.urlsCrawledCount = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * ScanRunLog urlsTestedCount. + * @member {number|Long} urlsTestedCount + * @memberof google.cloud.websecurityscanner.v1.ScanRunLog + * @instance + */ + ScanRunLog.prototype.urlsTestedCount = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * ScanRunLog hasFindings. + * @member {boolean} hasFindings + * @memberof google.cloud.websecurityscanner.v1.ScanRunLog + * @instance + */ + ScanRunLog.prototype.hasFindings = false; + + /** + * ScanRunLog errorTrace. + * @member {google.cloud.websecurityscanner.v1.IScanRunErrorTrace|null|undefined} errorTrace + * @memberof google.cloud.websecurityscanner.v1.ScanRunLog + * @instance + */ + ScanRunLog.prototype.errorTrace = null; + + /** + * Creates a new ScanRunLog instance using the specified properties. + * @function create + * @memberof google.cloud.websecurityscanner.v1.ScanRunLog + * @static + * @param {google.cloud.websecurityscanner.v1.IScanRunLog=} [properties] Properties to set + * @returns {google.cloud.websecurityscanner.v1.ScanRunLog} ScanRunLog instance + */ + ScanRunLog.create = function create(properties) { + return new ScanRunLog(properties); + }; + + /** + * Encodes the specified ScanRunLog message. Does not implicitly {@link google.cloud.websecurityscanner.v1.ScanRunLog.verify|verify} messages. + * @function encode + * @memberof google.cloud.websecurityscanner.v1.ScanRunLog + * @static + * @param {google.cloud.websecurityscanner.v1.IScanRunLog} message ScanRunLog message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ScanRunLog.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.summary != null && Object.hasOwnProperty.call(message, "summary")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.summary); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.name); + if (message.executionState != null && Object.hasOwnProperty.call(message, "executionState")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.executionState); + if (message.resultState != null && Object.hasOwnProperty.call(message, "resultState")) + writer.uint32(/* id 4, wireType 0 =*/32).int32(message.resultState); + if (message.urlsCrawledCount != null && Object.hasOwnProperty.call(message, "urlsCrawledCount")) + writer.uint32(/* id 5, wireType 0 =*/40).int64(message.urlsCrawledCount); + if (message.urlsTestedCount != null && Object.hasOwnProperty.call(message, "urlsTestedCount")) + writer.uint32(/* id 6, wireType 0 =*/48).int64(message.urlsTestedCount); + if (message.hasFindings != null && Object.hasOwnProperty.call(message, "hasFindings")) + writer.uint32(/* id 7, wireType 0 =*/56).bool(message.hasFindings); + if (message.errorTrace != null && Object.hasOwnProperty.call(message, "errorTrace")) + $root.google.cloud.websecurityscanner.v1.ScanRunErrorTrace.encode(message.errorTrace, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified ScanRunLog message, length delimited. Does not implicitly {@link google.cloud.websecurityscanner.v1.ScanRunLog.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.websecurityscanner.v1.ScanRunLog + * @static + * @param {google.cloud.websecurityscanner.v1.IScanRunLog} message ScanRunLog message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ScanRunLog.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ScanRunLog message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.websecurityscanner.v1.ScanRunLog + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.websecurityscanner.v1.ScanRunLog} ScanRunLog + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ScanRunLog.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.websecurityscanner.v1.ScanRunLog(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.summary = reader.string(); + break; + } + case 2: { + message.name = reader.string(); + break; + } + case 3: { + message.executionState = reader.int32(); + break; + } + case 4: { + message.resultState = reader.int32(); + break; + } + case 5: { + message.urlsCrawledCount = reader.int64(); + break; + } + case 6: { + message.urlsTestedCount = reader.int64(); + break; + } + case 7: { + message.hasFindings = reader.bool(); + break; + } + case 8: { + message.errorTrace = $root.google.cloud.websecurityscanner.v1.ScanRunErrorTrace.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ScanRunLog message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.websecurityscanner.v1.ScanRunLog + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.websecurityscanner.v1.ScanRunLog} ScanRunLog + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ScanRunLog.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ScanRunLog message. + * @function verify + * @memberof google.cloud.websecurityscanner.v1.ScanRunLog + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ScanRunLog.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.summary != null && message.hasOwnProperty("summary")) + if (!$util.isString(message.summary)) + return "summary: string expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.executionState != null && message.hasOwnProperty("executionState")) + switch (message.executionState) { + default: + return "executionState: enum value expected"; + case 0: + case 1: + case 2: + case 3: + break; + } + if (message.resultState != null && message.hasOwnProperty("resultState")) + switch (message.resultState) { + default: + return "resultState: enum value expected"; + case 0: + case 1: + case 2: + case 3: + break; + } + if (message.urlsCrawledCount != null && message.hasOwnProperty("urlsCrawledCount")) + if (!$util.isInteger(message.urlsCrawledCount) && !(message.urlsCrawledCount && $util.isInteger(message.urlsCrawledCount.low) && $util.isInteger(message.urlsCrawledCount.high))) + return "urlsCrawledCount: integer|Long expected"; + if (message.urlsTestedCount != null && message.hasOwnProperty("urlsTestedCount")) + if (!$util.isInteger(message.urlsTestedCount) && !(message.urlsTestedCount && $util.isInteger(message.urlsTestedCount.low) && $util.isInteger(message.urlsTestedCount.high))) + return "urlsTestedCount: integer|Long expected"; + if (message.hasFindings != null && message.hasOwnProperty("hasFindings")) + if (typeof message.hasFindings !== "boolean") + return "hasFindings: boolean expected"; + if (message.errorTrace != null && message.hasOwnProperty("errorTrace")) { + var error = $root.google.cloud.websecurityscanner.v1.ScanRunErrorTrace.verify(message.errorTrace); + if (error) + return "errorTrace." + error; + } + return null; + }; + + /** + * Creates a ScanRunLog message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.websecurityscanner.v1.ScanRunLog + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.websecurityscanner.v1.ScanRunLog} ScanRunLog + */ + ScanRunLog.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.websecurityscanner.v1.ScanRunLog) + return object; + var message = new $root.google.cloud.websecurityscanner.v1.ScanRunLog(); + if (object.summary != null) + message.summary = String(object.summary); + if (object.name != null) + message.name = String(object.name); + switch (object.executionState) { + default: + if (typeof object.executionState === "number") { + message.executionState = object.executionState; + break; + } + break; + case "EXECUTION_STATE_UNSPECIFIED": + case 0: + message.executionState = 0; + break; + case "QUEUED": + case 1: + message.executionState = 1; + break; + case "SCANNING": + case 2: + message.executionState = 2; + break; + case "FINISHED": + case 3: + message.executionState = 3; + break; + } + switch (object.resultState) { + default: + if (typeof object.resultState === "number") { + message.resultState = object.resultState; + break; + } + break; + case "RESULT_STATE_UNSPECIFIED": + case 0: + message.resultState = 0; + break; + case "SUCCESS": + case 1: + message.resultState = 1; + break; + case "ERROR": + case 2: + message.resultState = 2; + break; + case "KILLED": + case 3: + message.resultState = 3; + break; + } + if (object.urlsCrawledCount != null) + if ($util.Long) + (message.urlsCrawledCount = $util.Long.fromValue(object.urlsCrawledCount)).unsigned = false; + else if (typeof object.urlsCrawledCount === "string") + message.urlsCrawledCount = parseInt(object.urlsCrawledCount, 10); + else if (typeof object.urlsCrawledCount === "number") + message.urlsCrawledCount = object.urlsCrawledCount; + else if (typeof object.urlsCrawledCount === "object") + message.urlsCrawledCount = new $util.LongBits(object.urlsCrawledCount.low >>> 0, object.urlsCrawledCount.high >>> 0).toNumber(); + if (object.urlsTestedCount != null) + if ($util.Long) + (message.urlsTestedCount = $util.Long.fromValue(object.urlsTestedCount)).unsigned = false; + else if (typeof object.urlsTestedCount === "string") + message.urlsTestedCount = parseInt(object.urlsTestedCount, 10); + else if (typeof object.urlsTestedCount === "number") + message.urlsTestedCount = object.urlsTestedCount; + else if (typeof object.urlsTestedCount === "object") + message.urlsTestedCount = new $util.LongBits(object.urlsTestedCount.low >>> 0, object.urlsTestedCount.high >>> 0).toNumber(); + if (object.hasFindings != null) + message.hasFindings = Boolean(object.hasFindings); + if (object.errorTrace != null) { + if (typeof object.errorTrace !== "object") + throw TypeError(".google.cloud.websecurityscanner.v1.ScanRunLog.errorTrace: object expected"); + message.errorTrace = $root.google.cloud.websecurityscanner.v1.ScanRunErrorTrace.fromObject(object.errorTrace); + } + return message; + }; + + /** + * Creates a plain object from a ScanRunLog message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.websecurityscanner.v1.ScanRunLog + * @static + * @param {google.cloud.websecurityscanner.v1.ScanRunLog} message ScanRunLog + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ScanRunLog.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.summary = ""; + object.name = ""; + object.executionState = options.enums === String ? "EXECUTION_STATE_UNSPECIFIED" : 0; + object.resultState = options.enums === String ? "RESULT_STATE_UNSPECIFIED" : 0; + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.urlsCrawledCount = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.urlsCrawledCount = options.longs === String ? "0" : 0; + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.urlsTestedCount = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.urlsTestedCount = options.longs === String ? "0" : 0; + object.hasFindings = false; + object.errorTrace = null; + } + if (message.summary != null && message.hasOwnProperty("summary")) + object.summary = message.summary; + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.executionState != null && message.hasOwnProperty("executionState")) + object.executionState = options.enums === String ? $root.google.cloud.websecurityscanner.v1.ScanRun.ExecutionState[message.executionState] === undefined ? message.executionState : $root.google.cloud.websecurityscanner.v1.ScanRun.ExecutionState[message.executionState] : message.executionState; + if (message.resultState != null && message.hasOwnProperty("resultState")) + object.resultState = options.enums === String ? $root.google.cloud.websecurityscanner.v1.ScanRun.ResultState[message.resultState] === undefined ? message.resultState : $root.google.cloud.websecurityscanner.v1.ScanRun.ResultState[message.resultState] : message.resultState; + if (message.urlsCrawledCount != null && message.hasOwnProperty("urlsCrawledCount")) + if (typeof message.urlsCrawledCount === "number") + object.urlsCrawledCount = options.longs === String ? String(message.urlsCrawledCount) : message.urlsCrawledCount; + else + object.urlsCrawledCount = options.longs === String ? $util.Long.prototype.toString.call(message.urlsCrawledCount) : options.longs === Number ? new $util.LongBits(message.urlsCrawledCount.low >>> 0, message.urlsCrawledCount.high >>> 0).toNumber() : message.urlsCrawledCount; + if (message.urlsTestedCount != null && message.hasOwnProperty("urlsTestedCount")) + if (typeof message.urlsTestedCount === "number") + object.urlsTestedCount = options.longs === String ? String(message.urlsTestedCount) : message.urlsTestedCount; + else + object.urlsTestedCount = options.longs === String ? $util.Long.prototype.toString.call(message.urlsTestedCount) : options.longs === Number ? new $util.LongBits(message.urlsTestedCount.low >>> 0, message.urlsTestedCount.high >>> 0).toNumber() : message.urlsTestedCount; + if (message.hasFindings != null && message.hasOwnProperty("hasFindings")) + object.hasFindings = message.hasFindings; + if (message.errorTrace != null && message.hasOwnProperty("errorTrace")) + object.errorTrace = $root.google.cloud.websecurityscanner.v1.ScanRunErrorTrace.toObject(message.errorTrace, options); + return object; + }; + + /** + * Converts this ScanRunLog to JSON. + * @function toJSON + * @memberof google.cloud.websecurityscanner.v1.ScanRunLog + * @instance + * @returns {Object.} JSON object + */ + ScanRunLog.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ScanRunLog + * @function getTypeUrl + * @memberof google.cloud.websecurityscanner.v1.ScanRunLog + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ScanRunLog.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.websecurityscanner.v1.ScanRunLog"; + }; + + return ScanRunLog; + })(); + + v1.WebSecurityScanner = (function() { + + /** + * Constructs a new WebSecurityScanner service. + * @memberof google.cloud.websecurityscanner.v1 + * @classdesc Represents a WebSecurityScanner + * @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 WebSecurityScanner(rpcImpl, requestDelimited, responseDelimited) { + $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited); + } + + (WebSecurityScanner.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = WebSecurityScanner; + + /** + * Creates new WebSecurityScanner service using the specified rpc implementation. + * @function create + * @memberof google.cloud.websecurityscanner.v1.WebSecurityScanner + * @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 {WebSecurityScanner} RPC service. Useful where requests and/or responses are streamed. + */ + WebSecurityScanner.create = function create(rpcImpl, requestDelimited, responseDelimited) { + return new this(rpcImpl, requestDelimited, responseDelimited); + }; + + /** + * Callback as used by {@link google.cloud.websecurityscanner.v1.WebSecurityScanner|createScanConfig}. + * @memberof google.cloud.websecurityscanner.v1.WebSecurityScanner + * @typedef CreateScanConfigCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.websecurityscanner.v1.ScanConfig} [response] ScanConfig + */ + + /** + * Calls CreateScanConfig. + * @function createScanConfig + * @memberof google.cloud.websecurityscanner.v1.WebSecurityScanner + * @instance + * @param {google.cloud.websecurityscanner.v1.ICreateScanConfigRequest} request CreateScanConfigRequest message or plain object + * @param {google.cloud.websecurityscanner.v1.WebSecurityScanner.CreateScanConfigCallback} callback Node-style callback called with the error, if any, and ScanConfig + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(WebSecurityScanner.prototype.createScanConfig = function createScanConfig(request, callback) { + return this.rpcCall(createScanConfig, $root.google.cloud.websecurityscanner.v1.CreateScanConfigRequest, $root.google.cloud.websecurityscanner.v1.ScanConfig, request, callback); + }, "name", { value: "CreateScanConfig" }); + + /** + * Calls CreateScanConfig. + * @function createScanConfig + * @memberof google.cloud.websecurityscanner.v1.WebSecurityScanner + * @instance + * @param {google.cloud.websecurityscanner.v1.ICreateScanConfigRequest} request CreateScanConfigRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.websecurityscanner.v1.WebSecurityScanner|deleteScanConfig}. + * @memberof google.cloud.websecurityscanner.v1.WebSecurityScanner + * @typedef DeleteScanConfigCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.protobuf.Empty} [response] Empty + */ + + /** + * Calls DeleteScanConfig. + * @function deleteScanConfig + * @memberof google.cloud.websecurityscanner.v1.WebSecurityScanner + * @instance + * @param {google.cloud.websecurityscanner.v1.IDeleteScanConfigRequest} request DeleteScanConfigRequest message or plain object + * @param {google.cloud.websecurityscanner.v1.WebSecurityScanner.DeleteScanConfigCallback} callback Node-style callback called with the error, if any, and Empty + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(WebSecurityScanner.prototype.deleteScanConfig = function deleteScanConfig(request, callback) { + return this.rpcCall(deleteScanConfig, $root.google.cloud.websecurityscanner.v1.DeleteScanConfigRequest, $root.google.protobuf.Empty, request, callback); + }, "name", { value: "DeleteScanConfig" }); + + /** + * Calls DeleteScanConfig. + * @function deleteScanConfig + * @memberof google.cloud.websecurityscanner.v1.WebSecurityScanner + * @instance + * @param {google.cloud.websecurityscanner.v1.IDeleteScanConfigRequest} request DeleteScanConfigRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.websecurityscanner.v1.WebSecurityScanner|getScanConfig}. + * @memberof google.cloud.websecurityscanner.v1.WebSecurityScanner + * @typedef GetScanConfigCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.websecurityscanner.v1.ScanConfig} [response] ScanConfig + */ + + /** + * Calls GetScanConfig. + * @function getScanConfig + * @memberof google.cloud.websecurityscanner.v1.WebSecurityScanner + * @instance + * @param {google.cloud.websecurityscanner.v1.IGetScanConfigRequest} request GetScanConfigRequest message or plain object + * @param {google.cloud.websecurityscanner.v1.WebSecurityScanner.GetScanConfigCallback} callback Node-style callback called with the error, if any, and ScanConfig + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(WebSecurityScanner.prototype.getScanConfig = function getScanConfig(request, callback) { + return this.rpcCall(getScanConfig, $root.google.cloud.websecurityscanner.v1.GetScanConfigRequest, $root.google.cloud.websecurityscanner.v1.ScanConfig, request, callback); + }, "name", { value: "GetScanConfig" }); + + /** + * Calls GetScanConfig. + * @function getScanConfig + * @memberof google.cloud.websecurityscanner.v1.WebSecurityScanner + * @instance + * @param {google.cloud.websecurityscanner.v1.IGetScanConfigRequest} request GetScanConfigRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.websecurityscanner.v1.WebSecurityScanner|listScanConfigs}. + * @memberof google.cloud.websecurityscanner.v1.WebSecurityScanner + * @typedef ListScanConfigsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.websecurityscanner.v1.ListScanConfigsResponse} [response] ListScanConfigsResponse + */ + + /** + * Calls ListScanConfigs. + * @function listScanConfigs + * @memberof google.cloud.websecurityscanner.v1.WebSecurityScanner + * @instance + * @param {google.cloud.websecurityscanner.v1.IListScanConfigsRequest} request ListScanConfigsRequest message or plain object + * @param {google.cloud.websecurityscanner.v1.WebSecurityScanner.ListScanConfigsCallback} callback Node-style callback called with the error, if any, and ListScanConfigsResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(WebSecurityScanner.prototype.listScanConfigs = function listScanConfigs(request, callback) { + return this.rpcCall(listScanConfigs, $root.google.cloud.websecurityscanner.v1.ListScanConfigsRequest, $root.google.cloud.websecurityscanner.v1.ListScanConfigsResponse, request, callback); + }, "name", { value: "ListScanConfigs" }); + + /** + * Calls ListScanConfigs. + * @function listScanConfigs + * @memberof google.cloud.websecurityscanner.v1.WebSecurityScanner + * @instance + * @param {google.cloud.websecurityscanner.v1.IListScanConfigsRequest} request ListScanConfigsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.websecurityscanner.v1.WebSecurityScanner|updateScanConfig}. + * @memberof google.cloud.websecurityscanner.v1.WebSecurityScanner + * @typedef UpdateScanConfigCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.websecurityscanner.v1.ScanConfig} [response] ScanConfig + */ + + /** + * Calls UpdateScanConfig. + * @function updateScanConfig + * @memberof google.cloud.websecurityscanner.v1.WebSecurityScanner + * @instance + * @param {google.cloud.websecurityscanner.v1.IUpdateScanConfigRequest} request UpdateScanConfigRequest message or plain object + * @param {google.cloud.websecurityscanner.v1.WebSecurityScanner.UpdateScanConfigCallback} callback Node-style callback called with the error, if any, and ScanConfig + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(WebSecurityScanner.prototype.updateScanConfig = function updateScanConfig(request, callback) { + return this.rpcCall(updateScanConfig, $root.google.cloud.websecurityscanner.v1.UpdateScanConfigRequest, $root.google.cloud.websecurityscanner.v1.ScanConfig, request, callback); + }, "name", { value: "UpdateScanConfig" }); + + /** + * Calls UpdateScanConfig. + * @function updateScanConfig + * @memberof google.cloud.websecurityscanner.v1.WebSecurityScanner + * @instance + * @param {google.cloud.websecurityscanner.v1.IUpdateScanConfigRequest} request UpdateScanConfigRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.websecurityscanner.v1.WebSecurityScanner|startScanRun}. + * @memberof google.cloud.websecurityscanner.v1.WebSecurityScanner + * @typedef StartScanRunCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.websecurityscanner.v1.ScanRun} [response] ScanRun + */ + + /** + * Calls StartScanRun. + * @function startScanRun + * @memberof google.cloud.websecurityscanner.v1.WebSecurityScanner + * @instance + * @param {google.cloud.websecurityscanner.v1.IStartScanRunRequest} request StartScanRunRequest message or plain object + * @param {google.cloud.websecurityscanner.v1.WebSecurityScanner.StartScanRunCallback} callback Node-style callback called with the error, if any, and ScanRun + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(WebSecurityScanner.prototype.startScanRun = function startScanRun(request, callback) { + return this.rpcCall(startScanRun, $root.google.cloud.websecurityscanner.v1.StartScanRunRequest, $root.google.cloud.websecurityscanner.v1.ScanRun, request, callback); + }, "name", { value: "StartScanRun" }); + + /** + * Calls StartScanRun. + * @function startScanRun + * @memberof google.cloud.websecurityscanner.v1.WebSecurityScanner + * @instance + * @param {google.cloud.websecurityscanner.v1.IStartScanRunRequest} request StartScanRunRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.websecurityscanner.v1.WebSecurityScanner|getScanRun}. + * @memberof google.cloud.websecurityscanner.v1.WebSecurityScanner + * @typedef GetScanRunCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.websecurityscanner.v1.ScanRun} [response] ScanRun + */ + + /** + * Calls GetScanRun. + * @function getScanRun + * @memberof google.cloud.websecurityscanner.v1.WebSecurityScanner + * @instance + * @param {google.cloud.websecurityscanner.v1.IGetScanRunRequest} request GetScanRunRequest message or plain object + * @param {google.cloud.websecurityscanner.v1.WebSecurityScanner.GetScanRunCallback} callback Node-style callback called with the error, if any, and ScanRun + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(WebSecurityScanner.prototype.getScanRun = function getScanRun(request, callback) { + return this.rpcCall(getScanRun, $root.google.cloud.websecurityscanner.v1.GetScanRunRequest, $root.google.cloud.websecurityscanner.v1.ScanRun, request, callback); + }, "name", { value: "GetScanRun" }); + + /** + * Calls GetScanRun. + * @function getScanRun + * @memberof google.cloud.websecurityscanner.v1.WebSecurityScanner + * @instance + * @param {google.cloud.websecurityscanner.v1.IGetScanRunRequest} request GetScanRunRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.websecurityscanner.v1.WebSecurityScanner|listScanRuns}. + * @memberof google.cloud.websecurityscanner.v1.WebSecurityScanner + * @typedef ListScanRunsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.websecurityscanner.v1.ListScanRunsResponse} [response] ListScanRunsResponse + */ + + /** + * Calls ListScanRuns. + * @function listScanRuns + * @memberof google.cloud.websecurityscanner.v1.WebSecurityScanner + * @instance + * @param {google.cloud.websecurityscanner.v1.IListScanRunsRequest} request ListScanRunsRequest message or plain object + * @param {google.cloud.websecurityscanner.v1.WebSecurityScanner.ListScanRunsCallback} callback Node-style callback called with the error, if any, and ListScanRunsResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(WebSecurityScanner.prototype.listScanRuns = function listScanRuns(request, callback) { + return this.rpcCall(listScanRuns, $root.google.cloud.websecurityscanner.v1.ListScanRunsRequest, $root.google.cloud.websecurityscanner.v1.ListScanRunsResponse, request, callback); + }, "name", { value: "ListScanRuns" }); + + /** + * Calls ListScanRuns. + * @function listScanRuns + * @memberof google.cloud.websecurityscanner.v1.WebSecurityScanner + * @instance + * @param {google.cloud.websecurityscanner.v1.IListScanRunsRequest} request ListScanRunsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.websecurityscanner.v1.WebSecurityScanner|stopScanRun}. + * @memberof google.cloud.websecurityscanner.v1.WebSecurityScanner + * @typedef StopScanRunCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.websecurityscanner.v1.ScanRun} [response] ScanRun + */ + + /** + * Calls StopScanRun. + * @function stopScanRun + * @memberof google.cloud.websecurityscanner.v1.WebSecurityScanner + * @instance + * @param {google.cloud.websecurityscanner.v1.IStopScanRunRequest} request StopScanRunRequest message or plain object + * @param {google.cloud.websecurityscanner.v1.WebSecurityScanner.StopScanRunCallback} callback Node-style callback called with the error, if any, and ScanRun + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(WebSecurityScanner.prototype.stopScanRun = function stopScanRun(request, callback) { + return this.rpcCall(stopScanRun, $root.google.cloud.websecurityscanner.v1.StopScanRunRequest, $root.google.cloud.websecurityscanner.v1.ScanRun, request, callback); + }, "name", { value: "StopScanRun" }); + + /** + * Calls StopScanRun. + * @function stopScanRun + * @memberof google.cloud.websecurityscanner.v1.WebSecurityScanner + * @instance + * @param {google.cloud.websecurityscanner.v1.IStopScanRunRequest} request StopScanRunRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.websecurityscanner.v1.WebSecurityScanner|listCrawledUrls}. + * @memberof google.cloud.websecurityscanner.v1.WebSecurityScanner + * @typedef ListCrawledUrlsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.websecurityscanner.v1.ListCrawledUrlsResponse} [response] ListCrawledUrlsResponse + */ + + /** + * Calls ListCrawledUrls. + * @function listCrawledUrls + * @memberof google.cloud.websecurityscanner.v1.WebSecurityScanner + * @instance + * @param {google.cloud.websecurityscanner.v1.IListCrawledUrlsRequest} request ListCrawledUrlsRequest message or plain object + * @param {google.cloud.websecurityscanner.v1.WebSecurityScanner.ListCrawledUrlsCallback} callback Node-style callback called with the error, if any, and ListCrawledUrlsResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(WebSecurityScanner.prototype.listCrawledUrls = function listCrawledUrls(request, callback) { + return this.rpcCall(listCrawledUrls, $root.google.cloud.websecurityscanner.v1.ListCrawledUrlsRequest, $root.google.cloud.websecurityscanner.v1.ListCrawledUrlsResponse, request, callback); + }, "name", { value: "ListCrawledUrls" }); + + /** + * Calls ListCrawledUrls. + * @function listCrawledUrls + * @memberof google.cloud.websecurityscanner.v1.WebSecurityScanner + * @instance + * @param {google.cloud.websecurityscanner.v1.IListCrawledUrlsRequest} request ListCrawledUrlsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.websecurityscanner.v1.WebSecurityScanner|getFinding}. + * @memberof google.cloud.websecurityscanner.v1.WebSecurityScanner + * @typedef GetFindingCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.websecurityscanner.v1.Finding} [response] Finding + */ + + /** + * Calls GetFinding. + * @function getFinding + * @memberof google.cloud.websecurityscanner.v1.WebSecurityScanner + * @instance + * @param {google.cloud.websecurityscanner.v1.IGetFindingRequest} request GetFindingRequest message or plain object + * @param {google.cloud.websecurityscanner.v1.WebSecurityScanner.GetFindingCallback} callback Node-style callback called with the error, if any, and Finding + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(WebSecurityScanner.prototype.getFinding = function getFinding(request, callback) { + return this.rpcCall(getFinding, $root.google.cloud.websecurityscanner.v1.GetFindingRequest, $root.google.cloud.websecurityscanner.v1.Finding, request, callback); + }, "name", { value: "GetFinding" }); + + /** + * Calls GetFinding. + * @function getFinding + * @memberof google.cloud.websecurityscanner.v1.WebSecurityScanner + * @instance + * @param {google.cloud.websecurityscanner.v1.IGetFindingRequest} request GetFindingRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.websecurityscanner.v1.WebSecurityScanner|listFindings}. + * @memberof google.cloud.websecurityscanner.v1.WebSecurityScanner + * @typedef ListFindingsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.websecurityscanner.v1.ListFindingsResponse} [response] ListFindingsResponse + */ + + /** + * Calls ListFindings. + * @function listFindings + * @memberof google.cloud.websecurityscanner.v1.WebSecurityScanner + * @instance + * @param {google.cloud.websecurityscanner.v1.IListFindingsRequest} request ListFindingsRequest message or plain object + * @param {google.cloud.websecurityscanner.v1.WebSecurityScanner.ListFindingsCallback} callback Node-style callback called with the error, if any, and ListFindingsResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(WebSecurityScanner.prototype.listFindings = function listFindings(request, callback) { + return this.rpcCall(listFindings, $root.google.cloud.websecurityscanner.v1.ListFindingsRequest, $root.google.cloud.websecurityscanner.v1.ListFindingsResponse, request, callback); + }, "name", { value: "ListFindings" }); + + /** + * Calls ListFindings. + * @function listFindings + * @memberof google.cloud.websecurityscanner.v1.WebSecurityScanner + * @instance + * @param {google.cloud.websecurityscanner.v1.IListFindingsRequest} request ListFindingsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.websecurityscanner.v1.WebSecurityScanner|listFindingTypeStats}. + * @memberof google.cloud.websecurityscanner.v1.WebSecurityScanner + * @typedef ListFindingTypeStatsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.websecurityscanner.v1.ListFindingTypeStatsResponse} [response] ListFindingTypeStatsResponse + */ + + /** + * Calls ListFindingTypeStats. + * @function listFindingTypeStats + * @memberof google.cloud.websecurityscanner.v1.WebSecurityScanner + * @instance + * @param {google.cloud.websecurityscanner.v1.IListFindingTypeStatsRequest} request ListFindingTypeStatsRequest message or plain object + * @param {google.cloud.websecurityscanner.v1.WebSecurityScanner.ListFindingTypeStatsCallback} callback Node-style callback called with the error, if any, and ListFindingTypeStatsResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(WebSecurityScanner.prototype.listFindingTypeStats = function listFindingTypeStats(request, callback) { + return this.rpcCall(listFindingTypeStats, $root.google.cloud.websecurityscanner.v1.ListFindingTypeStatsRequest, $root.google.cloud.websecurityscanner.v1.ListFindingTypeStatsResponse, request, callback); + }, "name", { value: "ListFindingTypeStats" }); + + /** + * Calls ListFindingTypeStats. + * @function listFindingTypeStats + * @memberof google.cloud.websecurityscanner.v1.WebSecurityScanner + * @instance + * @param {google.cloud.websecurityscanner.v1.IListFindingTypeStatsRequest} request ListFindingTypeStatsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + return WebSecurityScanner; + })(); + + v1.CreateScanConfigRequest = (function() { + + /** + * Properties of a CreateScanConfigRequest. + * @memberof google.cloud.websecurityscanner.v1 + * @interface ICreateScanConfigRequest + * @property {string|null} [parent] CreateScanConfigRequest parent + * @property {google.cloud.websecurityscanner.v1.IScanConfig|null} [scanConfig] CreateScanConfigRequest scanConfig + */ + + /** + * Constructs a new CreateScanConfigRequest. + * @memberof google.cloud.websecurityscanner.v1 + * @classdesc Represents a CreateScanConfigRequest. + * @implements ICreateScanConfigRequest + * @constructor + * @param {google.cloud.websecurityscanner.v1.ICreateScanConfigRequest=} [properties] Properties to set + */ + function CreateScanConfigRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * CreateScanConfigRequest parent. + * @member {string} parent + * @memberof google.cloud.websecurityscanner.v1.CreateScanConfigRequest + * @instance + */ + CreateScanConfigRequest.prototype.parent = ""; + + /** + * CreateScanConfigRequest scanConfig. + * @member {google.cloud.websecurityscanner.v1.IScanConfig|null|undefined} scanConfig + * @memberof google.cloud.websecurityscanner.v1.CreateScanConfigRequest + * @instance + */ + CreateScanConfigRequest.prototype.scanConfig = null; + + /** + * Creates a new CreateScanConfigRequest instance using the specified properties. + * @function create + * @memberof google.cloud.websecurityscanner.v1.CreateScanConfigRequest + * @static + * @param {google.cloud.websecurityscanner.v1.ICreateScanConfigRequest=} [properties] Properties to set + * @returns {google.cloud.websecurityscanner.v1.CreateScanConfigRequest} CreateScanConfigRequest instance + */ + CreateScanConfigRequest.create = function create(properties) { + return new CreateScanConfigRequest(properties); + }; + + /** + * Encodes the specified CreateScanConfigRequest message. Does not implicitly {@link google.cloud.websecurityscanner.v1.CreateScanConfigRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.websecurityscanner.v1.CreateScanConfigRequest + * @static + * @param {google.cloud.websecurityscanner.v1.ICreateScanConfigRequest} message CreateScanConfigRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateScanConfigRequest.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.scanConfig != null && Object.hasOwnProperty.call(message, "scanConfig")) + $root.google.cloud.websecurityscanner.v1.ScanConfig.encode(message.scanConfig, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified CreateScanConfigRequest message, length delimited. Does not implicitly {@link google.cloud.websecurityscanner.v1.CreateScanConfigRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.websecurityscanner.v1.CreateScanConfigRequest + * @static + * @param {google.cloud.websecurityscanner.v1.ICreateScanConfigRequest} message CreateScanConfigRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateScanConfigRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CreateScanConfigRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.websecurityscanner.v1.CreateScanConfigRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.websecurityscanner.v1.CreateScanConfigRequest} CreateScanConfigRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateScanConfigRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.websecurityscanner.v1.CreateScanConfigRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + message.scanConfig = $root.google.cloud.websecurityscanner.v1.ScanConfig.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CreateScanConfigRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.websecurityscanner.v1.CreateScanConfigRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.websecurityscanner.v1.CreateScanConfigRequest} CreateScanConfigRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateScanConfigRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CreateScanConfigRequest message. + * @function verify + * @memberof google.cloud.websecurityscanner.v1.CreateScanConfigRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CreateScanConfigRequest.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.scanConfig != null && message.hasOwnProperty("scanConfig")) { + var error = $root.google.cloud.websecurityscanner.v1.ScanConfig.verify(message.scanConfig); + if (error) + return "scanConfig." + error; + } + return null; + }; + + /** + * Creates a CreateScanConfigRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.websecurityscanner.v1.CreateScanConfigRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.websecurityscanner.v1.CreateScanConfigRequest} CreateScanConfigRequest + */ + CreateScanConfigRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.websecurityscanner.v1.CreateScanConfigRequest) + return object; + var message = new $root.google.cloud.websecurityscanner.v1.CreateScanConfigRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.scanConfig != null) { + if (typeof object.scanConfig !== "object") + throw TypeError(".google.cloud.websecurityscanner.v1.CreateScanConfigRequest.scanConfig: object expected"); + message.scanConfig = $root.google.cloud.websecurityscanner.v1.ScanConfig.fromObject(object.scanConfig); + } + return message; + }; + + /** + * Creates a plain object from a CreateScanConfigRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.websecurityscanner.v1.CreateScanConfigRequest + * @static + * @param {google.cloud.websecurityscanner.v1.CreateScanConfigRequest} message CreateScanConfigRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CreateScanConfigRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.scanConfig = null; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.scanConfig != null && message.hasOwnProperty("scanConfig")) + object.scanConfig = $root.google.cloud.websecurityscanner.v1.ScanConfig.toObject(message.scanConfig, options); + return object; + }; + + /** + * Converts this CreateScanConfigRequest to JSON. + * @function toJSON + * @memberof google.cloud.websecurityscanner.v1.CreateScanConfigRequest + * @instance + * @returns {Object.} JSON object + */ + CreateScanConfigRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CreateScanConfigRequest + * @function getTypeUrl + * @memberof google.cloud.websecurityscanner.v1.CreateScanConfigRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CreateScanConfigRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.websecurityscanner.v1.CreateScanConfigRequest"; + }; + + return CreateScanConfigRequest; + })(); + + v1.DeleteScanConfigRequest = (function() { + + /** + * Properties of a DeleteScanConfigRequest. + * @memberof google.cloud.websecurityscanner.v1 + * @interface IDeleteScanConfigRequest + * @property {string|null} [name] DeleteScanConfigRequest name + */ + + /** + * Constructs a new DeleteScanConfigRequest. + * @memberof google.cloud.websecurityscanner.v1 + * @classdesc Represents a DeleteScanConfigRequest. + * @implements IDeleteScanConfigRequest + * @constructor + * @param {google.cloud.websecurityscanner.v1.IDeleteScanConfigRequest=} [properties] Properties to set + */ + function DeleteScanConfigRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * DeleteScanConfigRequest name. + * @member {string} name + * @memberof google.cloud.websecurityscanner.v1.DeleteScanConfigRequest + * @instance + */ + DeleteScanConfigRequest.prototype.name = ""; + + /** + * Creates a new DeleteScanConfigRequest instance using the specified properties. + * @function create + * @memberof google.cloud.websecurityscanner.v1.DeleteScanConfigRequest + * @static + * @param {google.cloud.websecurityscanner.v1.IDeleteScanConfigRequest=} [properties] Properties to set + * @returns {google.cloud.websecurityscanner.v1.DeleteScanConfigRequest} DeleteScanConfigRequest instance + */ + DeleteScanConfigRequest.create = function create(properties) { + return new DeleteScanConfigRequest(properties); + }; + + /** + * Encodes the specified DeleteScanConfigRequest message. Does not implicitly {@link google.cloud.websecurityscanner.v1.DeleteScanConfigRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.websecurityscanner.v1.DeleteScanConfigRequest + * @static + * @param {google.cloud.websecurityscanner.v1.IDeleteScanConfigRequest} message DeleteScanConfigRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteScanConfigRequest.encode = function encode(message, writer) { + 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 DeleteScanConfigRequest message, length delimited. Does not implicitly {@link google.cloud.websecurityscanner.v1.DeleteScanConfigRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.websecurityscanner.v1.DeleteScanConfigRequest + * @static + * @param {google.cloud.websecurityscanner.v1.IDeleteScanConfigRequest} message DeleteScanConfigRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteScanConfigRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DeleteScanConfigRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.websecurityscanner.v1.DeleteScanConfigRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.websecurityscanner.v1.DeleteScanConfigRequest} DeleteScanConfigRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteScanConfigRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.websecurityscanner.v1.DeleteScanConfigRequest(); + 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 DeleteScanConfigRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.websecurityscanner.v1.DeleteScanConfigRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.websecurityscanner.v1.DeleteScanConfigRequest} DeleteScanConfigRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteScanConfigRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DeleteScanConfigRequest message. + * @function verify + * @memberof google.cloud.websecurityscanner.v1.DeleteScanConfigRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DeleteScanConfigRequest.verify = function verify(message) { + if (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 DeleteScanConfigRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.websecurityscanner.v1.DeleteScanConfigRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.websecurityscanner.v1.DeleteScanConfigRequest} DeleteScanConfigRequest + */ + DeleteScanConfigRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.websecurityscanner.v1.DeleteScanConfigRequest) + return object; + var message = new $root.google.cloud.websecurityscanner.v1.DeleteScanConfigRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a DeleteScanConfigRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.websecurityscanner.v1.DeleteScanConfigRequest + * @static + * @param {google.cloud.websecurityscanner.v1.DeleteScanConfigRequest} message DeleteScanConfigRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DeleteScanConfigRequest.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 DeleteScanConfigRequest to JSON. + * @function toJSON + * @memberof google.cloud.websecurityscanner.v1.DeleteScanConfigRequest + * @instance + * @returns {Object.} JSON object + */ + DeleteScanConfigRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DeleteScanConfigRequest + * @function getTypeUrl + * @memberof google.cloud.websecurityscanner.v1.DeleteScanConfigRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DeleteScanConfigRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.websecurityscanner.v1.DeleteScanConfigRequest"; + }; + + return DeleteScanConfigRequest; + })(); + + v1.GetScanConfigRequest = (function() { + + /** + * Properties of a GetScanConfigRequest. + * @memberof google.cloud.websecurityscanner.v1 + * @interface IGetScanConfigRequest + * @property {string|null} [name] GetScanConfigRequest name + */ + + /** + * Constructs a new GetScanConfigRequest. + * @memberof google.cloud.websecurityscanner.v1 + * @classdesc Represents a GetScanConfigRequest. + * @implements IGetScanConfigRequest + * @constructor + * @param {google.cloud.websecurityscanner.v1.IGetScanConfigRequest=} [properties] Properties to set + */ + function GetScanConfigRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetScanConfigRequest name. + * @member {string} name + * @memberof google.cloud.websecurityscanner.v1.GetScanConfigRequest + * @instance + */ + GetScanConfigRequest.prototype.name = ""; + + /** + * Creates a new GetScanConfigRequest instance using the specified properties. + * @function create + * @memberof google.cloud.websecurityscanner.v1.GetScanConfigRequest + * @static + * @param {google.cloud.websecurityscanner.v1.IGetScanConfigRequest=} [properties] Properties to set + * @returns {google.cloud.websecurityscanner.v1.GetScanConfigRequest} GetScanConfigRequest instance + */ + GetScanConfigRequest.create = function create(properties) { + return new GetScanConfigRequest(properties); + }; + + /** + * Encodes the specified GetScanConfigRequest message. Does not implicitly {@link google.cloud.websecurityscanner.v1.GetScanConfigRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.websecurityscanner.v1.GetScanConfigRequest + * @static + * @param {google.cloud.websecurityscanner.v1.IGetScanConfigRequest} message GetScanConfigRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetScanConfigRequest.encode = function encode(message, writer) { + 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 GetScanConfigRequest message, length delimited. Does not implicitly {@link google.cloud.websecurityscanner.v1.GetScanConfigRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.websecurityscanner.v1.GetScanConfigRequest + * @static + * @param {google.cloud.websecurityscanner.v1.IGetScanConfigRequest} message GetScanConfigRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetScanConfigRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetScanConfigRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.websecurityscanner.v1.GetScanConfigRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.websecurityscanner.v1.GetScanConfigRequest} GetScanConfigRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetScanConfigRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.websecurityscanner.v1.GetScanConfigRequest(); + 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 GetScanConfigRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.websecurityscanner.v1.GetScanConfigRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.websecurityscanner.v1.GetScanConfigRequest} GetScanConfigRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetScanConfigRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetScanConfigRequest message. + * @function verify + * @memberof google.cloud.websecurityscanner.v1.GetScanConfigRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetScanConfigRequest.verify = function verify(message) { + if (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 GetScanConfigRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.websecurityscanner.v1.GetScanConfigRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.websecurityscanner.v1.GetScanConfigRequest} GetScanConfigRequest + */ + GetScanConfigRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.websecurityscanner.v1.GetScanConfigRequest) + return object; + var message = new $root.google.cloud.websecurityscanner.v1.GetScanConfigRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a GetScanConfigRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.websecurityscanner.v1.GetScanConfigRequest + * @static + * @param {google.cloud.websecurityscanner.v1.GetScanConfigRequest} message GetScanConfigRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetScanConfigRequest.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 GetScanConfigRequest to JSON. + * @function toJSON + * @memberof google.cloud.websecurityscanner.v1.GetScanConfigRequest + * @instance + * @returns {Object.} JSON object + */ + GetScanConfigRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GetScanConfigRequest + * @function getTypeUrl + * @memberof google.cloud.websecurityscanner.v1.GetScanConfigRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GetScanConfigRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.websecurityscanner.v1.GetScanConfigRequest"; + }; + + return GetScanConfigRequest; + })(); + + v1.ListScanConfigsRequest = (function() { + + /** + * Properties of a ListScanConfigsRequest. + * @memberof google.cloud.websecurityscanner.v1 + * @interface IListScanConfigsRequest + * @property {string|null} [parent] ListScanConfigsRequest parent + * @property {string|null} [pageToken] ListScanConfigsRequest pageToken + * @property {number|null} [pageSize] ListScanConfigsRequest pageSize + */ + + /** + * Constructs a new ListScanConfigsRequest. + * @memberof google.cloud.websecurityscanner.v1 + * @classdesc Represents a ListScanConfigsRequest. + * @implements IListScanConfigsRequest + * @constructor + * @param {google.cloud.websecurityscanner.v1.IListScanConfigsRequest=} [properties] Properties to set + */ + function ListScanConfigsRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListScanConfigsRequest parent. + * @member {string} parent + * @memberof google.cloud.websecurityscanner.v1.ListScanConfigsRequest + * @instance + */ + ListScanConfigsRequest.prototype.parent = ""; + + /** + * ListScanConfigsRequest pageToken. + * @member {string} pageToken + * @memberof google.cloud.websecurityscanner.v1.ListScanConfigsRequest + * @instance + */ + ListScanConfigsRequest.prototype.pageToken = ""; + + /** + * ListScanConfigsRequest pageSize. + * @member {number} pageSize + * @memberof google.cloud.websecurityscanner.v1.ListScanConfigsRequest + * @instance + */ + ListScanConfigsRequest.prototype.pageSize = 0; + + /** + * Creates a new ListScanConfigsRequest instance using the specified properties. + * @function create + * @memberof google.cloud.websecurityscanner.v1.ListScanConfigsRequest + * @static + * @param {google.cloud.websecurityscanner.v1.IListScanConfigsRequest=} [properties] Properties to set + * @returns {google.cloud.websecurityscanner.v1.ListScanConfigsRequest} ListScanConfigsRequest instance + */ + ListScanConfigsRequest.create = function create(properties) { + return new ListScanConfigsRequest(properties); + }; + + /** + * Encodes the specified ListScanConfigsRequest message. Does not implicitly {@link google.cloud.websecurityscanner.v1.ListScanConfigsRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.websecurityscanner.v1.ListScanConfigsRequest + * @static + * @param {google.cloud.websecurityscanner.v1.IListScanConfigsRequest} message ListScanConfigsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListScanConfigsRequest.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.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.pageToken); + if (message.pageSize != null && Object.hasOwnProperty.call(message, "pageSize")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.pageSize); + return writer; + }; + + /** + * Encodes the specified ListScanConfigsRequest message, length delimited. Does not implicitly {@link google.cloud.websecurityscanner.v1.ListScanConfigsRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.websecurityscanner.v1.ListScanConfigsRequest + * @static + * @param {google.cloud.websecurityscanner.v1.IListScanConfigsRequest} message ListScanConfigsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListScanConfigsRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListScanConfigsRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.websecurityscanner.v1.ListScanConfigsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.websecurityscanner.v1.ListScanConfigsRequest} ListScanConfigsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListScanConfigsRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.websecurityscanner.v1.ListScanConfigsRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + message.pageToken = reader.string(); + break; + } + case 3: { + message.pageSize = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListScanConfigsRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.websecurityscanner.v1.ListScanConfigsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.websecurityscanner.v1.ListScanConfigsRequest} ListScanConfigsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListScanConfigsRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListScanConfigsRequest message. + * @function verify + * @memberof google.cloud.websecurityscanner.v1.ListScanConfigsRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListScanConfigsRequest.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.pageToken != null && message.hasOwnProperty("pageToken")) + if (!$util.isString(message.pageToken)) + return "pageToken: string expected"; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + if (!$util.isInteger(message.pageSize)) + return "pageSize: integer expected"; + return null; + }; + + /** + * Creates a ListScanConfigsRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.websecurityscanner.v1.ListScanConfigsRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.websecurityscanner.v1.ListScanConfigsRequest} ListScanConfigsRequest + */ + ListScanConfigsRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.websecurityscanner.v1.ListScanConfigsRequest) + return object; + var message = new $root.google.cloud.websecurityscanner.v1.ListScanConfigsRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.pageToken != null) + message.pageToken = String(object.pageToken); + if (object.pageSize != null) + message.pageSize = object.pageSize | 0; + return message; + }; + + /** + * Creates a plain object from a ListScanConfigsRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.websecurityscanner.v1.ListScanConfigsRequest + * @static + * @param {google.cloud.websecurityscanner.v1.ListScanConfigsRequest} message ListScanConfigsRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListScanConfigsRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.pageToken = ""; + object.pageSize = 0; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + object.pageToken = message.pageToken; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + object.pageSize = message.pageSize; + return object; + }; + + /** + * Converts this ListScanConfigsRequest to JSON. + * @function toJSON + * @memberof google.cloud.websecurityscanner.v1.ListScanConfigsRequest + * @instance + * @returns {Object.} JSON object + */ + ListScanConfigsRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListScanConfigsRequest + * @function getTypeUrl + * @memberof google.cloud.websecurityscanner.v1.ListScanConfigsRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListScanConfigsRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.websecurityscanner.v1.ListScanConfigsRequest"; + }; + + return ListScanConfigsRequest; + })(); + + v1.UpdateScanConfigRequest = (function() { + + /** + * Properties of an UpdateScanConfigRequest. + * @memberof google.cloud.websecurityscanner.v1 + * @interface IUpdateScanConfigRequest + * @property {google.cloud.websecurityscanner.v1.IScanConfig|null} [scanConfig] UpdateScanConfigRequest scanConfig + * @property {google.protobuf.IFieldMask|null} [updateMask] UpdateScanConfigRequest updateMask + */ + + /** + * Constructs a new UpdateScanConfigRequest. + * @memberof google.cloud.websecurityscanner.v1 + * @classdesc Represents an UpdateScanConfigRequest. + * @implements IUpdateScanConfigRequest + * @constructor + * @param {google.cloud.websecurityscanner.v1.IUpdateScanConfigRequest=} [properties] Properties to set + */ + function UpdateScanConfigRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * UpdateScanConfigRequest scanConfig. + * @member {google.cloud.websecurityscanner.v1.IScanConfig|null|undefined} scanConfig + * @memberof google.cloud.websecurityscanner.v1.UpdateScanConfigRequest + * @instance + */ + UpdateScanConfigRequest.prototype.scanConfig = null; + + /** + * UpdateScanConfigRequest updateMask. + * @member {google.protobuf.IFieldMask|null|undefined} updateMask + * @memberof google.cloud.websecurityscanner.v1.UpdateScanConfigRequest + * @instance + */ + UpdateScanConfigRequest.prototype.updateMask = null; + + /** + * Creates a new UpdateScanConfigRequest instance using the specified properties. + * @function create + * @memberof google.cloud.websecurityscanner.v1.UpdateScanConfigRequest + * @static + * @param {google.cloud.websecurityscanner.v1.IUpdateScanConfigRequest=} [properties] Properties to set + * @returns {google.cloud.websecurityscanner.v1.UpdateScanConfigRequest} UpdateScanConfigRequest instance + */ + UpdateScanConfigRequest.create = function create(properties) { + return new UpdateScanConfigRequest(properties); + }; + + /** + * Encodes the specified UpdateScanConfigRequest message. Does not implicitly {@link google.cloud.websecurityscanner.v1.UpdateScanConfigRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.websecurityscanner.v1.UpdateScanConfigRequest + * @static + * @param {google.cloud.websecurityscanner.v1.IUpdateScanConfigRequest} message UpdateScanConfigRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateScanConfigRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.scanConfig != null && Object.hasOwnProperty.call(message, "scanConfig")) + $root.google.cloud.websecurityscanner.v1.ScanConfig.encode(message.scanConfig, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.updateMask != null && Object.hasOwnProperty.call(message, "updateMask")) + $root.google.protobuf.FieldMask.encode(message.updateMask, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified UpdateScanConfigRequest message, length delimited. Does not implicitly {@link google.cloud.websecurityscanner.v1.UpdateScanConfigRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.websecurityscanner.v1.UpdateScanConfigRequest + * @static + * @param {google.cloud.websecurityscanner.v1.IUpdateScanConfigRequest} message UpdateScanConfigRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateScanConfigRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an UpdateScanConfigRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.websecurityscanner.v1.UpdateScanConfigRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.websecurityscanner.v1.UpdateScanConfigRequest} UpdateScanConfigRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateScanConfigRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.websecurityscanner.v1.UpdateScanConfigRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 2: { + message.scanConfig = $root.google.cloud.websecurityscanner.v1.ScanConfig.decode(reader, reader.uint32()); + break; + } + case 3: { + message.updateMask = $root.google.protobuf.FieldMask.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an UpdateScanConfigRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.websecurityscanner.v1.UpdateScanConfigRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.websecurityscanner.v1.UpdateScanConfigRequest} UpdateScanConfigRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateScanConfigRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an UpdateScanConfigRequest message. + * @function verify + * @memberof google.cloud.websecurityscanner.v1.UpdateScanConfigRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + UpdateScanConfigRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.scanConfig != null && message.hasOwnProperty("scanConfig")) { + var error = $root.google.cloud.websecurityscanner.v1.ScanConfig.verify(message.scanConfig); + if (error) + return "scanConfig." + 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 UpdateScanConfigRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.websecurityscanner.v1.UpdateScanConfigRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.websecurityscanner.v1.UpdateScanConfigRequest} UpdateScanConfigRequest + */ + UpdateScanConfigRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.websecurityscanner.v1.UpdateScanConfigRequest) + return object; + var message = new $root.google.cloud.websecurityscanner.v1.UpdateScanConfigRequest(); + if (object.scanConfig != null) { + if (typeof object.scanConfig !== "object") + throw TypeError(".google.cloud.websecurityscanner.v1.UpdateScanConfigRequest.scanConfig: object expected"); + message.scanConfig = $root.google.cloud.websecurityscanner.v1.ScanConfig.fromObject(object.scanConfig); + } + if (object.updateMask != null) { + if (typeof object.updateMask !== "object") + throw TypeError(".google.cloud.websecurityscanner.v1.UpdateScanConfigRequest.updateMask: object expected"); + message.updateMask = $root.google.protobuf.FieldMask.fromObject(object.updateMask); + } + return message; + }; + + /** + * Creates a plain object from an UpdateScanConfigRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.websecurityscanner.v1.UpdateScanConfigRequest + * @static + * @param {google.cloud.websecurityscanner.v1.UpdateScanConfigRequest} message UpdateScanConfigRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + UpdateScanConfigRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.scanConfig = null; + object.updateMask = null; + } + if (message.scanConfig != null && message.hasOwnProperty("scanConfig")) + object.scanConfig = $root.google.cloud.websecurityscanner.v1.ScanConfig.toObject(message.scanConfig, options); + if (message.updateMask != null && message.hasOwnProperty("updateMask")) + object.updateMask = $root.google.protobuf.FieldMask.toObject(message.updateMask, options); + return object; + }; + + /** + * Converts this UpdateScanConfigRequest to JSON. + * @function toJSON + * @memberof google.cloud.websecurityscanner.v1.UpdateScanConfigRequest + * @instance + * @returns {Object.} JSON object + */ + UpdateScanConfigRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for UpdateScanConfigRequest + * @function getTypeUrl + * @memberof google.cloud.websecurityscanner.v1.UpdateScanConfigRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + UpdateScanConfigRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.websecurityscanner.v1.UpdateScanConfigRequest"; + }; + + return UpdateScanConfigRequest; + })(); + + v1.ListScanConfigsResponse = (function() { + + /** + * Properties of a ListScanConfigsResponse. + * @memberof google.cloud.websecurityscanner.v1 + * @interface IListScanConfigsResponse + * @property {Array.|null} [scanConfigs] ListScanConfigsResponse scanConfigs + * @property {string|null} [nextPageToken] ListScanConfigsResponse nextPageToken + */ + + /** + * Constructs a new ListScanConfigsResponse. + * @memberof google.cloud.websecurityscanner.v1 + * @classdesc Represents a ListScanConfigsResponse. + * @implements IListScanConfigsResponse + * @constructor + * @param {google.cloud.websecurityscanner.v1.IListScanConfigsResponse=} [properties] Properties to set + */ + function ListScanConfigsResponse(properties) { + this.scanConfigs = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListScanConfigsResponse scanConfigs. + * @member {Array.} scanConfigs + * @memberof google.cloud.websecurityscanner.v1.ListScanConfigsResponse + * @instance + */ + ListScanConfigsResponse.prototype.scanConfigs = $util.emptyArray; + + /** + * ListScanConfigsResponse nextPageToken. + * @member {string} nextPageToken + * @memberof google.cloud.websecurityscanner.v1.ListScanConfigsResponse + * @instance + */ + ListScanConfigsResponse.prototype.nextPageToken = ""; + + /** + * Creates a new ListScanConfigsResponse instance using the specified properties. + * @function create + * @memberof google.cloud.websecurityscanner.v1.ListScanConfigsResponse + * @static + * @param {google.cloud.websecurityscanner.v1.IListScanConfigsResponse=} [properties] Properties to set + * @returns {google.cloud.websecurityscanner.v1.ListScanConfigsResponse} ListScanConfigsResponse instance + */ + ListScanConfigsResponse.create = function create(properties) { + return new ListScanConfigsResponse(properties); + }; + + /** + * Encodes the specified ListScanConfigsResponse message. Does not implicitly {@link google.cloud.websecurityscanner.v1.ListScanConfigsResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.websecurityscanner.v1.ListScanConfigsResponse + * @static + * @param {google.cloud.websecurityscanner.v1.IListScanConfigsResponse} message ListScanConfigsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListScanConfigsResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.scanConfigs != null && message.scanConfigs.length) + for (var i = 0; i < message.scanConfigs.length; ++i) + $root.google.cloud.websecurityscanner.v1.ScanConfig.encode(message.scanConfigs[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 ListScanConfigsResponse message, length delimited. Does not implicitly {@link google.cloud.websecurityscanner.v1.ListScanConfigsResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.websecurityscanner.v1.ListScanConfigsResponse + * @static + * @param {google.cloud.websecurityscanner.v1.IListScanConfigsResponse} message ListScanConfigsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListScanConfigsResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListScanConfigsResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.websecurityscanner.v1.ListScanConfigsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.websecurityscanner.v1.ListScanConfigsResponse} ListScanConfigsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListScanConfigsResponse.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.websecurityscanner.v1.ListScanConfigsResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.scanConfigs && message.scanConfigs.length)) + message.scanConfigs = []; + message.scanConfigs.push($root.google.cloud.websecurityscanner.v1.ScanConfig.decode(reader, reader.uint32())); + break; + } + case 2: { + message.nextPageToken = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListScanConfigsResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.websecurityscanner.v1.ListScanConfigsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.websecurityscanner.v1.ListScanConfigsResponse} ListScanConfigsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListScanConfigsResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListScanConfigsResponse message. + * @function verify + * @memberof google.cloud.websecurityscanner.v1.ListScanConfigsResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListScanConfigsResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.scanConfigs != null && message.hasOwnProperty("scanConfigs")) { + if (!Array.isArray(message.scanConfigs)) + return "scanConfigs: array expected"; + for (var i = 0; i < message.scanConfigs.length; ++i) { + var error = $root.google.cloud.websecurityscanner.v1.ScanConfig.verify(message.scanConfigs[i]); + if (error) + return "scanConfigs." + error; + } + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; + return null; + }; + + /** + * Creates a ListScanConfigsResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.websecurityscanner.v1.ListScanConfigsResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.websecurityscanner.v1.ListScanConfigsResponse} ListScanConfigsResponse + */ + ListScanConfigsResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.websecurityscanner.v1.ListScanConfigsResponse) + return object; + var message = new $root.google.cloud.websecurityscanner.v1.ListScanConfigsResponse(); + if (object.scanConfigs) { + if (!Array.isArray(object.scanConfigs)) + throw TypeError(".google.cloud.websecurityscanner.v1.ListScanConfigsResponse.scanConfigs: array expected"); + message.scanConfigs = []; + for (var i = 0; i < object.scanConfigs.length; ++i) { + if (typeof object.scanConfigs[i] !== "object") + throw TypeError(".google.cloud.websecurityscanner.v1.ListScanConfigsResponse.scanConfigs: object expected"); + message.scanConfigs[i] = $root.google.cloud.websecurityscanner.v1.ScanConfig.fromObject(object.scanConfigs[i]); + } + } + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + return message; + }; + + /** + * Creates a plain object from a ListScanConfigsResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.websecurityscanner.v1.ListScanConfigsResponse + * @static + * @param {google.cloud.websecurityscanner.v1.ListScanConfigsResponse} message ListScanConfigsResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListScanConfigsResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.scanConfigs = []; + if (options.defaults) + object.nextPageToken = ""; + if (message.scanConfigs && message.scanConfigs.length) { + object.scanConfigs = []; + for (var j = 0; j < message.scanConfigs.length; ++j) + object.scanConfigs[j] = $root.google.cloud.websecurityscanner.v1.ScanConfig.toObject(message.scanConfigs[j], options); + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + object.nextPageToken = message.nextPageToken; + return object; + }; + + /** + * Converts this ListScanConfigsResponse to JSON. + * @function toJSON + * @memberof google.cloud.websecurityscanner.v1.ListScanConfigsResponse + * @instance + * @returns {Object.} JSON object + */ + ListScanConfigsResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListScanConfigsResponse + * @function getTypeUrl + * @memberof google.cloud.websecurityscanner.v1.ListScanConfigsResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListScanConfigsResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.websecurityscanner.v1.ListScanConfigsResponse"; + }; + + return ListScanConfigsResponse; + })(); + + v1.StartScanRunRequest = (function() { + + /** + * Properties of a StartScanRunRequest. + * @memberof google.cloud.websecurityscanner.v1 + * @interface IStartScanRunRequest + * @property {string|null} [name] StartScanRunRequest name + */ + + /** + * Constructs a new StartScanRunRequest. + * @memberof google.cloud.websecurityscanner.v1 + * @classdesc Represents a StartScanRunRequest. + * @implements IStartScanRunRequest + * @constructor + * @param {google.cloud.websecurityscanner.v1.IStartScanRunRequest=} [properties] Properties to set + */ + function StartScanRunRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * StartScanRunRequest name. + * @member {string} name + * @memberof google.cloud.websecurityscanner.v1.StartScanRunRequest + * @instance + */ + StartScanRunRequest.prototype.name = ""; + + /** + * Creates a new StartScanRunRequest instance using the specified properties. + * @function create + * @memberof google.cloud.websecurityscanner.v1.StartScanRunRequest + * @static + * @param {google.cloud.websecurityscanner.v1.IStartScanRunRequest=} [properties] Properties to set + * @returns {google.cloud.websecurityscanner.v1.StartScanRunRequest} StartScanRunRequest instance + */ + StartScanRunRequest.create = function create(properties) { + return new StartScanRunRequest(properties); + }; + + /** + * Encodes the specified StartScanRunRequest message. Does not implicitly {@link google.cloud.websecurityscanner.v1.StartScanRunRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.websecurityscanner.v1.StartScanRunRequest + * @static + * @param {google.cloud.websecurityscanner.v1.IStartScanRunRequest} message StartScanRunRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + StartScanRunRequest.encode = function encode(message, writer) { + 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 StartScanRunRequest message, length delimited. Does not implicitly {@link google.cloud.websecurityscanner.v1.StartScanRunRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.websecurityscanner.v1.StartScanRunRequest + * @static + * @param {google.cloud.websecurityscanner.v1.IStartScanRunRequest} message StartScanRunRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + StartScanRunRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a StartScanRunRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.websecurityscanner.v1.StartScanRunRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.websecurityscanner.v1.StartScanRunRequest} StartScanRunRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + StartScanRunRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.websecurityscanner.v1.StartScanRunRequest(); + 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 StartScanRunRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.websecurityscanner.v1.StartScanRunRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.websecurityscanner.v1.StartScanRunRequest} StartScanRunRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + StartScanRunRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a StartScanRunRequest message. + * @function verify + * @memberof google.cloud.websecurityscanner.v1.StartScanRunRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + StartScanRunRequest.verify = function verify(message) { + if (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 StartScanRunRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.websecurityscanner.v1.StartScanRunRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.websecurityscanner.v1.StartScanRunRequest} StartScanRunRequest + */ + StartScanRunRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.websecurityscanner.v1.StartScanRunRequest) + return object; + var message = new $root.google.cloud.websecurityscanner.v1.StartScanRunRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a StartScanRunRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.websecurityscanner.v1.StartScanRunRequest + * @static + * @param {google.cloud.websecurityscanner.v1.StartScanRunRequest} message StartScanRunRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + StartScanRunRequest.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 StartScanRunRequest to JSON. + * @function toJSON + * @memberof google.cloud.websecurityscanner.v1.StartScanRunRequest + * @instance + * @returns {Object.} JSON object + */ + StartScanRunRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for StartScanRunRequest + * @function getTypeUrl + * @memberof google.cloud.websecurityscanner.v1.StartScanRunRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + StartScanRunRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.websecurityscanner.v1.StartScanRunRequest"; + }; + + return StartScanRunRequest; + })(); + + v1.GetScanRunRequest = (function() { + + /** + * Properties of a GetScanRunRequest. + * @memberof google.cloud.websecurityscanner.v1 + * @interface IGetScanRunRequest + * @property {string|null} [name] GetScanRunRequest name + */ + + /** + * Constructs a new GetScanRunRequest. + * @memberof google.cloud.websecurityscanner.v1 + * @classdesc Represents a GetScanRunRequest. + * @implements IGetScanRunRequest + * @constructor + * @param {google.cloud.websecurityscanner.v1.IGetScanRunRequest=} [properties] Properties to set + */ + function GetScanRunRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetScanRunRequest name. + * @member {string} name + * @memberof google.cloud.websecurityscanner.v1.GetScanRunRequest + * @instance + */ + GetScanRunRequest.prototype.name = ""; + + /** + * Creates a new GetScanRunRequest instance using the specified properties. + * @function create + * @memberof google.cloud.websecurityscanner.v1.GetScanRunRequest + * @static + * @param {google.cloud.websecurityscanner.v1.IGetScanRunRequest=} [properties] Properties to set + * @returns {google.cloud.websecurityscanner.v1.GetScanRunRequest} GetScanRunRequest instance + */ + GetScanRunRequest.create = function create(properties) { + return new GetScanRunRequest(properties); + }; + + /** + * Encodes the specified GetScanRunRequest message. Does not implicitly {@link google.cloud.websecurityscanner.v1.GetScanRunRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.websecurityscanner.v1.GetScanRunRequest + * @static + * @param {google.cloud.websecurityscanner.v1.IGetScanRunRequest} message GetScanRunRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetScanRunRequest.encode = function encode(message, writer) { + 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 GetScanRunRequest message, length delimited. Does not implicitly {@link google.cloud.websecurityscanner.v1.GetScanRunRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.websecurityscanner.v1.GetScanRunRequest + * @static + * @param {google.cloud.websecurityscanner.v1.IGetScanRunRequest} message GetScanRunRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetScanRunRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetScanRunRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.websecurityscanner.v1.GetScanRunRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.websecurityscanner.v1.GetScanRunRequest} GetScanRunRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetScanRunRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.websecurityscanner.v1.GetScanRunRequest(); + 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 GetScanRunRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.websecurityscanner.v1.GetScanRunRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.websecurityscanner.v1.GetScanRunRequest} GetScanRunRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetScanRunRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetScanRunRequest message. + * @function verify + * @memberof google.cloud.websecurityscanner.v1.GetScanRunRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetScanRunRequest.verify = function verify(message) { + if (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 GetScanRunRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.websecurityscanner.v1.GetScanRunRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.websecurityscanner.v1.GetScanRunRequest} GetScanRunRequest + */ + GetScanRunRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.websecurityscanner.v1.GetScanRunRequest) + return object; + var message = new $root.google.cloud.websecurityscanner.v1.GetScanRunRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a GetScanRunRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.websecurityscanner.v1.GetScanRunRequest + * @static + * @param {google.cloud.websecurityscanner.v1.GetScanRunRequest} message GetScanRunRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetScanRunRequest.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 GetScanRunRequest to JSON. + * @function toJSON + * @memberof google.cloud.websecurityscanner.v1.GetScanRunRequest + * @instance + * @returns {Object.} JSON object + */ + GetScanRunRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GetScanRunRequest + * @function getTypeUrl + * @memberof google.cloud.websecurityscanner.v1.GetScanRunRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GetScanRunRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.websecurityscanner.v1.GetScanRunRequest"; + }; + + return GetScanRunRequest; + })(); + + v1.ListScanRunsRequest = (function() { + + /** + * Properties of a ListScanRunsRequest. + * @memberof google.cloud.websecurityscanner.v1 + * @interface IListScanRunsRequest + * @property {string|null} [parent] ListScanRunsRequest parent + * @property {string|null} [pageToken] ListScanRunsRequest pageToken + * @property {number|null} [pageSize] ListScanRunsRequest pageSize + */ + + /** + * Constructs a new ListScanRunsRequest. + * @memberof google.cloud.websecurityscanner.v1 + * @classdesc Represents a ListScanRunsRequest. + * @implements IListScanRunsRequest + * @constructor + * @param {google.cloud.websecurityscanner.v1.IListScanRunsRequest=} [properties] Properties to set + */ + function ListScanRunsRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListScanRunsRequest parent. + * @member {string} parent + * @memberof google.cloud.websecurityscanner.v1.ListScanRunsRequest + * @instance + */ + ListScanRunsRequest.prototype.parent = ""; + + /** + * ListScanRunsRequest pageToken. + * @member {string} pageToken + * @memberof google.cloud.websecurityscanner.v1.ListScanRunsRequest + * @instance + */ + ListScanRunsRequest.prototype.pageToken = ""; + + /** + * ListScanRunsRequest pageSize. + * @member {number} pageSize + * @memberof google.cloud.websecurityscanner.v1.ListScanRunsRequest + * @instance + */ + ListScanRunsRequest.prototype.pageSize = 0; + + /** + * Creates a new ListScanRunsRequest instance using the specified properties. + * @function create + * @memberof google.cloud.websecurityscanner.v1.ListScanRunsRequest + * @static + * @param {google.cloud.websecurityscanner.v1.IListScanRunsRequest=} [properties] Properties to set + * @returns {google.cloud.websecurityscanner.v1.ListScanRunsRequest} ListScanRunsRequest instance + */ + ListScanRunsRequest.create = function create(properties) { + return new ListScanRunsRequest(properties); + }; + + /** + * Encodes the specified ListScanRunsRequest message. Does not implicitly {@link google.cloud.websecurityscanner.v1.ListScanRunsRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.websecurityscanner.v1.ListScanRunsRequest + * @static + * @param {google.cloud.websecurityscanner.v1.IListScanRunsRequest} message ListScanRunsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListScanRunsRequest.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.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.pageToken); + if (message.pageSize != null && Object.hasOwnProperty.call(message, "pageSize")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.pageSize); + return writer; + }; + + /** + * Encodes the specified ListScanRunsRequest message, length delimited. Does not implicitly {@link google.cloud.websecurityscanner.v1.ListScanRunsRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.websecurityscanner.v1.ListScanRunsRequest + * @static + * @param {google.cloud.websecurityscanner.v1.IListScanRunsRequest} message ListScanRunsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListScanRunsRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListScanRunsRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.websecurityscanner.v1.ListScanRunsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.websecurityscanner.v1.ListScanRunsRequest} ListScanRunsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListScanRunsRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.websecurityscanner.v1.ListScanRunsRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + message.pageToken = reader.string(); + break; + } + case 3: { + message.pageSize = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListScanRunsRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.websecurityscanner.v1.ListScanRunsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.websecurityscanner.v1.ListScanRunsRequest} ListScanRunsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListScanRunsRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListScanRunsRequest message. + * @function verify + * @memberof google.cloud.websecurityscanner.v1.ListScanRunsRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListScanRunsRequest.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.pageToken != null && message.hasOwnProperty("pageToken")) + if (!$util.isString(message.pageToken)) + return "pageToken: string expected"; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + if (!$util.isInteger(message.pageSize)) + return "pageSize: integer expected"; + return null; + }; + + /** + * Creates a ListScanRunsRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.websecurityscanner.v1.ListScanRunsRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.websecurityscanner.v1.ListScanRunsRequest} ListScanRunsRequest + */ + ListScanRunsRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.websecurityscanner.v1.ListScanRunsRequest) + return object; + var message = new $root.google.cloud.websecurityscanner.v1.ListScanRunsRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.pageToken != null) + message.pageToken = String(object.pageToken); + if (object.pageSize != null) + message.pageSize = object.pageSize | 0; + return message; + }; + + /** + * Creates a plain object from a ListScanRunsRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.websecurityscanner.v1.ListScanRunsRequest + * @static + * @param {google.cloud.websecurityscanner.v1.ListScanRunsRequest} message ListScanRunsRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListScanRunsRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.pageToken = ""; + object.pageSize = 0; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + object.pageToken = message.pageToken; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + object.pageSize = message.pageSize; + return object; + }; + + /** + * Converts this ListScanRunsRequest to JSON. + * @function toJSON + * @memberof google.cloud.websecurityscanner.v1.ListScanRunsRequest + * @instance + * @returns {Object.} JSON object + */ + ListScanRunsRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListScanRunsRequest + * @function getTypeUrl + * @memberof google.cloud.websecurityscanner.v1.ListScanRunsRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListScanRunsRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.websecurityscanner.v1.ListScanRunsRequest"; + }; + + return ListScanRunsRequest; + })(); + + v1.ListScanRunsResponse = (function() { + + /** + * Properties of a ListScanRunsResponse. + * @memberof google.cloud.websecurityscanner.v1 + * @interface IListScanRunsResponse + * @property {Array.|null} [scanRuns] ListScanRunsResponse scanRuns + * @property {string|null} [nextPageToken] ListScanRunsResponse nextPageToken + */ + + /** + * Constructs a new ListScanRunsResponse. + * @memberof google.cloud.websecurityscanner.v1 + * @classdesc Represents a ListScanRunsResponse. + * @implements IListScanRunsResponse + * @constructor + * @param {google.cloud.websecurityscanner.v1.IListScanRunsResponse=} [properties] Properties to set + */ + function ListScanRunsResponse(properties) { + this.scanRuns = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListScanRunsResponse scanRuns. + * @member {Array.} scanRuns + * @memberof google.cloud.websecurityscanner.v1.ListScanRunsResponse + * @instance + */ + ListScanRunsResponse.prototype.scanRuns = $util.emptyArray; + + /** + * ListScanRunsResponse nextPageToken. + * @member {string} nextPageToken + * @memberof google.cloud.websecurityscanner.v1.ListScanRunsResponse + * @instance + */ + ListScanRunsResponse.prototype.nextPageToken = ""; + + /** + * Creates a new ListScanRunsResponse instance using the specified properties. + * @function create + * @memberof google.cloud.websecurityscanner.v1.ListScanRunsResponse + * @static + * @param {google.cloud.websecurityscanner.v1.IListScanRunsResponse=} [properties] Properties to set + * @returns {google.cloud.websecurityscanner.v1.ListScanRunsResponse} ListScanRunsResponse instance + */ + ListScanRunsResponse.create = function create(properties) { + return new ListScanRunsResponse(properties); + }; + + /** + * Encodes the specified ListScanRunsResponse message. Does not implicitly {@link google.cloud.websecurityscanner.v1.ListScanRunsResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.websecurityscanner.v1.ListScanRunsResponse + * @static + * @param {google.cloud.websecurityscanner.v1.IListScanRunsResponse} message ListScanRunsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListScanRunsResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.scanRuns != null && message.scanRuns.length) + for (var i = 0; i < message.scanRuns.length; ++i) + $root.google.cloud.websecurityscanner.v1.ScanRun.encode(message.scanRuns[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 ListScanRunsResponse message, length delimited. Does not implicitly {@link google.cloud.websecurityscanner.v1.ListScanRunsResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.websecurityscanner.v1.ListScanRunsResponse + * @static + * @param {google.cloud.websecurityscanner.v1.IListScanRunsResponse} message ListScanRunsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListScanRunsResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListScanRunsResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.websecurityscanner.v1.ListScanRunsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.websecurityscanner.v1.ListScanRunsResponse} ListScanRunsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListScanRunsResponse.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.websecurityscanner.v1.ListScanRunsResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.scanRuns && message.scanRuns.length)) + message.scanRuns = []; + message.scanRuns.push($root.google.cloud.websecurityscanner.v1.ScanRun.decode(reader, reader.uint32())); + break; + } + case 2: { + message.nextPageToken = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListScanRunsResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.websecurityscanner.v1.ListScanRunsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.websecurityscanner.v1.ListScanRunsResponse} ListScanRunsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListScanRunsResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListScanRunsResponse message. + * @function verify + * @memberof google.cloud.websecurityscanner.v1.ListScanRunsResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListScanRunsResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.scanRuns != null && message.hasOwnProperty("scanRuns")) { + if (!Array.isArray(message.scanRuns)) + return "scanRuns: array expected"; + for (var i = 0; i < message.scanRuns.length; ++i) { + var error = $root.google.cloud.websecurityscanner.v1.ScanRun.verify(message.scanRuns[i]); + if (error) + return "scanRuns." + error; + } + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; + return null; + }; + + /** + * Creates a ListScanRunsResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.websecurityscanner.v1.ListScanRunsResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.websecurityscanner.v1.ListScanRunsResponse} ListScanRunsResponse + */ + ListScanRunsResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.websecurityscanner.v1.ListScanRunsResponse) + return object; + var message = new $root.google.cloud.websecurityscanner.v1.ListScanRunsResponse(); + if (object.scanRuns) { + if (!Array.isArray(object.scanRuns)) + throw TypeError(".google.cloud.websecurityscanner.v1.ListScanRunsResponse.scanRuns: array expected"); + message.scanRuns = []; + for (var i = 0; i < object.scanRuns.length; ++i) { + if (typeof object.scanRuns[i] !== "object") + throw TypeError(".google.cloud.websecurityscanner.v1.ListScanRunsResponse.scanRuns: object expected"); + message.scanRuns[i] = $root.google.cloud.websecurityscanner.v1.ScanRun.fromObject(object.scanRuns[i]); + } + } + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + return message; + }; + + /** + * Creates a plain object from a ListScanRunsResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.websecurityscanner.v1.ListScanRunsResponse + * @static + * @param {google.cloud.websecurityscanner.v1.ListScanRunsResponse} message ListScanRunsResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListScanRunsResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.scanRuns = []; + if (options.defaults) + object.nextPageToken = ""; + if (message.scanRuns && message.scanRuns.length) { + object.scanRuns = []; + for (var j = 0; j < message.scanRuns.length; ++j) + object.scanRuns[j] = $root.google.cloud.websecurityscanner.v1.ScanRun.toObject(message.scanRuns[j], options); + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + object.nextPageToken = message.nextPageToken; + return object; + }; + + /** + * Converts this ListScanRunsResponse to JSON. + * @function toJSON + * @memberof google.cloud.websecurityscanner.v1.ListScanRunsResponse + * @instance + * @returns {Object.} JSON object + */ + ListScanRunsResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListScanRunsResponse + * @function getTypeUrl + * @memberof google.cloud.websecurityscanner.v1.ListScanRunsResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListScanRunsResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.websecurityscanner.v1.ListScanRunsResponse"; + }; + + return ListScanRunsResponse; + })(); + + v1.StopScanRunRequest = (function() { + + /** + * Properties of a StopScanRunRequest. + * @memberof google.cloud.websecurityscanner.v1 + * @interface IStopScanRunRequest + * @property {string|null} [name] StopScanRunRequest name + */ + + /** + * Constructs a new StopScanRunRequest. + * @memberof google.cloud.websecurityscanner.v1 + * @classdesc Represents a StopScanRunRequest. + * @implements IStopScanRunRequest + * @constructor + * @param {google.cloud.websecurityscanner.v1.IStopScanRunRequest=} [properties] Properties to set + */ + function StopScanRunRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * StopScanRunRequest name. + * @member {string} name + * @memberof google.cloud.websecurityscanner.v1.StopScanRunRequest + * @instance + */ + StopScanRunRequest.prototype.name = ""; + + /** + * Creates a new StopScanRunRequest instance using the specified properties. + * @function create + * @memberof google.cloud.websecurityscanner.v1.StopScanRunRequest + * @static + * @param {google.cloud.websecurityscanner.v1.IStopScanRunRequest=} [properties] Properties to set + * @returns {google.cloud.websecurityscanner.v1.StopScanRunRequest} StopScanRunRequest instance + */ + StopScanRunRequest.create = function create(properties) { + return new StopScanRunRequest(properties); + }; + + /** + * Encodes the specified StopScanRunRequest message. Does not implicitly {@link google.cloud.websecurityscanner.v1.StopScanRunRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.websecurityscanner.v1.StopScanRunRequest + * @static + * @param {google.cloud.websecurityscanner.v1.IStopScanRunRequest} message StopScanRunRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + StopScanRunRequest.encode = function encode(message, writer) { + 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 StopScanRunRequest message, length delimited. Does not implicitly {@link google.cloud.websecurityscanner.v1.StopScanRunRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.websecurityscanner.v1.StopScanRunRequest + * @static + * @param {google.cloud.websecurityscanner.v1.IStopScanRunRequest} message StopScanRunRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + StopScanRunRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a StopScanRunRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.websecurityscanner.v1.StopScanRunRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.websecurityscanner.v1.StopScanRunRequest} StopScanRunRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + StopScanRunRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.websecurityscanner.v1.StopScanRunRequest(); + 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 StopScanRunRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.websecurityscanner.v1.StopScanRunRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.websecurityscanner.v1.StopScanRunRequest} StopScanRunRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + StopScanRunRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a StopScanRunRequest message. + * @function verify + * @memberof google.cloud.websecurityscanner.v1.StopScanRunRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + StopScanRunRequest.verify = function verify(message) { + if (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 StopScanRunRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.websecurityscanner.v1.StopScanRunRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.websecurityscanner.v1.StopScanRunRequest} StopScanRunRequest + */ + StopScanRunRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.websecurityscanner.v1.StopScanRunRequest) + return object; + var message = new $root.google.cloud.websecurityscanner.v1.StopScanRunRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a StopScanRunRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.websecurityscanner.v1.StopScanRunRequest + * @static + * @param {google.cloud.websecurityscanner.v1.StopScanRunRequest} message StopScanRunRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + StopScanRunRequest.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 StopScanRunRequest to JSON. + * @function toJSON + * @memberof google.cloud.websecurityscanner.v1.StopScanRunRequest + * @instance + * @returns {Object.} JSON object + */ + StopScanRunRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for StopScanRunRequest + * @function getTypeUrl + * @memberof google.cloud.websecurityscanner.v1.StopScanRunRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + StopScanRunRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.websecurityscanner.v1.StopScanRunRequest"; + }; + + return StopScanRunRequest; + })(); + + v1.ListCrawledUrlsRequest = (function() { + + /** + * Properties of a ListCrawledUrlsRequest. + * @memberof google.cloud.websecurityscanner.v1 + * @interface IListCrawledUrlsRequest + * @property {string|null} [parent] ListCrawledUrlsRequest parent + * @property {string|null} [pageToken] ListCrawledUrlsRequest pageToken + * @property {number|null} [pageSize] ListCrawledUrlsRequest pageSize + */ + + /** + * Constructs a new ListCrawledUrlsRequest. + * @memberof google.cloud.websecurityscanner.v1 + * @classdesc Represents a ListCrawledUrlsRequest. + * @implements IListCrawledUrlsRequest + * @constructor + * @param {google.cloud.websecurityscanner.v1.IListCrawledUrlsRequest=} [properties] Properties to set + */ + function ListCrawledUrlsRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListCrawledUrlsRequest parent. + * @member {string} parent + * @memberof google.cloud.websecurityscanner.v1.ListCrawledUrlsRequest + * @instance + */ + ListCrawledUrlsRequest.prototype.parent = ""; + + /** + * ListCrawledUrlsRequest pageToken. + * @member {string} pageToken + * @memberof google.cloud.websecurityscanner.v1.ListCrawledUrlsRequest + * @instance + */ + ListCrawledUrlsRequest.prototype.pageToken = ""; + + /** + * ListCrawledUrlsRequest pageSize. + * @member {number} pageSize + * @memberof google.cloud.websecurityscanner.v1.ListCrawledUrlsRequest + * @instance + */ + ListCrawledUrlsRequest.prototype.pageSize = 0; + + /** + * Creates a new ListCrawledUrlsRequest instance using the specified properties. + * @function create + * @memberof google.cloud.websecurityscanner.v1.ListCrawledUrlsRequest + * @static + * @param {google.cloud.websecurityscanner.v1.IListCrawledUrlsRequest=} [properties] Properties to set + * @returns {google.cloud.websecurityscanner.v1.ListCrawledUrlsRequest} ListCrawledUrlsRequest instance + */ + ListCrawledUrlsRequest.create = function create(properties) { + return new ListCrawledUrlsRequest(properties); + }; + + /** + * Encodes the specified ListCrawledUrlsRequest message. Does not implicitly {@link google.cloud.websecurityscanner.v1.ListCrawledUrlsRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.websecurityscanner.v1.ListCrawledUrlsRequest + * @static + * @param {google.cloud.websecurityscanner.v1.IListCrawledUrlsRequest} message ListCrawledUrlsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListCrawledUrlsRequest.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.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.pageToken); + if (message.pageSize != null && Object.hasOwnProperty.call(message, "pageSize")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.pageSize); + return writer; + }; + + /** + * Encodes the specified ListCrawledUrlsRequest message, length delimited. Does not implicitly {@link google.cloud.websecurityscanner.v1.ListCrawledUrlsRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.websecurityscanner.v1.ListCrawledUrlsRequest + * @static + * @param {google.cloud.websecurityscanner.v1.IListCrawledUrlsRequest} message ListCrawledUrlsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListCrawledUrlsRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListCrawledUrlsRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.websecurityscanner.v1.ListCrawledUrlsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.websecurityscanner.v1.ListCrawledUrlsRequest} ListCrawledUrlsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListCrawledUrlsRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.websecurityscanner.v1.ListCrawledUrlsRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + message.pageToken = reader.string(); + break; + } + case 3: { + message.pageSize = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListCrawledUrlsRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.websecurityscanner.v1.ListCrawledUrlsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.websecurityscanner.v1.ListCrawledUrlsRequest} ListCrawledUrlsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListCrawledUrlsRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListCrawledUrlsRequest message. + * @function verify + * @memberof google.cloud.websecurityscanner.v1.ListCrawledUrlsRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListCrawledUrlsRequest.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.pageToken != null && message.hasOwnProperty("pageToken")) + if (!$util.isString(message.pageToken)) + return "pageToken: string expected"; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + if (!$util.isInteger(message.pageSize)) + return "pageSize: integer expected"; + return null; + }; + + /** + * Creates a ListCrawledUrlsRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.websecurityscanner.v1.ListCrawledUrlsRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.websecurityscanner.v1.ListCrawledUrlsRequest} ListCrawledUrlsRequest + */ + ListCrawledUrlsRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.websecurityscanner.v1.ListCrawledUrlsRequest) + return object; + var message = new $root.google.cloud.websecurityscanner.v1.ListCrawledUrlsRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.pageToken != null) + message.pageToken = String(object.pageToken); + if (object.pageSize != null) + message.pageSize = object.pageSize | 0; + return message; + }; + + /** + * Creates a plain object from a ListCrawledUrlsRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.websecurityscanner.v1.ListCrawledUrlsRequest + * @static + * @param {google.cloud.websecurityscanner.v1.ListCrawledUrlsRequest} message ListCrawledUrlsRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListCrawledUrlsRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.pageToken = ""; + object.pageSize = 0; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + object.pageToken = message.pageToken; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + object.pageSize = message.pageSize; + return object; + }; + + /** + * Converts this ListCrawledUrlsRequest to JSON. + * @function toJSON + * @memberof google.cloud.websecurityscanner.v1.ListCrawledUrlsRequest + * @instance + * @returns {Object.} JSON object + */ + ListCrawledUrlsRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListCrawledUrlsRequest + * @function getTypeUrl + * @memberof google.cloud.websecurityscanner.v1.ListCrawledUrlsRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListCrawledUrlsRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.websecurityscanner.v1.ListCrawledUrlsRequest"; + }; + + return ListCrawledUrlsRequest; + })(); + + v1.ListCrawledUrlsResponse = (function() { + + /** + * Properties of a ListCrawledUrlsResponse. + * @memberof google.cloud.websecurityscanner.v1 + * @interface IListCrawledUrlsResponse + * @property {Array.|null} [crawledUrls] ListCrawledUrlsResponse crawledUrls + * @property {string|null} [nextPageToken] ListCrawledUrlsResponse nextPageToken + */ + + /** + * Constructs a new ListCrawledUrlsResponse. + * @memberof google.cloud.websecurityscanner.v1 + * @classdesc Represents a ListCrawledUrlsResponse. + * @implements IListCrawledUrlsResponse + * @constructor + * @param {google.cloud.websecurityscanner.v1.IListCrawledUrlsResponse=} [properties] Properties to set + */ + function ListCrawledUrlsResponse(properties) { + this.crawledUrls = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListCrawledUrlsResponse crawledUrls. + * @member {Array.} crawledUrls + * @memberof google.cloud.websecurityscanner.v1.ListCrawledUrlsResponse + * @instance + */ + ListCrawledUrlsResponse.prototype.crawledUrls = $util.emptyArray; + + /** + * ListCrawledUrlsResponse nextPageToken. + * @member {string} nextPageToken + * @memberof google.cloud.websecurityscanner.v1.ListCrawledUrlsResponse + * @instance + */ + ListCrawledUrlsResponse.prototype.nextPageToken = ""; + + /** + * Creates a new ListCrawledUrlsResponse instance using the specified properties. + * @function create + * @memberof google.cloud.websecurityscanner.v1.ListCrawledUrlsResponse + * @static + * @param {google.cloud.websecurityscanner.v1.IListCrawledUrlsResponse=} [properties] Properties to set + * @returns {google.cloud.websecurityscanner.v1.ListCrawledUrlsResponse} ListCrawledUrlsResponse instance + */ + ListCrawledUrlsResponse.create = function create(properties) { + return new ListCrawledUrlsResponse(properties); + }; + + /** + * Encodes the specified ListCrawledUrlsResponse message. Does not implicitly {@link google.cloud.websecurityscanner.v1.ListCrawledUrlsResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.websecurityscanner.v1.ListCrawledUrlsResponse + * @static + * @param {google.cloud.websecurityscanner.v1.IListCrawledUrlsResponse} message ListCrawledUrlsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListCrawledUrlsResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.crawledUrls != null && message.crawledUrls.length) + for (var i = 0; i < message.crawledUrls.length; ++i) + $root.google.cloud.websecurityscanner.v1.CrawledUrl.encode(message.crawledUrls[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 ListCrawledUrlsResponse message, length delimited. Does not implicitly {@link google.cloud.websecurityscanner.v1.ListCrawledUrlsResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.websecurityscanner.v1.ListCrawledUrlsResponse + * @static + * @param {google.cloud.websecurityscanner.v1.IListCrawledUrlsResponse} message ListCrawledUrlsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListCrawledUrlsResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListCrawledUrlsResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.websecurityscanner.v1.ListCrawledUrlsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.websecurityscanner.v1.ListCrawledUrlsResponse} ListCrawledUrlsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListCrawledUrlsResponse.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.websecurityscanner.v1.ListCrawledUrlsResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.crawledUrls && message.crawledUrls.length)) + message.crawledUrls = []; + message.crawledUrls.push($root.google.cloud.websecurityscanner.v1.CrawledUrl.decode(reader, reader.uint32())); + break; + } + case 2: { + message.nextPageToken = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListCrawledUrlsResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.websecurityscanner.v1.ListCrawledUrlsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.websecurityscanner.v1.ListCrawledUrlsResponse} ListCrawledUrlsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListCrawledUrlsResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListCrawledUrlsResponse message. + * @function verify + * @memberof google.cloud.websecurityscanner.v1.ListCrawledUrlsResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListCrawledUrlsResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.crawledUrls != null && message.hasOwnProperty("crawledUrls")) { + if (!Array.isArray(message.crawledUrls)) + return "crawledUrls: array expected"; + for (var i = 0; i < message.crawledUrls.length; ++i) { + var error = $root.google.cloud.websecurityscanner.v1.CrawledUrl.verify(message.crawledUrls[i]); + if (error) + return "crawledUrls." + error; + } + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; + return null; + }; + + /** + * Creates a ListCrawledUrlsResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.websecurityscanner.v1.ListCrawledUrlsResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.websecurityscanner.v1.ListCrawledUrlsResponse} ListCrawledUrlsResponse + */ + ListCrawledUrlsResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.websecurityscanner.v1.ListCrawledUrlsResponse) + return object; + var message = new $root.google.cloud.websecurityscanner.v1.ListCrawledUrlsResponse(); + if (object.crawledUrls) { + if (!Array.isArray(object.crawledUrls)) + throw TypeError(".google.cloud.websecurityscanner.v1.ListCrawledUrlsResponse.crawledUrls: array expected"); + message.crawledUrls = []; + for (var i = 0; i < object.crawledUrls.length; ++i) { + if (typeof object.crawledUrls[i] !== "object") + throw TypeError(".google.cloud.websecurityscanner.v1.ListCrawledUrlsResponse.crawledUrls: object expected"); + message.crawledUrls[i] = $root.google.cloud.websecurityscanner.v1.CrawledUrl.fromObject(object.crawledUrls[i]); + } + } + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + return message; + }; + + /** + * Creates a plain object from a ListCrawledUrlsResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.websecurityscanner.v1.ListCrawledUrlsResponse + * @static + * @param {google.cloud.websecurityscanner.v1.ListCrawledUrlsResponse} message ListCrawledUrlsResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListCrawledUrlsResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.crawledUrls = []; + if (options.defaults) + object.nextPageToken = ""; + if (message.crawledUrls && message.crawledUrls.length) { + object.crawledUrls = []; + for (var j = 0; j < message.crawledUrls.length; ++j) + object.crawledUrls[j] = $root.google.cloud.websecurityscanner.v1.CrawledUrl.toObject(message.crawledUrls[j], options); + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + object.nextPageToken = message.nextPageToken; + return object; + }; + + /** + * Converts this ListCrawledUrlsResponse to JSON. + * @function toJSON + * @memberof google.cloud.websecurityscanner.v1.ListCrawledUrlsResponse + * @instance + * @returns {Object.} JSON object + */ + ListCrawledUrlsResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListCrawledUrlsResponse + * @function getTypeUrl + * @memberof google.cloud.websecurityscanner.v1.ListCrawledUrlsResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListCrawledUrlsResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.websecurityscanner.v1.ListCrawledUrlsResponse"; + }; + + return ListCrawledUrlsResponse; + })(); + + v1.GetFindingRequest = (function() { + + /** + * Properties of a GetFindingRequest. + * @memberof google.cloud.websecurityscanner.v1 + * @interface IGetFindingRequest + * @property {string|null} [name] GetFindingRequest name + */ + + /** + * Constructs a new GetFindingRequest. + * @memberof google.cloud.websecurityscanner.v1 + * @classdesc Represents a GetFindingRequest. + * @implements IGetFindingRequest + * @constructor + * @param {google.cloud.websecurityscanner.v1.IGetFindingRequest=} [properties] Properties to set + */ + function GetFindingRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetFindingRequest name. + * @member {string} name + * @memberof google.cloud.websecurityscanner.v1.GetFindingRequest + * @instance + */ + GetFindingRequest.prototype.name = ""; + + /** + * Creates a new GetFindingRequest instance using the specified properties. + * @function create + * @memberof google.cloud.websecurityscanner.v1.GetFindingRequest + * @static + * @param {google.cloud.websecurityscanner.v1.IGetFindingRequest=} [properties] Properties to set + * @returns {google.cloud.websecurityscanner.v1.GetFindingRequest} GetFindingRequest instance + */ + GetFindingRequest.create = function create(properties) { + return new GetFindingRequest(properties); + }; + + /** + * Encodes the specified GetFindingRequest message. Does not implicitly {@link google.cloud.websecurityscanner.v1.GetFindingRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.websecurityscanner.v1.GetFindingRequest + * @static + * @param {google.cloud.websecurityscanner.v1.IGetFindingRequest} message GetFindingRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetFindingRequest.encode = function encode(message, writer) { + 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 GetFindingRequest message, length delimited. Does not implicitly {@link google.cloud.websecurityscanner.v1.GetFindingRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.websecurityscanner.v1.GetFindingRequest + * @static + * @param {google.cloud.websecurityscanner.v1.IGetFindingRequest} message GetFindingRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetFindingRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetFindingRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.websecurityscanner.v1.GetFindingRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.websecurityscanner.v1.GetFindingRequest} GetFindingRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetFindingRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.websecurityscanner.v1.GetFindingRequest(); + 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 GetFindingRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.websecurityscanner.v1.GetFindingRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.websecurityscanner.v1.GetFindingRequest} GetFindingRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetFindingRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetFindingRequest message. + * @function verify + * @memberof google.cloud.websecurityscanner.v1.GetFindingRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetFindingRequest.verify = function verify(message) { + if (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 GetFindingRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.websecurityscanner.v1.GetFindingRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.websecurityscanner.v1.GetFindingRequest} GetFindingRequest + */ + GetFindingRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.websecurityscanner.v1.GetFindingRequest) + return object; + var message = new $root.google.cloud.websecurityscanner.v1.GetFindingRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a GetFindingRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.websecurityscanner.v1.GetFindingRequest + * @static + * @param {google.cloud.websecurityscanner.v1.GetFindingRequest} message GetFindingRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetFindingRequest.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 GetFindingRequest to JSON. + * @function toJSON + * @memberof google.cloud.websecurityscanner.v1.GetFindingRequest + * @instance + * @returns {Object.} JSON object + */ + GetFindingRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GetFindingRequest + * @function getTypeUrl + * @memberof google.cloud.websecurityscanner.v1.GetFindingRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GetFindingRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.websecurityscanner.v1.GetFindingRequest"; + }; + + return GetFindingRequest; + })(); + + v1.ListFindingsRequest = (function() { + + /** + * Properties of a ListFindingsRequest. + * @memberof google.cloud.websecurityscanner.v1 + * @interface IListFindingsRequest + * @property {string|null} [parent] ListFindingsRequest parent + * @property {string|null} [filter] ListFindingsRequest filter + * @property {string|null} [pageToken] ListFindingsRequest pageToken + * @property {number|null} [pageSize] ListFindingsRequest pageSize + */ + + /** + * Constructs a new ListFindingsRequest. + * @memberof google.cloud.websecurityscanner.v1 + * @classdesc Represents a ListFindingsRequest. + * @implements IListFindingsRequest + * @constructor + * @param {google.cloud.websecurityscanner.v1.IListFindingsRequest=} [properties] Properties to set + */ + function ListFindingsRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListFindingsRequest parent. + * @member {string} parent + * @memberof google.cloud.websecurityscanner.v1.ListFindingsRequest + * @instance + */ + ListFindingsRequest.prototype.parent = ""; + + /** + * ListFindingsRequest filter. + * @member {string} filter + * @memberof google.cloud.websecurityscanner.v1.ListFindingsRequest + * @instance + */ + ListFindingsRequest.prototype.filter = ""; + + /** + * ListFindingsRequest pageToken. + * @member {string} pageToken + * @memberof google.cloud.websecurityscanner.v1.ListFindingsRequest + * @instance + */ + ListFindingsRequest.prototype.pageToken = ""; + + /** + * ListFindingsRequest pageSize. + * @member {number} pageSize + * @memberof google.cloud.websecurityscanner.v1.ListFindingsRequest + * @instance + */ + ListFindingsRequest.prototype.pageSize = 0; + + /** + * Creates a new ListFindingsRequest instance using the specified properties. + * @function create + * @memberof google.cloud.websecurityscanner.v1.ListFindingsRequest + * @static + * @param {google.cloud.websecurityscanner.v1.IListFindingsRequest=} [properties] Properties to set + * @returns {google.cloud.websecurityscanner.v1.ListFindingsRequest} ListFindingsRequest instance + */ + ListFindingsRequest.create = function create(properties) { + return new ListFindingsRequest(properties); + }; + + /** + * Encodes the specified ListFindingsRequest message. Does not implicitly {@link google.cloud.websecurityscanner.v1.ListFindingsRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.websecurityscanner.v1.ListFindingsRequest + * @static + * @param {google.cloud.websecurityscanner.v1.IListFindingsRequest} message ListFindingsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListFindingsRequest.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.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.pageToken); + if (message.pageSize != null && Object.hasOwnProperty.call(message, "pageSize")) + writer.uint32(/* id 4, wireType 0 =*/32).int32(message.pageSize); + return writer; + }; + + /** + * Encodes the specified ListFindingsRequest message, length delimited. Does not implicitly {@link google.cloud.websecurityscanner.v1.ListFindingsRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.websecurityscanner.v1.ListFindingsRequest + * @static + * @param {google.cloud.websecurityscanner.v1.IListFindingsRequest} message ListFindingsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListFindingsRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListFindingsRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.websecurityscanner.v1.ListFindingsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.websecurityscanner.v1.ListFindingsRequest} ListFindingsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListFindingsRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.websecurityscanner.v1.ListFindingsRequest(); + 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.pageToken = reader.string(); + break; + } + case 4: { + message.pageSize = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListFindingsRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.websecurityscanner.v1.ListFindingsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.websecurityscanner.v1.ListFindingsRequest} ListFindingsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListFindingsRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListFindingsRequest message. + * @function verify + * @memberof google.cloud.websecurityscanner.v1.ListFindingsRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListFindingsRequest.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.pageToken != null && message.hasOwnProperty("pageToken")) + if (!$util.isString(message.pageToken)) + return "pageToken: string expected"; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + if (!$util.isInteger(message.pageSize)) + return "pageSize: integer expected"; + return null; + }; + + /** + * Creates a ListFindingsRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.websecurityscanner.v1.ListFindingsRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.websecurityscanner.v1.ListFindingsRequest} ListFindingsRequest + */ + ListFindingsRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.websecurityscanner.v1.ListFindingsRequest) + return object; + var message = new $root.google.cloud.websecurityscanner.v1.ListFindingsRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.filter != null) + message.filter = String(object.filter); + if (object.pageToken != null) + message.pageToken = String(object.pageToken); + if (object.pageSize != null) + message.pageSize = object.pageSize | 0; + return message; + }; + + /** + * Creates a plain object from a ListFindingsRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.websecurityscanner.v1.ListFindingsRequest + * @static + * @param {google.cloud.websecurityscanner.v1.ListFindingsRequest} message ListFindingsRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListFindingsRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.filter = ""; + object.pageToken = ""; + object.pageSize = 0; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.filter != null && message.hasOwnProperty("filter")) + object.filter = message.filter; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + object.pageToken = message.pageToken; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + object.pageSize = message.pageSize; + return object; + }; + + /** + * Converts this ListFindingsRequest to JSON. + * @function toJSON + * @memberof google.cloud.websecurityscanner.v1.ListFindingsRequest + * @instance + * @returns {Object.} JSON object + */ + ListFindingsRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListFindingsRequest + * @function getTypeUrl + * @memberof google.cloud.websecurityscanner.v1.ListFindingsRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListFindingsRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.websecurityscanner.v1.ListFindingsRequest"; + }; + + return ListFindingsRequest; + })(); + + v1.ListFindingsResponse = (function() { + + /** + * Properties of a ListFindingsResponse. + * @memberof google.cloud.websecurityscanner.v1 + * @interface IListFindingsResponse + * @property {Array.|null} [findings] ListFindingsResponse findings + * @property {string|null} [nextPageToken] ListFindingsResponse nextPageToken + */ + + /** + * Constructs a new ListFindingsResponse. + * @memberof google.cloud.websecurityscanner.v1 + * @classdesc Represents a ListFindingsResponse. + * @implements IListFindingsResponse + * @constructor + * @param {google.cloud.websecurityscanner.v1.IListFindingsResponse=} [properties] Properties to set + */ + function ListFindingsResponse(properties) { + this.findings = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListFindingsResponse findings. + * @member {Array.} findings + * @memberof google.cloud.websecurityscanner.v1.ListFindingsResponse + * @instance + */ + ListFindingsResponse.prototype.findings = $util.emptyArray; + + /** + * ListFindingsResponse nextPageToken. + * @member {string} nextPageToken + * @memberof google.cloud.websecurityscanner.v1.ListFindingsResponse + * @instance + */ + ListFindingsResponse.prototype.nextPageToken = ""; + + /** + * Creates a new ListFindingsResponse instance using the specified properties. + * @function create + * @memberof google.cloud.websecurityscanner.v1.ListFindingsResponse + * @static + * @param {google.cloud.websecurityscanner.v1.IListFindingsResponse=} [properties] Properties to set + * @returns {google.cloud.websecurityscanner.v1.ListFindingsResponse} ListFindingsResponse instance + */ + ListFindingsResponse.create = function create(properties) { + return new ListFindingsResponse(properties); + }; + + /** + * Encodes the specified ListFindingsResponse message. Does not implicitly {@link google.cloud.websecurityscanner.v1.ListFindingsResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.websecurityscanner.v1.ListFindingsResponse + * @static + * @param {google.cloud.websecurityscanner.v1.IListFindingsResponse} message ListFindingsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListFindingsResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.findings != null && message.findings.length) + for (var i = 0; i < message.findings.length; ++i) + $root.google.cloud.websecurityscanner.v1.Finding.encode(message.findings[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 ListFindingsResponse message, length delimited. Does not implicitly {@link google.cloud.websecurityscanner.v1.ListFindingsResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.websecurityscanner.v1.ListFindingsResponse + * @static + * @param {google.cloud.websecurityscanner.v1.IListFindingsResponse} message ListFindingsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListFindingsResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListFindingsResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.websecurityscanner.v1.ListFindingsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.websecurityscanner.v1.ListFindingsResponse} ListFindingsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListFindingsResponse.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.websecurityscanner.v1.ListFindingsResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.findings && message.findings.length)) + message.findings = []; + message.findings.push($root.google.cloud.websecurityscanner.v1.Finding.decode(reader, reader.uint32())); + break; + } + case 2: { + message.nextPageToken = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListFindingsResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.websecurityscanner.v1.ListFindingsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.websecurityscanner.v1.ListFindingsResponse} ListFindingsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListFindingsResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListFindingsResponse message. + * @function verify + * @memberof google.cloud.websecurityscanner.v1.ListFindingsResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListFindingsResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.findings != null && message.hasOwnProperty("findings")) { + if (!Array.isArray(message.findings)) + return "findings: array expected"; + for (var i = 0; i < message.findings.length; ++i) { + var error = $root.google.cloud.websecurityscanner.v1.Finding.verify(message.findings[i]); + if (error) + return "findings." + error; + } + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; + return null; + }; + + /** + * Creates a ListFindingsResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.websecurityscanner.v1.ListFindingsResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.websecurityscanner.v1.ListFindingsResponse} ListFindingsResponse + */ + ListFindingsResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.websecurityscanner.v1.ListFindingsResponse) + return object; + var message = new $root.google.cloud.websecurityscanner.v1.ListFindingsResponse(); + if (object.findings) { + if (!Array.isArray(object.findings)) + throw TypeError(".google.cloud.websecurityscanner.v1.ListFindingsResponse.findings: array expected"); + message.findings = []; + for (var i = 0; i < object.findings.length; ++i) { + if (typeof object.findings[i] !== "object") + throw TypeError(".google.cloud.websecurityscanner.v1.ListFindingsResponse.findings: object expected"); + message.findings[i] = $root.google.cloud.websecurityscanner.v1.Finding.fromObject(object.findings[i]); + } + } + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + return message; + }; + + /** + * Creates a plain object from a ListFindingsResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.websecurityscanner.v1.ListFindingsResponse + * @static + * @param {google.cloud.websecurityscanner.v1.ListFindingsResponse} message ListFindingsResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListFindingsResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.findings = []; + if (options.defaults) + object.nextPageToken = ""; + if (message.findings && message.findings.length) { + object.findings = []; + for (var j = 0; j < message.findings.length; ++j) + object.findings[j] = $root.google.cloud.websecurityscanner.v1.Finding.toObject(message.findings[j], options); + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + object.nextPageToken = message.nextPageToken; + return object; + }; + + /** + * Converts this ListFindingsResponse to JSON. + * @function toJSON + * @memberof google.cloud.websecurityscanner.v1.ListFindingsResponse + * @instance + * @returns {Object.} JSON object + */ + ListFindingsResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListFindingsResponse + * @function getTypeUrl + * @memberof google.cloud.websecurityscanner.v1.ListFindingsResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListFindingsResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.websecurityscanner.v1.ListFindingsResponse"; + }; + + return ListFindingsResponse; + })(); + + v1.ListFindingTypeStatsRequest = (function() { + + /** + * Properties of a ListFindingTypeStatsRequest. + * @memberof google.cloud.websecurityscanner.v1 + * @interface IListFindingTypeStatsRequest + * @property {string|null} [parent] ListFindingTypeStatsRequest parent + */ + + /** + * Constructs a new ListFindingTypeStatsRequest. + * @memberof google.cloud.websecurityscanner.v1 + * @classdesc Represents a ListFindingTypeStatsRequest. + * @implements IListFindingTypeStatsRequest + * @constructor + * @param {google.cloud.websecurityscanner.v1.IListFindingTypeStatsRequest=} [properties] Properties to set + */ + function ListFindingTypeStatsRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListFindingTypeStatsRequest parent. + * @member {string} parent + * @memberof google.cloud.websecurityscanner.v1.ListFindingTypeStatsRequest + * @instance + */ + ListFindingTypeStatsRequest.prototype.parent = ""; + + /** + * Creates a new ListFindingTypeStatsRequest instance using the specified properties. + * @function create + * @memberof google.cloud.websecurityscanner.v1.ListFindingTypeStatsRequest + * @static + * @param {google.cloud.websecurityscanner.v1.IListFindingTypeStatsRequest=} [properties] Properties to set + * @returns {google.cloud.websecurityscanner.v1.ListFindingTypeStatsRequest} ListFindingTypeStatsRequest instance + */ + ListFindingTypeStatsRequest.create = function create(properties) { + return new ListFindingTypeStatsRequest(properties); + }; + + /** + * Encodes the specified ListFindingTypeStatsRequest message. Does not implicitly {@link google.cloud.websecurityscanner.v1.ListFindingTypeStatsRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.websecurityscanner.v1.ListFindingTypeStatsRequest + * @static + * @param {google.cloud.websecurityscanner.v1.IListFindingTypeStatsRequest} message ListFindingTypeStatsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListFindingTypeStatsRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); + return writer; + }; + + /** + * Encodes the specified ListFindingTypeStatsRequest message, length delimited. Does not implicitly {@link google.cloud.websecurityscanner.v1.ListFindingTypeStatsRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.websecurityscanner.v1.ListFindingTypeStatsRequest + * @static + * @param {google.cloud.websecurityscanner.v1.IListFindingTypeStatsRequest} message ListFindingTypeStatsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListFindingTypeStatsRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListFindingTypeStatsRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.websecurityscanner.v1.ListFindingTypeStatsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.websecurityscanner.v1.ListFindingTypeStatsRequest} ListFindingTypeStatsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListFindingTypeStatsRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.websecurityscanner.v1.ListFindingTypeStatsRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.parent = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListFindingTypeStatsRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.websecurityscanner.v1.ListFindingTypeStatsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.websecurityscanner.v1.ListFindingTypeStatsRequest} ListFindingTypeStatsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListFindingTypeStatsRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListFindingTypeStatsRequest message. + * @function verify + * @memberof google.cloud.websecurityscanner.v1.ListFindingTypeStatsRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListFindingTypeStatsRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.parent != null && message.hasOwnProperty("parent")) + if (!$util.isString(message.parent)) + return "parent: string expected"; + return null; + }; + + /** + * Creates a ListFindingTypeStatsRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.websecurityscanner.v1.ListFindingTypeStatsRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.websecurityscanner.v1.ListFindingTypeStatsRequest} ListFindingTypeStatsRequest + */ + ListFindingTypeStatsRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.websecurityscanner.v1.ListFindingTypeStatsRequest) + return object; + var message = new $root.google.cloud.websecurityscanner.v1.ListFindingTypeStatsRequest(); + if (object.parent != null) + message.parent = String(object.parent); + return message; + }; + + /** + * Creates a plain object from a ListFindingTypeStatsRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.websecurityscanner.v1.ListFindingTypeStatsRequest + * @static + * @param {google.cloud.websecurityscanner.v1.ListFindingTypeStatsRequest} message ListFindingTypeStatsRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListFindingTypeStatsRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.parent = ""; + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + return object; + }; + + /** + * Converts this ListFindingTypeStatsRequest to JSON. + * @function toJSON + * @memberof google.cloud.websecurityscanner.v1.ListFindingTypeStatsRequest + * @instance + * @returns {Object.} JSON object + */ + ListFindingTypeStatsRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListFindingTypeStatsRequest + * @function getTypeUrl + * @memberof google.cloud.websecurityscanner.v1.ListFindingTypeStatsRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListFindingTypeStatsRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.websecurityscanner.v1.ListFindingTypeStatsRequest"; + }; + + return ListFindingTypeStatsRequest; + })(); + + v1.ListFindingTypeStatsResponse = (function() { + + /** + * Properties of a ListFindingTypeStatsResponse. + * @memberof google.cloud.websecurityscanner.v1 + * @interface IListFindingTypeStatsResponse + * @property {Array.|null} [findingTypeStats] ListFindingTypeStatsResponse findingTypeStats + */ + + /** + * Constructs a new ListFindingTypeStatsResponse. + * @memberof google.cloud.websecurityscanner.v1 + * @classdesc Represents a ListFindingTypeStatsResponse. + * @implements IListFindingTypeStatsResponse + * @constructor + * @param {google.cloud.websecurityscanner.v1.IListFindingTypeStatsResponse=} [properties] Properties to set + */ + function ListFindingTypeStatsResponse(properties) { + this.findingTypeStats = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListFindingTypeStatsResponse findingTypeStats. + * @member {Array.} findingTypeStats + * @memberof google.cloud.websecurityscanner.v1.ListFindingTypeStatsResponse + * @instance + */ + ListFindingTypeStatsResponse.prototype.findingTypeStats = $util.emptyArray; + + /** + * Creates a new ListFindingTypeStatsResponse instance using the specified properties. + * @function create + * @memberof google.cloud.websecurityscanner.v1.ListFindingTypeStatsResponse + * @static + * @param {google.cloud.websecurityscanner.v1.IListFindingTypeStatsResponse=} [properties] Properties to set + * @returns {google.cloud.websecurityscanner.v1.ListFindingTypeStatsResponse} ListFindingTypeStatsResponse instance + */ + ListFindingTypeStatsResponse.create = function create(properties) { + return new ListFindingTypeStatsResponse(properties); + }; + + /** + * Encodes the specified ListFindingTypeStatsResponse message. Does not implicitly {@link google.cloud.websecurityscanner.v1.ListFindingTypeStatsResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.websecurityscanner.v1.ListFindingTypeStatsResponse + * @static + * @param {google.cloud.websecurityscanner.v1.IListFindingTypeStatsResponse} message ListFindingTypeStatsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListFindingTypeStatsResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.findingTypeStats != null && message.findingTypeStats.length) + for (var i = 0; i < message.findingTypeStats.length; ++i) + $root.google.cloud.websecurityscanner.v1.FindingTypeStats.encode(message.findingTypeStats[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified ListFindingTypeStatsResponse message, length delimited. Does not implicitly {@link google.cloud.websecurityscanner.v1.ListFindingTypeStatsResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.websecurityscanner.v1.ListFindingTypeStatsResponse + * @static + * @param {google.cloud.websecurityscanner.v1.IListFindingTypeStatsResponse} message ListFindingTypeStatsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListFindingTypeStatsResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListFindingTypeStatsResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.websecurityscanner.v1.ListFindingTypeStatsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.websecurityscanner.v1.ListFindingTypeStatsResponse} ListFindingTypeStatsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListFindingTypeStatsResponse.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.websecurityscanner.v1.ListFindingTypeStatsResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.findingTypeStats && message.findingTypeStats.length)) + message.findingTypeStats = []; + message.findingTypeStats.push($root.google.cloud.websecurityscanner.v1.FindingTypeStats.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListFindingTypeStatsResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.websecurityscanner.v1.ListFindingTypeStatsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.websecurityscanner.v1.ListFindingTypeStatsResponse} ListFindingTypeStatsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListFindingTypeStatsResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListFindingTypeStatsResponse message. + * @function verify + * @memberof google.cloud.websecurityscanner.v1.ListFindingTypeStatsResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListFindingTypeStatsResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.findingTypeStats != null && message.hasOwnProperty("findingTypeStats")) { + if (!Array.isArray(message.findingTypeStats)) + return "findingTypeStats: array expected"; + for (var i = 0; i < message.findingTypeStats.length; ++i) { + var error = $root.google.cloud.websecurityscanner.v1.FindingTypeStats.verify(message.findingTypeStats[i]); + if (error) + return "findingTypeStats." + error; + } + } + return null; + }; + + /** + * Creates a ListFindingTypeStatsResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.websecurityscanner.v1.ListFindingTypeStatsResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.websecurityscanner.v1.ListFindingTypeStatsResponse} ListFindingTypeStatsResponse + */ + ListFindingTypeStatsResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.websecurityscanner.v1.ListFindingTypeStatsResponse) + return object; + var message = new $root.google.cloud.websecurityscanner.v1.ListFindingTypeStatsResponse(); + if (object.findingTypeStats) { + if (!Array.isArray(object.findingTypeStats)) + throw TypeError(".google.cloud.websecurityscanner.v1.ListFindingTypeStatsResponse.findingTypeStats: array expected"); + message.findingTypeStats = []; + for (var i = 0; i < object.findingTypeStats.length; ++i) { + if (typeof object.findingTypeStats[i] !== "object") + throw TypeError(".google.cloud.websecurityscanner.v1.ListFindingTypeStatsResponse.findingTypeStats: object expected"); + message.findingTypeStats[i] = $root.google.cloud.websecurityscanner.v1.FindingTypeStats.fromObject(object.findingTypeStats[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a ListFindingTypeStatsResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.websecurityscanner.v1.ListFindingTypeStatsResponse + * @static + * @param {google.cloud.websecurityscanner.v1.ListFindingTypeStatsResponse} message ListFindingTypeStatsResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListFindingTypeStatsResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.findingTypeStats = []; + if (message.findingTypeStats && message.findingTypeStats.length) { + object.findingTypeStats = []; + for (var j = 0; j < message.findingTypeStats.length; ++j) + object.findingTypeStats[j] = $root.google.cloud.websecurityscanner.v1.FindingTypeStats.toObject(message.findingTypeStats[j], options); + } + return object; + }; + + /** + * Converts this ListFindingTypeStatsResponse to JSON. + * @function toJSON + * @memberof google.cloud.websecurityscanner.v1.ListFindingTypeStatsResponse + * @instance + * @returns {Object.} JSON object + */ + ListFindingTypeStatsResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListFindingTypeStatsResponse + * @function getTypeUrl + * @memberof google.cloud.websecurityscanner.v1.ListFindingTypeStatsResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListFindingTypeStatsResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.websecurityscanner.v1.ListFindingTypeStatsResponse"; + }; + + return ListFindingTypeStatsResponse; + })(); + + return v1; + })(); + + websecurityscanner.v1alpha = (function() { + + /** + * Namespace v1alpha. + * @memberof google.cloud.websecurityscanner + * @namespace + */ + var v1alpha = {}; + + v1alpha.CrawledUrl = (function() { + + /** + * Properties of a CrawledUrl. + * @memberof google.cloud.websecurityscanner.v1alpha + * @interface ICrawledUrl + * @property {string|null} [httpMethod] CrawledUrl httpMethod + * @property {string|null} [url] CrawledUrl url + * @property {string|null} [body] CrawledUrl body + */ + + /** + * Constructs a new CrawledUrl. + * @memberof google.cloud.websecurityscanner.v1alpha + * @classdesc Represents a CrawledUrl. + * @implements ICrawledUrl + * @constructor + * @param {google.cloud.websecurityscanner.v1alpha.ICrawledUrl=} [properties] Properties to set + */ + function CrawledUrl(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * CrawledUrl httpMethod. + * @member {string} httpMethod + * @memberof google.cloud.websecurityscanner.v1alpha.CrawledUrl + * @instance + */ + CrawledUrl.prototype.httpMethod = ""; + + /** + * CrawledUrl url. + * @member {string} url + * @memberof google.cloud.websecurityscanner.v1alpha.CrawledUrl + * @instance + */ + CrawledUrl.prototype.url = ""; + + /** + * CrawledUrl body. + * @member {string} body + * @memberof google.cloud.websecurityscanner.v1alpha.CrawledUrl + * @instance + */ + CrawledUrl.prototype.body = ""; + + /** + * Creates a new CrawledUrl instance using the specified properties. + * @function create + * @memberof google.cloud.websecurityscanner.v1alpha.CrawledUrl + * @static + * @param {google.cloud.websecurityscanner.v1alpha.ICrawledUrl=} [properties] Properties to set + * @returns {google.cloud.websecurityscanner.v1alpha.CrawledUrl} CrawledUrl instance + */ + CrawledUrl.create = function create(properties) { + return new CrawledUrl(properties); + }; + + /** + * Encodes the specified CrawledUrl message. Does not implicitly {@link google.cloud.websecurityscanner.v1alpha.CrawledUrl.verify|verify} messages. + * @function encode + * @memberof google.cloud.websecurityscanner.v1alpha.CrawledUrl + * @static + * @param {google.cloud.websecurityscanner.v1alpha.ICrawledUrl} message CrawledUrl message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CrawledUrl.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.httpMethod != null && Object.hasOwnProperty.call(message, "httpMethod")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.httpMethod); + if (message.url != null && Object.hasOwnProperty.call(message, "url")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.url); + if (message.body != null && Object.hasOwnProperty.call(message, "body")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.body); + return writer; + }; + + /** + * Encodes the specified CrawledUrl message, length delimited. Does not implicitly {@link google.cloud.websecurityscanner.v1alpha.CrawledUrl.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.websecurityscanner.v1alpha.CrawledUrl + * @static + * @param {google.cloud.websecurityscanner.v1alpha.ICrawledUrl} message CrawledUrl message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CrawledUrl.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CrawledUrl message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.websecurityscanner.v1alpha.CrawledUrl + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.websecurityscanner.v1alpha.CrawledUrl} CrawledUrl + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CrawledUrl.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.websecurityscanner.v1alpha.CrawledUrl(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.httpMethod = reader.string(); + break; + } + case 2: { + message.url = reader.string(); + break; + } + case 3: { + message.body = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CrawledUrl message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.websecurityscanner.v1alpha.CrawledUrl + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.websecurityscanner.v1alpha.CrawledUrl} CrawledUrl + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CrawledUrl.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CrawledUrl message. + * @function verify + * @memberof google.cloud.websecurityscanner.v1alpha.CrawledUrl + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CrawledUrl.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.httpMethod != null && message.hasOwnProperty("httpMethod")) + if (!$util.isString(message.httpMethod)) + return "httpMethod: string expected"; + if (message.url != null && message.hasOwnProperty("url")) + if (!$util.isString(message.url)) + return "url: string expected"; + if (message.body != null && message.hasOwnProperty("body")) + if (!$util.isString(message.body)) + return "body: string expected"; + return null; + }; + + /** + * Creates a CrawledUrl message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.websecurityscanner.v1alpha.CrawledUrl + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.websecurityscanner.v1alpha.CrawledUrl} CrawledUrl + */ + CrawledUrl.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.websecurityscanner.v1alpha.CrawledUrl) + return object; + var message = new $root.google.cloud.websecurityscanner.v1alpha.CrawledUrl(); + if (object.httpMethod != null) + message.httpMethod = String(object.httpMethod); + if (object.url != null) + message.url = String(object.url); + if (object.body != null) + message.body = String(object.body); + return message; + }; + + /** + * Creates a plain object from a CrawledUrl message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.websecurityscanner.v1alpha.CrawledUrl + * @static + * @param {google.cloud.websecurityscanner.v1alpha.CrawledUrl} message CrawledUrl + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CrawledUrl.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.httpMethod = ""; + object.url = ""; + object.body = ""; + } + if (message.httpMethod != null && message.hasOwnProperty("httpMethod")) + object.httpMethod = message.httpMethod; + if (message.url != null && message.hasOwnProperty("url")) + object.url = message.url; + if (message.body != null && message.hasOwnProperty("body")) + object.body = message.body; + return object; + }; + + /** + * Converts this CrawledUrl to JSON. + * @function toJSON + * @memberof google.cloud.websecurityscanner.v1alpha.CrawledUrl + * @instance + * @returns {Object.} JSON object + */ + CrawledUrl.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CrawledUrl + * @function getTypeUrl + * @memberof google.cloud.websecurityscanner.v1alpha.CrawledUrl + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CrawledUrl.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.websecurityscanner.v1alpha.CrawledUrl"; + }; + + return CrawledUrl; + })(); + + v1alpha.Finding = (function() { + + /** + * Properties of a Finding. + * @memberof google.cloud.websecurityscanner.v1alpha + * @interface IFinding + * @property {string|null} [name] Finding name + * @property {google.cloud.websecurityscanner.v1alpha.Finding.FindingType|null} [findingType] Finding findingType + * @property {string|null} [httpMethod] Finding httpMethod + * @property {string|null} [fuzzedUrl] Finding fuzzedUrl + * @property {string|null} [body] Finding body + * @property {string|null} [description] Finding description + * @property {string|null} [reproductionUrl] Finding reproductionUrl + * @property {string|null} [frameUrl] Finding frameUrl + * @property {string|null} [finalUrl] Finding finalUrl + * @property {string|null} [trackingId] Finding trackingId + * @property {google.cloud.websecurityscanner.v1alpha.IOutdatedLibrary|null} [outdatedLibrary] Finding outdatedLibrary + * @property {google.cloud.websecurityscanner.v1alpha.IViolatingResource|null} [violatingResource] Finding violatingResource + * @property {google.cloud.websecurityscanner.v1alpha.IVulnerableHeaders|null} [vulnerableHeaders] Finding vulnerableHeaders + * @property {google.cloud.websecurityscanner.v1alpha.IVulnerableParameters|null} [vulnerableParameters] Finding vulnerableParameters + * @property {google.cloud.websecurityscanner.v1alpha.IXss|null} [xss] Finding xss + */ + + /** + * Constructs a new Finding. + * @memberof google.cloud.websecurityscanner.v1alpha + * @classdesc Represents a Finding. + * @implements IFinding + * @constructor + * @param {google.cloud.websecurityscanner.v1alpha.IFinding=} [properties] Properties to set + */ + function Finding(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Finding name. + * @member {string} name + * @memberof google.cloud.websecurityscanner.v1alpha.Finding + * @instance + */ + Finding.prototype.name = ""; + + /** + * Finding findingType. + * @member {google.cloud.websecurityscanner.v1alpha.Finding.FindingType} findingType + * @memberof google.cloud.websecurityscanner.v1alpha.Finding + * @instance + */ + Finding.prototype.findingType = 0; + + /** + * Finding httpMethod. + * @member {string} httpMethod + * @memberof google.cloud.websecurityscanner.v1alpha.Finding + * @instance + */ + Finding.prototype.httpMethod = ""; + + /** + * Finding fuzzedUrl. + * @member {string} fuzzedUrl + * @memberof google.cloud.websecurityscanner.v1alpha.Finding + * @instance + */ + Finding.prototype.fuzzedUrl = ""; + + /** + * Finding body. + * @member {string} body + * @memberof google.cloud.websecurityscanner.v1alpha.Finding + * @instance + */ + Finding.prototype.body = ""; + + /** + * Finding description. + * @member {string} description + * @memberof google.cloud.websecurityscanner.v1alpha.Finding + * @instance + */ + Finding.prototype.description = ""; + + /** + * Finding reproductionUrl. + * @member {string} reproductionUrl + * @memberof google.cloud.websecurityscanner.v1alpha.Finding + * @instance + */ + Finding.prototype.reproductionUrl = ""; + + /** + * Finding frameUrl. + * @member {string} frameUrl + * @memberof google.cloud.websecurityscanner.v1alpha.Finding + * @instance + */ + Finding.prototype.frameUrl = ""; + + /** + * Finding finalUrl. + * @member {string} finalUrl + * @memberof google.cloud.websecurityscanner.v1alpha.Finding + * @instance + */ + Finding.prototype.finalUrl = ""; + + /** + * Finding trackingId. + * @member {string} trackingId + * @memberof google.cloud.websecurityscanner.v1alpha.Finding + * @instance + */ + Finding.prototype.trackingId = ""; + + /** + * Finding outdatedLibrary. + * @member {google.cloud.websecurityscanner.v1alpha.IOutdatedLibrary|null|undefined} outdatedLibrary + * @memberof google.cloud.websecurityscanner.v1alpha.Finding + * @instance + */ + Finding.prototype.outdatedLibrary = null; + + /** + * Finding violatingResource. + * @member {google.cloud.websecurityscanner.v1alpha.IViolatingResource|null|undefined} violatingResource + * @memberof google.cloud.websecurityscanner.v1alpha.Finding + * @instance + */ + Finding.prototype.violatingResource = null; + + /** + * Finding vulnerableHeaders. + * @member {google.cloud.websecurityscanner.v1alpha.IVulnerableHeaders|null|undefined} vulnerableHeaders + * @memberof google.cloud.websecurityscanner.v1alpha.Finding + * @instance + */ + Finding.prototype.vulnerableHeaders = null; + + /** + * Finding vulnerableParameters. + * @member {google.cloud.websecurityscanner.v1alpha.IVulnerableParameters|null|undefined} vulnerableParameters + * @memberof google.cloud.websecurityscanner.v1alpha.Finding + * @instance + */ + Finding.prototype.vulnerableParameters = null; + + /** + * Finding xss. + * @member {google.cloud.websecurityscanner.v1alpha.IXss|null|undefined} xss + * @memberof google.cloud.websecurityscanner.v1alpha.Finding + * @instance + */ + Finding.prototype.xss = null; + + /** + * Creates a new Finding instance using the specified properties. + * @function create + * @memberof google.cloud.websecurityscanner.v1alpha.Finding + * @static + * @param {google.cloud.websecurityscanner.v1alpha.IFinding=} [properties] Properties to set + * @returns {google.cloud.websecurityscanner.v1alpha.Finding} Finding instance + */ + Finding.create = function create(properties) { + return new Finding(properties); + }; + + /** + * Encodes the specified Finding message. Does not implicitly {@link google.cloud.websecurityscanner.v1alpha.Finding.verify|verify} messages. + * @function encode + * @memberof google.cloud.websecurityscanner.v1alpha.Finding + * @static + * @param {google.cloud.websecurityscanner.v1alpha.IFinding} message Finding message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Finding.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.findingType != null && Object.hasOwnProperty.call(message, "findingType")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.findingType); + if (message.httpMethod != null && Object.hasOwnProperty.call(message, "httpMethod")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.httpMethod); + if (message.fuzzedUrl != null && Object.hasOwnProperty.call(message, "fuzzedUrl")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.fuzzedUrl); + if (message.body != null && Object.hasOwnProperty.call(message, "body")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.body); + if (message.description != null && Object.hasOwnProperty.call(message, "description")) + writer.uint32(/* id 6, wireType 2 =*/50).string(message.description); + if (message.reproductionUrl != null && Object.hasOwnProperty.call(message, "reproductionUrl")) + writer.uint32(/* id 7, wireType 2 =*/58).string(message.reproductionUrl); + if (message.frameUrl != null && Object.hasOwnProperty.call(message, "frameUrl")) + writer.uint32(/* id 8, wireType 2 =*/66).string(message.frameUrl); + if (message.finalUrl != null && Object.hasOwnProperty.call(message, "finalUrl")) + writer.uint32(/* id 9, wireType 2 =*/74).string(message.finalUrl); + if (message.trackingId != null && Object.hasOwnProperty.call(message, "trackingId")) + writer.uint32(/* id 10, wireType 2 =*/82).string(message.trackingId); + if (message.outdatedLibrary != null && Object.hasOwnProperty.call(message, "outdatedLibrary")) + $root.google.cloud.websecurityscanner.v1alpha.OutdatedLibrary.encode(message.outdatedLibrary, writer.uint32(/* id 11, wireType 2 =*/90).fork()).ldelim(); + if (message.violatingResource != null && Object.hasOwnProperty.call(message, "violatingResource")) + $root.google.cloud.websecurityscanner.v1alpha.ViolatingResource.encode(message.violatingResource, writer.uint32(/* id 12, wireType 2 =*/98).fork()).ldelim(); + if (message.vulnerableParameters != null && Object.hasOwnProperty.call(message, "vulnerableParameters")) + $root.google.cloud.websecurityscanner.v1alpha.VulnerableParameters.encode(message.vulnerableParameters, writer.uint32(/* id 13, wireType 2 =*/106).fork()).ldelim(); + if (message.xss != null && Object.hasOwnProperty.call(message, "xss")) + $root.google.cloud.websecurityscanner.v1alpha.Xss.encode(message.xss, writer.uint32(/* id 14, wireType 2 =*/114).fork()).ldelim(); + if (message.vulnerableHeaders != null && Object.hasOwnProperty.call(message, "vulnerableHeaders")) + $root.google.cloud.websecurityscanner.v1alpha.VulnerableHeaders.encode(message.vulnerableHeaders, writer.uint32(/* id 15, wireType 2 =*/122).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified Finding message, length delimited. Does not implicitly {@link google.cloud.websecurityscanner.v1alpha.Finding.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.websecurityscanner.v1alpha.Finding + * @static + * @param {google.cloud.websecurityscanner.v1alpha.IFinding} message Finding message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Finding.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Finding message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.websecurityscanner.v1alpha.Finding + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.websecurityscanner.v1alpha.Finding} Finding + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Finding.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.websecurityscanner.v1alpha.Finding(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.findingType = reader.int32(); + break; + } + case 3: { + message.httpMethod = reader.string(); + break; + } + case 4: { + message.fuzzedUrl = reader.string(); + break; + } + case 5: { + message.body = reader.string(); + break; + } + case 6: { + message.description = reader.string(); + break; + } + case 7: { + message.reproductionUrl = reader.string(); + break; + } + case 8: { + message.frameUrl = reader.string(); + break; + } + case 9: { + message.finalUrl = reader.string(); + break; + } + case 10: { + message.trackingId = reader.string(); + break; + } + case 11: { + message.outdatedLibrary = $root.google.cloud.websecurityscanner.v1alpha.OutdatedLibrary.decode(reader, reader.uint32()); + break; + } + case 12: { + message.violatingResource = $root.google.cloud.websecurityscanner.v1alpha.ViolatingResource.decode(reader, reader.uint32()); + break; + } + case 15: { + message.vulnerableHeaders = $root.google.cloud.websecurityscanner.v1alpha.VulnerableHeaders.decode(reader, reader.uint32()); + break; + } + case 13: { + message.vulnerableParameters = $root.google.cloud.websecurityscanner.v1alpha.VulnerableParameters.decode(reader, reader.uint32()); + break; + } + case 14: { + message.xss = $root.google.cloud.websecurityscanner.v1alpha.Xss.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Finding message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.websecurityscanner.v1alpha.Finding + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.websecurityscanner.v1alpha.Finding} Finding + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Finding.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Finding message. + * @function verify + * @memberof google.cloud.websecurityscanner.v1alpha.Finding + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Finding.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.findingType != null && message.hasOwnProperty("findingType")) + switch (message.findingType) { + default: + return "findingType: enum value expected"; + case 0: + case 1: + case 2: + case 5: + case 3: + case 4: + case 6: + case 7: + case 8: + case 9: + case 10: + case 11: + break; + } + if (message.httpMethod != null && message.hasOwnProperty("httpMethod")) + if (!$util.isString(message.httpMethod)) + return "httpMethod: string expected"; + if (message.fuzzedUrl != null && message.hasOwnProperty("fuzzedUrl")) + if (!$util.isString(message.fuzzedUrl)) + return "fuzzedUrl: string expected"; + if (message.body != null && message.hasOwnProperty("body")) + if (!$util.isString(message.body)) + return "body: string expected"; + if (message.description != null && message.hasOwnProperty("description")) + if (!$util.isString(message.description)) + return "description: string expected"; + if (message.reproductionUrl != null && message.hasOwnProperty("reproductionUrl")) + if (!$util.isString(message.reproductionUrl)) + return "reproductionUrl: string expected"; + if (message.frameUrl != null && message.hasOwnProperty("frameUrl")) + if (!$util.isString(message.frameUrl)) + return "frameUrl: string expected"; + if (message.finalUrl != null && message.hasOwnProperty("finalUrl")) + if (!$util.isString(message.finalUrl)) + return "finalUrl: string expected"; + if (message.trackingId != null && message.hasOwnProperty("trackingId")) + if (!$util.isString(message.trackingId)) + return "trackingId: string expected"; + if (message.outdatedLibrary != null && message.hasOwnProperty("outdatedLibrary")) { + var error = $root.google.cloud.websecurityscanner.v1alpha.OutdatedLibrary.verify(message.outdatedLibrary); + if (error) + return "outdatedLibrary." + error; + } + if (message.violatingResource != null && message.hasOwnProperty("violatingResource")) { + var error = $root.google.cloud.websecurityscanner.v1alpha.ViolatingResource.verify(message.violatingResource); + if (error) + return "violatingResource." + error; + } + if (message.vulnerableHeaders != null && message.hasOwnProperty("vulnerableHeaders")) { + var error = $root.google.cloud.websecurityscanner.v1alpha.VulnerableHeaders.verify(message.vulnerableHeaders); + if (error) + return "vulnerableHeaders." + error; + } + if (message.vulnerableParameters != null && message.hasOwnProperty("vulnerableParameters")) { + var error = $root.google.cloud.websecurityscanner.v1alpha.VulnerableParameters.verify(message.vulnerableParameters); + if (error) + return "vulnerableParameters." + error; + } + if (message.xss != null && message.hasOwnProperty("xss")) { + var error = $root.google.cloud.websecurityscanner.v1alpha.Xss.verify(message.xss); + if (error) + return "xss." + error; + } + return null; + }; + + /** + * Creates a Finding message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.websecurityscanner.v1alpha.Finding + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.websecurityscanner.v1alpha.Finding} Finding + */ + Finding.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.websecurityscanner.v1alpha.Finding) + return object; + var message = new $root.google.cloud.websecurityscanner.v1alpha.Finding(); + if (object.name != null) + message.name = String(object.name); + switch (object.findingType) { + default: + if (typeof object.findingType === "number") { + message.findingType = object.findingType; + break; + } + break; + case "FINDING_TYPE_UNSPECIFIED": + case 0: + message.findingType = 0; + break; + case "MIXED_CONTENT": + case 1: + message.findingType = 1; + break; + case "OUTDATED_LIBRARY": + case 2: + message.findingType = 2; + break; + case "ROSETTA_FLASH": + case 5: + message.findingType = 5; + break; + case "XSS_CALLBACK": + case 3: + message.findingType = 3; + break; + case "XSS_ERROR": + case 4: + message.findingType = 4; + break; + case "CLEAR_TEXT_PASSWORD": + case 6: + message.findingType = 6; + break; + case "INVALID_CONTENT_TYPE": + case 7: + message.findingType = 7; + break; + case "XSS_ANGULAR_CALLBACK": + case 8: + message.findingType = 8; + break; + case "INVALID_HEADER": + case 9: + message.findingType = 9; + break; + case "MISSPELLED_SECURITY_HEADER_NAME": + case 10: + message.findingType = 10; + break; + case "MISMATCHING_SECURITY_HEADER_VALUES": + case 11: + message.findingType = 11; + break; + } + if (object.httpMethod != null) + message.httpMethod = String(object.httpMethod); + if (object.fuzzedUrl != null) + message.fuzzedUrl = String(object.fuzzedUrl); + if (object.body != null) + message.body = String(object.body); + if (object.description != null) + message.description = String(object.description); + if (object.reproductionUrl != null) + message.reproductionUrl = String(object.reproductionUrl); + if (object.frameUrl != null) + message.frameUrl = String(object.frameUrl); + if (object.finalUrl != null) + message.finalUrl = String(object.finalUrl); + if (object.trackingId != null) + message.trackingId = String(object.trackingId); + if (object.outdatedLibrary != null) { + if (typeof object.outdatedLibrary !== "object") + throw TypeError(".google.cloud.websecurityscanner.v1alpha.Finding.outdatedLibrary: object expected"); + message.outdatedLibrary = $root.google.cloud.websecurityscanner.v1alpha.OutdatedLibrary.fromObject(object.outdatedLibrary); + } + if (object.violatingResource != null) { + if (typeof object.violatingResource !== "object") + throw TypeError(".google.cloud.websecurityscanner.v1alpha.Finding.violatingResource: object expected"); + message.violatingResource = $root.google.cloud.websecurityscanner.v1alpha.ViolatingResource.fromObject(object.violatingResource); + } + if (object.vulnerableHeaders != null) { + if (typeof object.vulnerableHeaders !== "object") + throw TypeError(".google.cloud.websecurityscanner.v1alpha.Finding.vulnerableHeaders: object expected"); + message.vulnerableHeaders = $root.google.cloud.websecurityscanner.v1alpha.VulnerableHeaders.fromObject(object.vulnerableHeaders); + } + if (object.vulnerableParameters != null) { + if (typeof object.vulnerableParameters !== "object") + throw TypeError(".google.cloud.websecurityscanner.v1alpha.Finding.vulnerableParameters: object expected"); + message.vulnerableParameters = $root.google.cloud.websecurityscanner.v1alpha.VulnerableParameters.fromObject(object.vulnerableParameters); + } + if (object.xss != null) { + if (typeof object.xss !== "object") + throw TypeError(".google.cloud.websecurityscanner.v1alpha.Finding.xss: object expected"); + message.xss = $root.google.cloud.websecurityscanner.v1alpha.Xss.fromObject(object.xss); + } + return message; + }; + + /** + * Creates a plain object from a Finding message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.websecurityscanner.v1alpha.Finding + * @static + * @param {google.cloud.websecurityscanner.v1alpha.Finding} message Finding + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Finding.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.findingType = options.enums === String ? "FINDING_TYPE_UNSPECIFIED" : 0; + object.httpMethod = ""; + object.fuzzedUrl = ""; + object.body = ""; + object.description = ""; + object.reproductionUrl = ""; + object.frameUrl = ""; + object.finalUrl = ""; + object.trackingId = ""; + object.outdatedLibrary = null; + object.violatingResource = null; + object.vulnerableParameters = null; + object.xss = null; + object.vulnerableHeaders = null; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.findingType != null && message.hasOwnProperty("findingType")) + object.findingType = options.enums === String ? $root.google.cloud.websecurityscanner.v1alpha.Finding.FindingType[message.findingType] === undefined ? message.findingType : $root.google.cloud.websecurityscanner.v1alpha.Finding.FindingType[message.findingType] : message.findingType; + if (message.httpMethod != null && message.hasOwnProperty("httpMethod")) + object.httpMethod = message.httpMethod; + if (message.fuzzedUrl != null && message.hasOwnProperty("fuzzedUrl")) + object.fuzzedUrl = message.fuzzedUrl; + if (message.body != null && message.hasOwnProperty("body")) + object.body = message.body; + if (message.description != null && message.hasOwnProperty("description")) + object.description = message.description; + if (message.reproductionUrl != null && message.hasOwnProperty("reproductionUrl")) + object.reproductionUrl = message.reproductionUrl; + if (message.frameUrl != null && message.hasOwnProperty("frameUrl")) + object.frameUrl = message.frameUrl; + if (message.finalUrl != null && message.hasOwnProperty("finalUrl")) + object.finalUrl = message.finalUrl; + if (message.trackingId != null && message.hasOwnProperty("trackingId")) + object.trackingId = message.trackingId; + if (message.outdatedLibrary != null && message.hasOwnProperty("outdatedLibrary")) + object.outdatedLibrary = $root.google.cloud.websecurityscanner.v1alpha.OutdatedLibrary.toObject(message.outdatedLibrary, options); + if (message.violatingResource != null && message.hasOwnProperty("violatingResource")) + object.violatingResource = $root.google.cloud.websecurityscanner.v1alpha.ViolatingResource.toObject(message.violatingResource, options); + if (message.vulnerableParameters != null && message.hasOwnProperty("vulnerableParameters")) + object.vulnerableParameters = $root.google.cloud.websecurityscanner.v1alpha.VulnerableParameters.toObject(message.vulnerableParameters, options); + if (message.xss != null && message.hasOwnProperty("xss")) + object.xss = $root.google.cloud.websecurityscanner.v1alpha.Xss.toObject(message.xss, options); + if (message.vulnerableHeaders != null && message.hasOwnProperty("vulnerableHeaders")) + object.vulnerableHeaders = $root.google.cloud.websecurityscanner.v1alpha.VulnerableHeaders.toObject(message.vulnerableHeaders, options); + return object; + }; + + /** + * Converts this Finding to JSON. + * @function toJSON + * @memberof google.cloud.websecurityscanner.v1alpha.Finding + * @instance + * @returns {Object.} JSON object + */ + Finding.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Finding + * @function getTypeUrl + * @memberof google.cloud.websecurityscanner.v1alpha.Finding + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Finding.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.websecurityscanner.v1alpha.Finding"; + }; + + /** + * FindingType enum. + * @name google.cloud.websecurityscanner.v1alpha.Finding.FindingType + * @enum {number} + * @property {number} FINDING_TYPE_UNSPECIFIED=0 FINDING_TYPE_UNSPECIFIED value + * @property {number} MIXED_CONTENT=1 MIXED_CONTENT value + * @property {number} OUTDATED_LIBRARY=2 OUTDATED_LIBRARY value + * @property {number} ROSETTA_FLASH=5 ROSETTA_FLASH value + * @property {number} XSS_CALLBACK=3 XSS_CALLBACK value + * @property {number} XSS_ERROR=4 XSS_ERROR value + * @property {number} CLEAR_TEXT_PASSWORD=6 CLEAR_TEXT_PASSWORD value + * @property {number} INVALID_CONTENT_TYPE=7 INVALID_CONTENT_TYPE value + * @property {number} XSS_ANGULAR_CALLBACK=8 XSS_ANGULAR_CALLBACK value + * @property {number} INVALID_HEADER=9 INVALID_HEADER value + * @property {number} MISSPELLED_SECURITY_HEADER_NAME=10 MISSPELLED_SECURITY_HEADER_NAME value + * @property {number} MISMATCHING_SECURITY_HEADER_VALUES=11 MISMATCHING_SECURITY_HEADER_VALUES value + */ + Finding.FindingType = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "FINDING_TYPE_UNSPECIFIED"] = 0; + values[valuesById[1] = "MIXED_CONTENT"] = 1; + values[valuesById[2] = "OUTDATED_LIBRARY"] = 2; + values[valuesById[5] = "ROSETTA_FLASH"] = 5; + values[valuesById[3] = "XSS_CALLBACK"] = 3; + values[valuesById[4] = "XSS_ERROR"] = 4; + values[valuesById[6] = "CLEAR_TEXT_PASSWORD"] = 6; + values[valuesById[7] = "INVALID_CONTENT_TYPE"] = 7; + values[valuesById[8] = "XSS_ANGULAR_CALLBACK"] = 8; + values[valuesById[9] = "INVALID_HEADER"] = 9; + values[valuesById[10] = "MISSPELLED_SECURITY_HEADER_NAME"] = 10; + values[valuesById[11] = "MISMATCHING_SECURITY_HEADER_VALUES"] = 11; + return values; + })(); + + return Finding; + })(); + + v1alpha.OutdatedLibrary = (function() { + + /** + * Properties of an OutdatedLibrary. + * @memberof google.cloud.websecurityscanner.v1alpha + * @interface IOutdatedLibrary + * @property {string|null} [libraryName] OutdatedLibrary libraryName + * @property {string|null} [version] OutdatedLibrary version + * @property {Array.|null} [learnMoreUrls] OutdatedLibrary learnMoreUrls + */ + + /** + * Constructs a new OutdatedLibrary. + * @memberof google.cloud.websecurityscanner.v1alpha + * @classdesc Represents an OutdatedLibrary. + * @implements IOutdatedLibrary + * @constructor + * @param {google.cloud.websecurityscanner.v1alpha.IOutdatedLibrary=} [properties] Properties to set + */ + function OutdatedLibrary(properties) { + this.learnMoreUrls = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * OutdatedLibrary libraryName. + * @member {string} libraryName + * @memberof google.cloud.websecurityscanner.v1alpha.OutdatedLibrary + * @instance + */ + OutdatedLibrary.prototype.libraryName = ""; + + /** + * OutdatedLibrary version. + * @member {string} version + * @memberof google.cloud.websecurityscanner.v1alpha.OutdatedLibrary + * @instance + */ + OutdatedLibrary.prototype.version = ""; + + /** + * OutdatedLibrary learnMoreUrls. + * @member {Array.} learnMoreUrls + * @memberof google.cloud.websecurityscanner.v1alpha.OutdatedLibrary + * @instance + */ + OutdatedLibrary.prototype.learnMoreUrls = $util.emptyArray; + + /** + * Creates a new OutdatedLibrary instance using the specified properties. + * @function create + * @memberof google.cloud.websecurityscanner.v1alpha.OutdatedLibrary + * @static + * @param {google.cloud.websecurityscanner.v1alpha.IOutdatedLibrary=} [properties] Properties to set + * @returns {google.cloud.websecurityscanner.v1alpha.OutdatedLibrary} OutdatedLibrary instance + */ + OutdatedLibrary.create = function create(properties) { + return new OutdatedLibrary(properties); + }; + + /** + * Encodes the specified OutdatedLibrary message. Does not implicitly {@link google.cloud.websecurityscanner.v1alpha.OutdatedLibrary.verify|verify} messages. + * @function encode + * @memberof google.cloud.websecurityscanner.v1alpha.OutdatedLibrary + * @static + * @param {google.cloud.websecurityscanner.v1alpha.IOutdatedLibrary} message OutdatedLibrary message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + OutdatedLibrary.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.libraryName != null && Object.hasOwnProperty.call(message, "libraryName")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.libraryName); + if (message.version != null && Object.hasOwnProperty.call(message, "version")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.version); + if (message.learnMoreUrls != null && message.learnMoreUrls.length) + for (var i = 0; i < message.learnMoreUrls.length; ++i) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.learnMoreUrls[i]); + return writer; + }; + + /** + * Encodes the specified OutdatedLibrary message, length delimited. Does not implicitly {@link google.cloud.websecurityscanner.v1alpha.OutdatedLibrary.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.websecurityscanner.v1alpha.OutdatedLibrary + * @static + * @param {google.cloud.websecurityscanner.v1alpha.IOutdatedLibrary} message OutdatedLibrary message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + OutdatedLibrary.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an OutdatedLibrary message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.websecurityscanner.v1alpha.OutdatedLibrary + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.websecurityscanner.v1alpha.OutdatedLibrary} OutdatedLibrary + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + OutdatedLibrary.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.websecurityscanner.v1alpha.OutdatedLibrary(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.libraryName = reader.string(); + break; + } + case 2: { + message.version = reader.string(); + break; + } + case 3: { + if (!(message.learnMoreUrls && message.learnMoreUrls.length)) + message.learnMoreUrls = []; + message.learnMoreUrls.push(reader.string()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an OutdatedLibrary message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.websecurityscanner.v1alpha.OutdatedLibrary + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.websecurityscanner.v1alpha.OutdatedLibrary} OutdatedLibrary + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + OutdatedLibrary.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an OutdatedLibrary message. + * @function verify + * @memberof google.cloud.websecurityscanner.v1alpha.OutdatedLibrary + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + OutdatedLibrary.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.libraryName != null && message.hasOwnProperty("libraryName")) + if (!$util.isString(message.libraryName)) + return "libraryName: string expected"; + if (message.version != null && message.hasOwnProperty("version")) + if (!$util.isString(message.version)) + return "version: string expected"; + if (message.learnMoreUrls != null && message.hasOwnProperty("learnMoreUrls")) { + if (!Array.isArray(message.learnMoreUrls)) + return "learnMoreUrls: array expected"; + for (var i = 0; i < message.learnMoreUrls.length; ++i) + if (!$util.isString(message.learnMoreUrls[i])) + return "learnMoreUrls: string[] expected"; + } + return null; + }; + + /** + * Creates an OutdatedLibrary message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.websecurityscanner.v1alpha.OutdatedLibrary + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.websecurityscanner.v1alpha.OutdatedLibrary} OutdatedLibrary + */ + OutdatedLibrary.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.websecurityscanner.v1alpha.OutdatedLibrary) + return object; + var message = new $root.google.cloud.websecurityscanner.v1alpha.OutdatedLibrary(); + if (object.libraryName != null) + message.libraryName = String(object.libraryName); + if (object.version != null) + message.version = String(object.version); + if (object.learnMoreUrls) { + if (!Array.isArray(object.learnMoreUrls)) + throw TypeError(".google.cloud.websecurityscanner.v1alpha.OutdatedLibrary.learnMoreUrls: array expected"); + message.learnMoreUrls = []; + for (var i = 0; i < object.learnMoreUrls.length; ++i) + message.learnMoreUrls[i] = String(object.learnMoreUrls[i]); + } + return message; + }; + + /** + * Creates a plain object from an OutdatedLibrary message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.websecurityscanner.v1alpha.OutdatedLibrary + * @static + * @param {google.cloud.websecurityscanner.v1alpha.OutdatedLibrary} message OutdatedLibrary + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + OutdatedLibrary.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.learnMoreUrls = []; + if (options.defaults) { + object.libraryName = ""; + object.version = ""; + } + if (message.libraryName != null && message.hasOwnProperty("libraryName")) + object.libraryName = message.libraryName; + if (message.version != null && message.hasOwnProperty("version")) + object.version = message.version; + if (message.learnMoreUrls && message.learnMoreUrls.length) { + object.learnMoreUrls = []; + for (var j = 0; j < message.learnMoreUrls.length; ++j) + object.learnMoreUrls[j] = message.learnMoreUrls[j]; + } + return object; + }; + + /** + * Converts this OutdatedLibrary to JSON. + * @function toJSON + * @memberof google.cloud.websecurityscanner.v1alpha.OutdatedLibrary + * @instance + * @returns {Object.} JSON object + */ + OutdatedLibrary.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for OutdatedLibrary + * @function getTypeUrl + * @memberof google.cloud.websecurityscanner.v1alpha.OutdatedLibrary + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + OutdatedLibrary.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.websecurityscanner.v1alpha.OutdatedLibrary"; + }; + + return OutdatedLibrary; + })(); + + v1alpha.ViolatingResource = (function() { + + /** + * Properties of a ViolatingResource. + * @memberof google.cloud.websecurityscanner.v1alpha + * @interface IViolatingResource + * @property {string|null} [contentType] ViolatingResource contentType + * @property {string|null} [resourceUrl] ViolatingResource resourceUrl + */ + + /** + * Constructs a new ViolatingResource. + * @memberof google.cloud.websecurityscanner.v1alpha + * @classdesc Represents a ViolatingResource. + * @implements IViolatingResource + * @constructor + * @param {google.cloud.websecurityscanner.v1alpha.IViolatingResource=} [properties] Properties to set + */ + function ViolatingResource(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ViolatingResource contentType. + * @member {string} contentType + * @memberof google.cloud.websecurityscanner.v1alpha.ViolatingResource + * @instance + */ + ViolatingResource.prototype.contentType = ""; + + /** + * ViolatingResource resourceUrl. + * @member {string} resourceUrl + * @memberof google.cloud.websecurityscanner.v1alpha.ViolatingResource + * @instance + */ + ViolatingResource.prototype.resourceUrl = ""; + + /** + * Creates a new ViolatingResource instance using the specified properties. + * @function create + * @memberof google.cloud.websecurityscanner.v1alpha.ViolatingResource + * @static + * @param {google.cloud.websecurityscanner.v1alpha.IViolatingResource=} [properties] Properties to set + * @returns {google.cloud.websecurityscanner.v1alpha.ViolatingResource} ViolatingResource instance + */ + ViolatingResource.create = function create(properties) { + return new ViolatingResource(properties); + }; + + /** + * Encodes the specified ViolatingResource message. Does not implicitly {@link google.cloud.websecurityscanner.v1alpha.ViolatingResource.verify|verify} messages. + * @function encode + * @memberof google.cloud.websecurityscanner.v1alpha.ViolatingResource + * @static + * @param {google.cloud.websecurityscanner.v1alpha.IViolatingResource} message ViolatingResource message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ViolatingResource.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.contentType != null && Object.hasOwnProperty.call(message, "contentType")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.contentType); + if (message.resourceUrl != null && Object.hasOwnProperty.call(message, "resourceUrl")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.resourceUrl); + return writer; + }; + + /** + * Encodes the specified ViolatingResource message, length delimited. Does not implicitly {@link google.cloud.websecurityscanner.v1alpha.ViolatingResource.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.websecurityscanner.v1alpha.ViolatingResource + * @static + * @param {google.cloud.websecurityscanner.v1alpha.IViolatingResource} message ViolatingResource message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ViolatingResource.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ViolatingResource message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.websecurityscanner.v1alpha.ViolatingResource + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.websecurityscanner.v1alpha.ViolatingResource} ViolatingResource + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ViolatingResource.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.websecurityscanner.v1alpha.ViolatingResource(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.contentType = reader.string(); + break; + } + case 2: { + message.resourceUrl = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ViolatingResource message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.websecurityscanner.v1alpha.ViolatingResource + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.websecurityscanner.v1alpha.ViolatingResource} ViolatingResource + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ViolatingResource.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ViolatingResource message. + * @function verify + * @memberof google.cloud.websecurityscanner.v1alpha.ViolatingResource + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ViolatingResource.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.contentType != null && message.hasOwnProperty("contentType")) + if (!$util.isString(message.contentType)) + return "contentType: string expected"; + if (message.resourceUrl != null && message.hasOwnProperty("resourceUrl")) + if (!$util.isString(message.resourceUrl)) + return "resourceUrl: string expected"; + return null; + }; + + /** + * Creates a ViolatingResource message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.websecurityscanner.v1alpha.ViolatingResource + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.websecurityscanner.v1alpha.ViolatingResource} ViolatingResource + */ + ViolatingResource.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.websecurityscanner.v1alpha.ViolatingResource) + return object; + var message = new $root.google.cloud.websecurityscanner.v1alpha.ViolatingResource(); + if (object.contentType != null) + message.contentType = String(object.contentType); + if (object.resourceUrl != null) + message.resourceUrl = String(object.resourceUrl); + return message; + }; + + /** + * Creates a plain object from a ViolatingResource message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.websecurityscanner.v1alpha.ViolatingResource + * @static + * @param {google.cloud.websecurityscanner.v1alpha.ViolatingResource} message ViolatingResource + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ViolatingResource.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.contentType = ""; + object.resourceUrl = ""; + } + if (message.contentType != null && message.hasOwnProperty("contentType")) + object.contentType = message.contentType; + if (message.resourceUrl != null && message.hasOwnProperty("resourceUrl")) + object.resourceUrl = message.resourceUrl; + return object; + }; + + /** + * Converts this ViolatingResource to JSON. + * @function toJSON + * @memberof google.cloud.websecurityscanner.v1alpha.ViolatingResource + * @instance + * @returns {Object.} JSON object + */ + ViolatingResource.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ViolatingResource + * @function getTypeUrl + * @memberof google.cloud.websecurityscanner.v1alpha.ViolatingResource + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ViolatingResource.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.websecurityscanner.v1alpha.ViolatingResource"; + }; + + return ViolatingResource; + })(); + + v1alpha.VulnerableParameters = (function() { + + /** + * Properties of a VulnerableParameters. + * @memberof google.cloud.websecurityscanner.v1alpha + * @interface IVulnerableParameters + * @property {Array.|null} [parameterNames] VulnerableParameters parameterNames + */ + + /** + * Constructs a new VulnerableParameters. + * @memberof google.cloud.websecurityscanner.v1alpha + * @classdesc Represents a VulnerableParameters. + * @implements IVulnerableParameters + * @constructor + * @param {google.cloud.websecurityscanner.v1alpha.IVulnerableParameters=} [properties] Properties to set + */ + function VulnerableParameters(properties) { + this.parameterNames = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * VulnerableParameters parameterNames. + * @member {Array.} parameterNames + * @memberof google.cloud.websecurityscanner.v1alpha.VulnerableParameters + * @instance + */ + VulnerableParameters.prototype.parameterNames = $util.emptyArray; + + /** + * Creates a new VulnerableParameters instance using the specified properties. + * @function create + * @memberof google.cloud.websecurityscanner.v1alpha.VulnerableParameters + * @static + * @param {google.cloud.websecurityscanner.v1alpha.IVulnerableParameters=} [properties] Properties to set + * @returns {google.cloud.websecurityscanner.v1alpha.VulnerableParameters} VulnerableParameters instance + */ + VulnerableParameters.create = function create(properties) { + return new VulnerableParameters(properties); + }; + + /** + * Encodes the specified VulnerableParameters message. Does not implicitly {@link google.cloud.websecurityscanner.v1alpha.VulnerableParameters.verify|verify} messages. + * @function encode + * @memberof google.cloud.websecurityscanner.v1alpha.VulnerableParameters + * @static + * @param {google.cloud.websecurityscanner.v1alpha.IVulnerableParameters} message VulnerableParameters message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + VulnerableParameters.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.parameterNames != null && message.parameterNames.length) + for (var i = 0; i < message.parameterNames.length; ++i) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.parameterNames[i]); + return writer; + }; + + /** + * Encodes the specified VulnerableParameters message, length delimited. Does not implicitly {@link google.cloud.websecurityscanner.v1alpha.VulnerableParameters.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.websecurityscanner.v1alpha.VulnerableParameters + * @static + * @param {google.cloud.websecurityscanner.v1alpha.IVulnerableParameters} message VulnerableParameters message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + VulnerableParameters.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a VulnerableParameters message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.websecurityscanner.v1alpha.VulnerableParameters + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.websecurityscanner.v1alpha.VulnerableParameters} VulnerableParameters + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + VulnerableParameters.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.websecurityscanner.v1alpha.VulnerableParameters(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.parameterNames && message.parameterNames.length)) + message.parameterNames = []; + message.parameterNames.push(reader.string()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a VulnerableParameters message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.websecurityscanner.v1alpha.VulnerableParameters + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.websecurityscanner.v1alpha.VulnerableParameters} VulnerableParameters + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + VulnerableParameters.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a VulnerableParameters message. + * @function verify + * @memberof google.cloud.websecurityscanner.v1alpha.VulnerableParameters + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + VulnerableParameters.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.parameterNames != null && message.hasOwnProperty("parameterNames")) { + if (!Array.isArray(message.parameterNames)) + return "parameterNames: array expected"; + for (var i = 0; i < message.parameterNames.length; ++i) + if (!$util.isString(message.parameterNames[i])) + return "parameterNames: string[] expected"; + } + return null; + }; + + /** + * Creates a VulnerableParameters message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.websecurityscanner.v1alpha.VulnerableParameters + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.websecurityscanner.v1alpha.VulnerableParameters} VulnerableParameters + */ + VulnerableParameters.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.websecurityscanner.v1alpha.VulnerableParameters) + return object; + var message = new $root.google.cloud.websecurityscanner.v1alpha.VulnerableParameters(); + if (object.parameterNames) { + if (!Array.isArray(object.parameterNames)) + throw TypeError(".google.cloud.websecurityscanner.v1alpha.VulnerableParameters.parameterNames: array expected"); + message.parameterNames = []; + for (var i = 0; i < object.parameterNames.length; ++i) + message.parameterNames[i] = String(object.parameterNames[i]); + } + return message; + }; + + /** + * Creates a plain object from a VulnerableParameters message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.websecurityscanner.v1alpha.VulnerableParameters + * @static + * @param {google.cloud.websecurityscanner.v1alpha.VulnerableParameters} message VulnerableParameters + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + VulnerableParameters.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.parameterNames = []; + if (message.parameterNames && message.parameterNames.length) { + object.parameterNames = []; + for (var j = 0; j < message.parameterNames.length; ++j) + object.parameterNames[j] = message.parameterNames[j]; + } + return object; + }; + + /** + * Converts this VulnerableParameters to JSON. + * @function toJSON + * @memberof google.cloud.websecurityscanner.v1alpha.VulnerableParameters + * @instance + * @returns {Object.} JSON object + */ + VulnerableParameters.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for VulnerableParameters + * @function getTypeUrl + * @memberof google.cloud.websecurityscanner.v1alpha.VulnerableParameters + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + VulnerableParameters.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.websecurityscanner.v1alpha.VulnerableParameters"; + }; + + return VulnerableParameters; + })(); + + v1alpha.VulnerableHeaders = (function() { + + /** + * Properties of a VulnerableHeaders. + * @memberof google.cloud.websecurityscanner.v1alpha + * @interface IVulnerableHeaders + * @property {Array.|null} [headers] VulnerableHeaders headers + * @property {Array.|null} [missingHeaders] VulnerableHeaders missingHeaders + */ + + /** + * Constructs a new VulnerableHeaders. + * @memberof google.cloud.websecurityscanner.v1alpha + * @classdesc Represents a VulnerableHeaders. + * @implements IVulnerableHeaders + * @constructor + * @param {google.cloud.websecurityscanner.v1alpha.IVulnerableHeaders=} [properties] Properties to set + */ + function VulnerableHeaders(properties) { + this.headers = []; + this.missingHeaders = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * VulnerableHeaders headers. + * @member {Array.} headers + * @memberof google.cloud.websecurityscanner.v1alpha.VulnerableHeaders + * @instance + */ + VulnerableHeaders.prototype.headers = $util.emptyArray; + + /** + * VulnerableHeaders missingHeaders. + * @member {Array.} missingHeaders + * @memberof google.cloud.websecurityscanner.v1alpha.VulnerableHeaders + * @instance + */ + VulnerableHeaders.prototype.missingHeaders = $util.emptyArray; + + /** + * Creates a new VulnerableHeaders instance using the specified properties. + * @function create + * @memberof google.cloud.websecurityscanner.v1alpha.VulnerableHeaders + * @static + * @param {google.cloud.websecurityscanner.v1alpha.IVulnerableHeaders=} [properties] Properties to set + * @returns {google.cloud.websecurityscanner.v1alpha.VulnerableHeaders} VulnerableHeaders instance + */ + VulnerableHeaders.create = function create(properties) { + return new VulnerableHeaders(properties); + }; + + /** + * Encodes the specified VulnerableHeaders message. Does not implicitly {@link google.cloud.websecurityscanner.v1alpha.VulnerableHeaders.verify|verify} messages. + * @function encode + * @memberof google.cloud.websecurityscanner.v1alpha.VulnerableHeaders + * @static + * @param {google.cloud.websecurityscanner.v1alpha.IVulnerableHeaders} message VulnerableHeaders message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + VulnerableHeaders.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.headers != null && message.headers.length) + for (var i = 0; i < message.headers.length; ++i) + $root.google.cloud.websecurityscanner.v1alpha.VulnerableHeaders.Header.encode(message.headers[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.missingHeaders != null && message.missingHeaders.length) + for (var i = 0; i < message.missingHeaders.length; ++i) + $root.google.cloud.websecurityscanner.v1alpha.VulnerableHeaders.Header.encode(message.missingHeaders[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified VulnerableHeaders message, length delimited. Does not implicitly {@link google.cloud.websecurityscanner.v1alpha.VulnerableHeaders.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.websecurityscanner.v1alpha.VulnerableHeaders + * @static + * @param {google.cloud.websecurityscanner.v1alpha.IVulnerableHeaders} message VulnerableHeaders message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + VulnerableHeaders.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a VulnerableHeaders message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.websecurityscanner.v1alpha.VulnerableHeaders + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.websecurityscanner.v1alpha.VulnerableHeaders} VulnerableHeaders + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + VulnerableHeaders.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.websecurityscanner.v1alpha.VulnerableHeaders(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.headers && message.headers.length)) + message.headers = []; + message.headers.push($root.google.cloud.websecurityscanner.v1alpha.VulnerableHeaders.Header.decode(reader, reader.uint32())); + break; + } + case 2: { + if (!(message.missingHeaders && message.missingHeaders.length)) + message.missingHeaders = []; + message.missingHeaders.push($root.google.cloud.websecurityscanner.v1alpha.VulnerableHeaders.Header.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a VulnerableHeaders message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.websecurityscanner.v1alpha.VulnerableHeaders + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.websecurityscanner.v1alpha.VulnerableHeaders} VulnerableHeaders + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + VulnerableHeaders.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a VulnerableHeaders message. + * @function verify + * @memberof google.cloud.websecurityscanner.v1alpha.VulnerableHeaders + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + VulnerableHeaders.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.headers != null && message.hasOwnProperty("headers")) { + if (!Array.isArray(message.headers)) + return "headers: array expected"; + for (var i = 0; i < message.headers.length; ++i) { + var error = $root.google.cloud.websecurityscanner.v1alpha.VulnerableHeaders.Header.verify(message.headers[i]); + if (error) + return "headers." + error; + } + } + if (message.missingHeaders != null && message.hasOwnProperty("missingHeaders")) { + if (!Array.isArray(message.missingHeaders)) + return "missingHeaders: array expected"; + for (var i = 0; i < message.missingHeaders.length; ++i) { + var error = $root.google.cloud.websecurityscanner.v1alpha.VulnerableHeaders.Header.verify(message.missingHeaders[i]); + if (error) + return "missingHeaders." + error; + } + } + return null; + }; + + /** + * Creates a VulnerableHeaders message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.websecurityscanner.v1alpha.VulnerableHeaders + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.websecurityscanner.v1alpha.VulnerableHeaders} VulnerableHeaders + */ + VulnerableHeaders.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.websecurityscanner.v1alpha.VulnerableHeaders) + return object; + var message = new $root.google.cloud.websecurityscanner.v1alpha.VulnerableHeaders(); + if (object.headers) { + if (!Array.isArray(object.headers)) + throw TypeError(".google.cloud.websecurityscanner.v1alpha.VulnerableHeaders.headers: array expected"); + message.headers = []; + for (var i = 0; i < object.headers.length; ++i) { + if (typeof object.headers[i] !== "object") + throw TypeError(".google.cloud.websecurityscanner.v1alpha.VulnerableHeaders.headers: object expected"); + message.headers[i] = $root.google.cloud.websecurityscanner.v1alpha.VulnerableHeaders.Header.fromObject(object.headers[i]); + } + } + if (object.missingHeaders) { + if (!Array.isArray(object.missingHeaders)) + throw TypeError(".google.cloud.websecurityscanner.v1alpha.VulnerableHeaders.missingHeaders: array expected"); + message.missingHeaders = []; + for (var i = 0; i < object.missingHeaders.length; ++i) { + if (typeof object.missingHeaders[i] !== "object") + throw TypeError(".google.cloud.websecurityscanner.v1alpha.VulnerableHeaders.missingHeaders: object expected"); + message.missingHeaders[i] = $root.google.cloud.websecurityscanner.v1alpha.VulnerableHeaders.Header.fromObject(object.missingHeaders[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a VulnerableHeaders message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.websecurityscanner.v1alpha.VulnerableHeaders + * @static + * @param {google.cloud.websecurityscanner.v1alpha.VulnerableHeaders} message VulnerableHeaders + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + VulnerableHeaders.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.headers = []; + object.missingHeaders = []; + } + if (message.headers && message.headers.length) { + object.headers = []; + for (var j = 0; j < message.headers.length; ++j) + object.headers[j] = $root.google.cloud.websecurityscanner.v1alpha.VulnerableHeaders.Header.toObject(message.headers[j], options); + } + if (message.missingHeaders && message.missingHeaders.length) { + object.missingHeaders = []; + for (var j = 0; j < message.missingHeaders.length; ++j) + object.missingHeaders[j] = $root.google.cloud.websecurityscanner.v1alpha.VulnerableHeaders.Header.toObject(message.missingHeaders[j], options); + } + return object; + }; + + /** + * Converts this VulnerableHeaders to JSON. + * @function toJSON + * @memberof google.cloud.websecurityscanner.v1alpha.VulnerableHeaders + * @instance + * @returns {Object.} JSON object + */ + VulnerableHeaders.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for VulnerableHeaders + * @function getTypeUrl + * @memberof google.cloud.websecurityscanner.v1alpha.VulnerableHeaders + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + VulnerableHeaders.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.websecurityscanner.v1alpha.VulnerableHeaders"; + }; + + VulnerableHeaders.Header = (function() { + + /** + * Properties of a Header. + * @memberof google.cloud.websecurityscanner.v1alpha.VulnerableHeaders + * @interface IHeader + * @property {string|null} [name] Header name + * @property {string|null} [value] Header value + */ + + /** + * Constructs a new Header. + * @memberof google.cloud.websecurityscanner.v1alpha.VulnerableHeaders + * @classdesc Represents a Header. + * @implements IHeader + * @constructor + * @param {google.cloud.websecurityscanner.v1alpha.VulnerableHeaders.IHeader=} [properties] Properties to set + */ + function Header(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Header name. + * @member {string} name + * @memberof google.cloud.websecurityscanner.v1alpha.VulnerableHeaders.Header + * @instance + */ + Header.prototype.name = ""; + + /** + * Header value. + * @member {string} value + * @memberof google.cloud.websecurityscanner.v1alpha.VulnerableHeaders.Header + * @instance + */ + Header.prototype.value = ""; + + /** + * Creates a new Header instance using the specified properties. + * @function create + * @memberof google.cloud.websecurityscanner.v1alpha.VulnerableHeaders.Header + * @static + * @param {google.cloud.websecurityscanner.v1alpha.VulnerableHeaders.IHeader=} [properties] Properties to set + * @returns {google.cloud.websecurityscanner.v1alpha.VulnerableHeaders.Header} Header instance + */ + Header.create = function create(properties) { + return new Header(properties); + }; + + /** + * Encodes the specified Header message. Does not implicitly {@link google.cloud.websecurityscanner.v1alpha.VulnerableHeaders.Header.verify|verify} messages. + * @function encode + * @memberof google.cloud.websecurityscanner.v1alpha.VulnerableHeaders.Header + * @static + * @param {google.cloud.websecurityscanner.v1alpha.VulnerableHeaders.IHeader} message Header message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Header.encode = function encode(message, writer) { + if (!writer) + 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 Header message, length delimited. Does not implicitly {@link google.cloud.websecurityscanner.v1alpha.VulnerableHeaders.Header.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.websecurityscanner.v1alpha.VulnerableHeaders.Header + * @static + * @param {google.cloud.websecurityscanner.v1alpha.VulnerableHeaders.IHeader} message Header message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Header.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Header message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.websecurityscanner.v1alpha.VulnerableHeaders.Header + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.websecurityscanner.v1alpha.VulnerableHeaders.Header} Header + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Header.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.websecurityscanner.v1alpha.VulnerableHeaders.Header(); + 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 Header message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.websecurityscanner.v1alpha.VulnerableHeaders.Header + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.websecurityscanner.v1alpha.VulnerableHeaders.Header} Header + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Header.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Header message. + * @function verify + * @memberof google.cloud.websecurityscanner.v1alpha.VulnerableHeaders.Header + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Header.verify = function verify(message) { + if (typeof message !== "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 Header message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.websecurityscanner.v1alpha.VulnerableHeaders.Header + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.websecurityscanner.v1alpha.VulnerableHeaders.Header} Header + */ + Header.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.websecurityscanner.v1alpha.VulnerableHeaders.Header) + return object; + var message = new $root.google.cloud.websecurityscanner.v1alpha.VulnerableHeaders.Header(); + 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 Header message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.websecurityscanner.v1alpha.VulnerableHeaders.Header + * @static + * @param {google.cloud.websecurityscanner.v1alpha.VulnerableHeaders.Header} message Header + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Header.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 Header to JSON. + * @function toJSON + * @memberof google.cloud.websecurityscanner.v1alpha.VulnerableHeaders.Header + * @instance + * @returns {Object.} JSON object + */ + Header.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Header + * @function getTypeUrl + * @memberof google.cloud.websecurityscanner.v1alpha.VulnerableHeaders.Header + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Header.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.websecurityscanner.v1alpha.VulnerableHeaders.Header"; + }; + + return Header; + })(); + + return VulnerableHeaders; + })(); + + v1alpha.Xss = (function() { + + /** + * Properties of a Xss. + * @memberof google.cloud.websecurityscanner.v1alpha + * @interface IXss + * @property {Array.|null} [stackTraces] Xss stackTraces + * @property {string|null} [errorMessage] Xss errorMessage + */ + + /** + * Constructs a new Xss. + * @memberof google.cloud.websecurityscanner.v1alpha + * @classdesc Represents a Xss. + * @implements IXss + * @constructor + * @param {google.cloud.websecurityscanner.v1alpha.IXss=} [properties] Properties to set + */ + function Xss(properties) { + this.stackTraces = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Xss stackTraces. + * @member {Array.} stackTraces + * @memberof google.cloud.websecurityscanner.v1alpha.Xss + * @instance + */ + Xss.prototype.stackTraces = $util.emptyArray; + + /** + * Xss errorMessage. + * @member {string} errorMessage + * @memberof google.cloud.websecurityscanner.v1alpha.Xss + * @instance + */ + Xss.prototype.errorMessage = ""; + + /** + * Creates a new Xss instance using the specified properties. + * @function create + * @memberof google.cloud.websecurityscanner.v1alpha.Xss + * @static + * @param {google.cloud.websecurityscanner.v1alpha.IXss=} [properties] Properties to set + * @returns {google.cloud.websecurityscanner.v1alpha.Xss} Xss instance + */ + Xss.create = function create(properties) { + return new Xss(properties); + }; + + /** + * Encodes the specified Xss message. Does not implicitly {@link google.cloud.websecurityscanner.v1alpha.Xss.verify|verify} messages. + * @function encode + * @memberof google.cloud.websecurityscanner.v1alpha.Xss + * @static + * @param {google.cloud.websecurityscanner.v1alpha.IXss} message Xss message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Xss.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.stackTraces != null && message.stackTraces.length) + for (var i = 0; i < message.stackTraces.length; ++i) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.stackTraces[i]); + if (message.errorMessage != null && Object.hasOwnProperty.call(message, "errorMessage")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.errorMessage); + return writer; + }; + + /** + * Encodes the specified Xss message, length delimited. Does not implicitly {@link google.cloud.websecurityscanner.v1alpha.Xss.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.websecurityscanner.v1alpha.Xss + * @static + * @param {google.cloud.websecurityscanner.v1alpha.IXss} message Xss message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Xss.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Xss message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.websecurityscanner.v1alpha.Xss + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.websecurityscanner.v1alpha.Xss} Xss + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Xss.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.websecurityscanner.v1alpha.Xss(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.stackTraces && message.stackTraces.length)) + message.stackTraces = []; + message.stackTraces.push(reader.string()); + break; + } + case 2: { + message.errorMessage = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Xss message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.websecurityscanner.v1alpha.Xss + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.websecurityscanner.v1alpha.Xss} Xss + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Xss.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Xss message. + * @function verify + * @memberof google.cloud.websecurityscanner.v1alpha.Xss + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Xss.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.stackTraces != null && message.hasOwnProperty("stackTraces")) { + if (!Array.isArray(message.stackTraces)) + return "stackTraces: array expected"; + for (var i = 0; i < message.stackTraces.length; ++i) + if (!$util.isString(message.stackTraces[i])) + return "stackTraces: string[] expected"; + } + if (message.errorMessage != null && message.hasOwnProperty("errorMessage")) + if (!$util.isString(message.errorMessage)) + return "errorMessage: string expected"; + return null; + }; + + /** + * Creates a Xss message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.websecurityscanner.v1alpha.Xss + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.websecurityscanner.v1alpha.Xss} Xss + */ + Xss.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.websecurityscanner.v1alpha.Xss) + return object; + var message = new $root.google.cloud.websecurityscanner.v1alpha.Xss(); + if (object.stackTraces) { + if (!Array.isArray(object.stackTraces)) + throw TypeError(".google.cloud.websecurityscanner.v1alpha.Xss.stackTraces: array expected"); + message.stackTraces = []; + for (var i = 0; i < object.stackTraces.length; ++i) + message.stackTraces[i] = String(object.stackTraces[i]); + } + if (object.errorMessage != null) + message.errorMessage = String(object.errorMessage); + return message; + }; + + /** + * Creates a plain object from a Xss message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.websecurityscanner.v1alpha.Xss + * @static + * @param {google.cloud.websecurityscanner.v1alpha.Xss} message Xss + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Xss.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.stackTraces = []; + if (options.defaults) + object.errorMessage = ""; + if (message.stackTraces && message.stackTraces.length) { + object.stackTraces = []; + for (var j = 0; j < message.stackTraces.length; ++j) + object.stackTraces[j] = message.stackTraces[j]; + } + if (message.errorMessage != null && message.hasOwnProperty("errorMessage")) + object.errorMessage = message.errorMessage; + return object; + }; + + /** + * Converts this Xss to JSON. + * @function toJSON + * @memberof google.cloud.websecurityscanner.v1alpha.Xss + * @instance + * @returns {Object.} JSON object + */ + Xss.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Xss + * @function getTypeUrl + * @memberof google.cloud.websecurityscanner.v1alpha.Xss + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Xss.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.websecurityscanner.v1alpha.Xss"; + }; + + return Xss; + })(); + + v1alpha.FindingTypeStats = (function() { + + /** + * Properties of a FindingTypeStats. + * @memberof google.cloud.websecurityscanner.v1alpha + * @interface IFindingTypeStats + * @property {google.cloud.websecurityscanner.v1alpha.Finding.FindingType|null} [findingType] FindingTypeStats findingType + * @property {number|null} [findingCount] FindingTypeStats findingCount + */ + + /** + * Constructs a new FindingTypeStats. + * @memberof google.cloud.websecurityscanner.v1alpha + * @classdesc Represents a FindingTypeStats. + * @implements IFindingTypeStats + * @constructor + * @param {google.cloud.websecurityscanner.v1alpha.IFindingTypeStats=} [properties] Properties to set + */ + function FindingTypeStats(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * FindingTypeStats findingType. + * @member {google.cloud.websecurityscanner.v1alpha.Finding.FindingType} findingType + * @memberof google.cloud.websecurityscanner.v1alpha.FindingTypeStats + * @instance + */ + FindingTypeStats.prototype.findingType = 0; + + /** + * FindingTypeStats findingCount. + * @member {number} findingCount + * @memberof google.cloud.websecurityscanner.v1alpha.FindingTypeStats + * @instance + */ + FindingTypeStats.prototype.findingCount = 0; + + /** + * Creates a new FindingTypeStats instance using the specified properties. + * @function create + * @memberof google.cloud.websecurityscanner.v1alpha.FindingTypeStats + * @static + * @param {google.cloud.websecurityscanner.v1alpha.IFindingTypeStats=} [properties] Properties to set + * @returns {google.cloud.websecurityscanner.v1alpha.FindingTypeStats} FindingTypeStats instance + */ + FindingTypeStats.create = function create(properties) { + return new FindingTypeStats(properties); + }; + + /** + * Encodes the specified FindingTypeStats message. Does not implicitly {@link google.cloud.websecurityscanner.v1alpha.FindingTypeStats.verify|verify} messages. + * @function encode + * @memberof google.cloud.websecurityscanner.v1alpha.FindingTypeStats + * @static + * @param {google.cloud.websecurityscanner.v1alpha.IFindingTypeStats} message FindingTypeStats message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FindingTypeStats.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.findingType != null && Object.hasOwnProperty.call(message, "findingType")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.findingType); + if (message.findingCount != null && Object.hasOwnProperty.call(message, "findingCount")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.findingCount); + return writer; + }; + + /** + * Encodes the specified FindingTypeStats message, length delimited. Does not implicitly {@link google.cloud.websecurityscanner.v1alpha.FindingTypeStats.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.websecurityscanner.v1alpha.FindingTypeStats + * @static + * @param {google.cloud.websecurityscanner.v1alpha.IFindingTypeStats} message FindingTypeStats message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FindingTypeStats.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a FindingTypeStats message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.websecurityscanner.v1alpha.FindingTypeStats + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.websecurityscanner.v1alpha.FindingTypeStats} FindingTypeStats + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FindingTypeStats.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.websecurityscanner.v1alpha.FindingTypeStats(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.findingType = reader.int32(); + break; + } + case 2: { + message.findingCount = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a FindingTypeStats message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.websecurityscanner.v1alpha.FindingTypeStats + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.websecurityscanner.v1alpha.FindingTypeStats} FindingTypeStats + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FindingTypeStats.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a FindingTypeStats message. + * @function verify + * @memberof google.cloud.websecurityscanner.v1alpha.FindingTypeStats + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + FindingTypeStats.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.findingType != null && message.hasOwnProperty("findingType")) + switch (message.findingType) { + default: + return "findingType: enum value expected"; + case 0: + case 1: + case 2: + case 5: + case 3: + case 4: + case 6: + case 7: + case 8: + case 9: + case 10: + case 11: + break; + } + if (message.findingCount != null && message.hasOwnProperty("findingCount")) + if (!$util.isInteger(message.findingCount)) + return "findingCount: integer expected"; + return null; + }; + + /** + * Creates a FindingTypeStats message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.websecurityscanner.v1alpha.FindingTypeStats + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.websecurityscanner.v1alpha.FindingTypeStats} FindingTypeStats + */ + FindingTypeStats.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.websecurityscanner.v1alpha.FindingTypeStats) + return object; + var message = new $root.google.cloud.websecurityscanner.v1alpha.FindingTypeStats(); + switch (object.findingType) { + default: + if (typeof object.findingType === "number") { + message.findingType = object.findingType; + break; + } + break; + case "FINDING_TYPE_UNSPECIFIED": + case 0: + message.findingType = 0; + break; + case "MIXED_CONTENT": + case 1: + message.findingType = 1; + break; + case "OUTDATED_LIBRARY": + case 2: + message.findingType = 2; + break; + case "ROSETTA_FLASH": + case 5: + message.findingType = 5; + break; + case "XSS_CALLBACK": + case 3: + message.findingType = 3; + break; + case "XSS_ERROR": + case 4: + message.findingType = 4; + break; + case "CLEAR_TEXT_PASSWORD": + case 6: + message.findingType = 6; + break; + case "INVALID_CONTENT_TYPE": + case 7: + message.findingType = 7; + break; + case "XSS_ANGULAR_CALLBACK": + case 8: + message.findingType = 8; + break; + case "INVALID_HEADER": + case 9: + message.findingType = 9; + break; + case "MISSPELLED_SECURITY_HEADER_NAME": + case 10: + message.findingType = 10; + break; + case "MISMATCHING_SECURITY_HEADER_VALUES": + case 11: + message.findingType = 11; + break; + } + if (object.findingCount != null) + message.findingCount = object.findingCount | 0; + return message; + }; + + /** + * Creates a plain object from a FindingTypeStats message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.websecurityscanner.v1alpha.FindingTypeStats + * @static + * @param {google.cloud.websecurityscanner.v1alpha.FindingTypeStats} message FindingTypeStats + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + FindingTypeStats.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.findingType = options.enums === String ? "FINDING_TYPE_UNSPECIFIED" : 0; + object.findingCount = 0; + } + if (message.findingType != null && message.hasOwnProperty("findingType")) + object.findingType = options.enums === String ? $root.google.cloud.websecurityscanner.v1alpha.Finding.FindingType[message.findingType] === undefined ? message.findingType : $root.google.cloud.websecurityscanner.v1alpha.Finding.FindingType[message.findingType] : message.findingType; + if (message.findingCount != null && message.hasOwnProperty("findingCount")) + object.findingCount = message.findingCount; + return object; + }; + + /** + * Converts this FindingTypeStats to JSON. + * @function toJSON + * @memberof google.cloud.websecurityscanner.v1alpha.FindingTypeStats + * @instance + * @returns {Object.} JSON object + */ + FindingTypeStats.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for FindingTypeStats + * @function getTypeUrl + * @memberof google.cloud.websecurityscanner.v1alpha.FindingTypeStats + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FindingTypeStats.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.websecurityscanner.v1alpha.FindingTypeStats"; + }; + + return FindingTypeStats; + })(); + + v1alpha.ScanConfig = (function() { + + /** + * Properties of a ScanConfig. + * @memberof google.cloud.websecurityscanner.v1alpha + * @interface IScanConfig + * @property {string|null} [name] ScanConfig name + * @property {string|null} [displayName] ScanConfig displayName + * @property {number|null} [maxQps] ScanConfig maxQps + * @property {Array.|null} [startingUrls] ScanConfig startingUrls + * @property {google.cloud.websecurityscanner.v1alpha.ScanConfig.IAuthentication|null} [authentication] ScanConfig authentication + * @property {google.cloud.websecurityscanner.v1alpha.ScanConfig.UserAgent|null} [userAgent] ScanConfig userAgent + * @property {Array.|null} [blacklistPatterns] ScanConfig blacklistPatterns + * @property {google.cloud.websecurityscanner.v1alpha.ScanConfig.ISchedule|null} [schedule] ScanConfig schedule + * @property {Array.|null} [targetPlatforms] ScanConfig targetPlatforms + * @property {google.cloud.websecurityscanner.v1alpha.IScanRun|null} [latestRun] ScanConfig latestRun + */ + + /** + * Constructs a new ScanConfig. + * @memberof google.cloud.websecurityscanner.v1alpha + * @classdesc Represents a ScanConfig. + * @implements IScanConfig + * @constructor + * @param {google.cloud.websecurityscanner.v1alpha.IScanConfig=} [properties] Properties to set + */ + function ScanConfig(properties) { + this.startingUrls = []; + this.blacklistPatterns = []; + this.targetPlatforms = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ScanConfig name. + * @member {string} name + * @memberof google.cloud.websecurityscanner.v1alpha.ScanConfig + * @instance + */ + ScanConfig.prototype.name = ""; + + /** + * ScanConfig displayName. + * @member {string} displayName + * @memberof google.cloud.websecurityscanner.v1alpha.ScanConfig + * @instance + */ + ScanConfig.prototype.displayName = ""; + + /** + * ScanConfig maxQps. + * @member {number} maxQps + * @memberof google.cloud.websecurityscanner.v1alpha.ScanConfig + * @instance + */ + ScanConfig.prototype.maxQps = 0; + + /** + * ScanConfig startingUrls. + * @member {Array.} startingUrls + * @memberof google.cloud.websecurityscanner.v1alpha.ScanConfig + * @instance + */ + ScanConfig.prototype.startingUrls = $util.emptyArray; + + /** + * ScanConfig authentication. + * @member {google.cloud.websecurityscanner.v1alpha.ScanConfig.IAuthentication|null|undefined} authentication + * @memberof google.cloud.websecurityscanner.v1alpha.ScanConfig + * @instance + */ + ScanConfig.prototype.authentication = null; + + /** + * ScanConfig userAgent. + * @member {google.cloud.websecurityscanner.v1alpha.ScanConfig.UserAgent} userAgent + * @memberof google.cloud.websecurityscanner.v1alpha.ScanConfig + * @instance + */ + ScanConfig.prototype.userAgent = 0; + + /** + * ScanConfig blacklistPatterns. + * @member {Array.} blacklistPatterns + * @memberof google.cloud.websecurityscanner.v1alpha.ScanConfig + * @instance + */ + ScanConfig.prototype.blacklistPatterns = $util.emptyArray; + + /** + * ScanConfig schedule. + * @member {google.cloud.websecurityscanner.v1alpha.ScanConfig.ISchedule|null|undefined} schedule + * @memberof google.cloud.websecurityscanner.v1alpha.ScanConfig + * @instance + */ + ScanConfig.prototype.schedule = null; + + /** + * ScanConfig targetPlatforms. + * @member {Array.} targetPlatforms + * @memberof google.cloud.websecurityscanner.v1alpha.ScanConfig + * @instance + */ + ScanConfig.prototype.targetPlatforms = $util.emptyArray; + + /** + * ScanConfig latestRun. + * @member {google.cloud.websecurityscanner.v1alpha.IScanRun|null|undefined} latestRun + * @memberof google.cloud.websecurityscanner.v1alpha.ScanConfig + * @instance + */ + ScanConfig.prototype.latestRun = null; + + /** + * Creates a new ScanConfig instance using the specified properties. + * @function create + * @memberof google.cloud.websecurityscanner.v1alpha.ScanConfig + * @static + * @param {google.cloud.websecurityscanner.v1alpha.IScanConfig=} [properties] Properties to set + * @returns {google.cloud.websecurityscanner.v1alpha.ScanConfig} ScanConfig instance + */ + ScanConfig.create = function create(properties) { + return new ScanConfig(properties); + }; + + /** + * Encodes the specified ScanConfig message. Does not implicitly {@link google.cloud.websecurityscanner.v1alpha.ScanConfig.verify|verify} messages. + * @function encode + * @memberof google.cloud.websecurityscanner.v1alpha.ScanConfig + * @static + * @param {google.cloud.websecurityscanner.v1alpha.IScanConfig} message ScanConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ScanConfig.encode = function encode(message, writer) { + if (!writer) + 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.maxQps != null && Object.hasOwnProperty.call(message, "maxQps")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.maxQps); + if (message.startingUrls != null && message.startingUrls.length) + for (var i = 0; i < message.startingUrls.length; ++i) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.startingUrls[i]); + if (message.authentication != null && Object.hasOwnProperty.call(message, "authentication")) + $root.google.cloud.websecurityscanner.v1alpha.ScanConfig.Authentication.encode(message.authentication, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.userAgent != null && Object.hasOwnProperty.call(message, "userAgent")) + writer.uint32(/* id 6, wireType 0 =*/48).int32(message.userAgent); + if (message.blacklistPatterns != null && message.blacklistPatterns.length) + for (var i = 0; i < message.blacklistPatterns.length; ++i) + writer.uint32(/* id 7, wireType 2 =*/58).string(message.blacklistPatterns[i]); + if (message.schedule != null && Object.hasOwnProperty.call(message, "schedule")) + $root.google.cloud.websecurityscanner.v1alpha.ScanConfig.Schedule.encode(message.schedule, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); + if (message.targetPlatforms != null && message.targetPlatforms.length) { + writer.uint32(/* id 9, wireType 2 =*/74).fork(); + for (var i = 0; i < message.targetPlatforms.length; ++i) + writer.int32(message.targetPlatforms[i]); + writer.ldelim(); + } + if (message.latestRun != null && Object.hasOwnProperty.call(message, "latestRun")) + $root.google.cloud.websecurityscanner.v1alpha.ScanRun.encode(message.latestRun, writer.uint32(/* id 11, wireType 2 =*/90).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified ScanConfig message, length delimited. Does not implicitly {@link google.cloud.websecurityscanner.v1alpha.ScanConfig.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.websecurityscanner.v1alpha.ScanConfig + * @static + * @param {google.cloud.websecurityscanner.v1alpha.IScanConfig} message ScanConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ScanConfig.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ScanConfig message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.websecurityscanner.v1alpha.ScanConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.websecurityscanner.v1alpha.ScanConfig} ScanConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ScanConfig.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.websecurityscanner.v1alpha.ScanConfig(); + 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.maxQps = reader.int32(); + break; + } + case 4: { + if (!(message.startingUrls && message.startingUrls.length)) + message.startingUrls = []; + message.startingUrls.push(reader.string()); + break; + } + case 5: { + message.authentication = $root.google.cloud.websecurityscanner.v1alpha.ScanConfig.Authentication.decode(reader, reader.uint32()); + break; + } + case 6: { + message.userAgent = reader.int32(); + break; + } + case 7: { + if (!(message.blacklistPatterns && message.blacklistPatterns.length)) + message.blacklistPatterns = []; + message.blacklistPatterns.push(reader.string()); + break; + } + case 8: { + message.schedule = $root.google.cloud.websecurityscanner.v1alpha.ScanConfig.Schedule.decode(reader, reader.uint32()); + break; + } + case 9: { + if (!(message.targetPlatforms && message.targetPlatforms.length)) + message.targetPlatforms = []; + if ((tag & 7) === 2) { + var end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) + message.targetPlatforms.push(reader.int32()); + } else + message.targetPlatforms.push(reader.int32()); + break; + } + case 11: { + message.latestRun = $root.google.cloud.websecurityscanner.v1alpha.ScanRun.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ScanConfig message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.websecurityscanner.v1alpha.ScanConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.websecurityscanner.v1alpha.ScanConfig} ScanConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ScanConfig.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ScanConfig message. + * @function verify + * @memberof google.cloud.websecurityscanner.v1alpha.ScanConfig + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ScanConfig.verify = function verify(message) { + if (typeof message !== "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.maxQps != null && message.hasOwnProperty("maxQps")) + if (!$util.isInteger(message.maxQps)) + return "maxQps: integer expected"; + if (message.startingUrls != null && message.hasOwnProperty("startingUrls")) { + if (!Array.isArray(message.startingUrls)) + return "startingUrls: array expected"; + for (var i = 0; i < message.startingUrls.length; ++i) + if (!$util.isString(message.startingUrls[i])) + return "startingUrls: string[] expected"; + } + if (message.authentication != null && message.hasOwnProperty("authentication")) { + var error = $root.google.cloud.websecurityscanner.v1alpha.ScanConfig.Authentication.verify(message.authentication); + if (error) + return "authentication." + error; + } + if (message.userAgent != null && message.hasOwnProperty("userAgent")) + switch (message.userAgent) { + default: + return "userAgent: enum value expected"; + case 0: + case 1: + case 2: + case 3: + break; + } + if (message.blacklistPatterns != null && message.hasOwnProperty("blacklistPatterns")) { + if (!Array.isArray(message.blacklistPatterns)) + return "blacklistPatterns: array expected"; + for (var i = 0; i < message.blacklistPatterns.length; ++i) + if (!$util.isString(message.blacklistPatterns[i])) + return "blacklistPatterns: string[] expected"; + } + if (message.schedule != null && message.hasOwnProperty("schedule")) { + var error = $root.google.cloud.websecurityscanner.v1alpha.ScanConfig.Schedule.verify(message.schedule); + if (error) + return "schedule." + error; + } + if (message.targetPlatforms != null && message.hasOwnProperty("targetPlatforms")) { + if (!Array.isArray(message.targetPlatforms)) + return "targetPlatforms: array expected"; + for (var i = 0; i < message.targetPlatforms.length; ++i) + switch (message.targetPlatforms[i]) { + default: + return "targetPlatforms: enum value[] expected"; + case 0: + case 1: + case 2: + break; + } + } + if (message.latestRun != null && message.hasOwnProperty("latestRun")) { + var error = $root.google.cloud.websecurityscanner.v1alpha.ScanRun.verify(message.latestRun); + if (error) + return "latestRun." + error; + } + return null; + }; + + /** + * Creates a ScanConfig message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.websecurityscanner.v1alpha.ScanConfig + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.websecurityscanner.v1alpha.ScanConfig} ScanConfig + */ + ScanConfig.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.websecurityscanner.v1alpha.ScanConfig) + return object; + var message = new $root.google.cloud.websecurityscanner.v1alpha.ScanConfig(); + if (object.name != null) + message.name = String(object.name); + if (object.displayName != null) + message.displayName = String(object.displayName); + if (object.maxQps != null) + message.maxQps = object.maxQps | 0; + if (object.startingUrls) { + if (!Array.isArray(object.startingUrls)) + throw TypeError(".google.cloud.websecurityscanner.v1alpha.ScanConfig.startingUrls: array expected"); + message.startingUrls = []; + for (var i = 0; i < object.startingUrls.length; ++i) + message.startingUrls[i] = String(object.startingUrls[i]); + } + if (object.authentication != null) { + if (typeof object.authentication !== "object") + throw TypeError(".google.cloud.websecurityscanner.v1alpha.ScanConfig.authentication: object expected"); + message.authentication = $root.google.cloud.websecurityscanner.v1alpha.ScanConfig.Authentication.fromObject(object.authentication); + } + switch (object.userAgent) { + default: + if (typeof object.userAgent === "number") { + message.userAgent = object.userAgent; + break; + } + break; + case "USER_AGENT_UNSPECIFIED": + case 0: + message.userAgent = 0; + break; + case "CHROME_LINUX": + case 1: + message.userAgent = 1; + break; + case "CHROME_ANDROID": + case 2: + message.userAgent = 2; + break; + case "SAFARI_IPHONE": + case 3: + message.userAgent = 3; + break; + } + if (object.blacklistPatterns) { + if (!Array.isArray(object.blacklistPatterns)) + throw TypeError(".google.cloud.websecurityscanner.v1alpha.ScanConfig.blacklistPatterns: array expected"); + message.blacklistPatterns = []; + for (var i = 0; i < object.blacklistPatterns.length; ++i) + message.blacklistPatterns[i] = String(object.blacklistPatterns[i]); + } + if (object.schedule != null) { + if (typeof object.schedule !== "object") + throw TypeError(".google.cloud.websecurityscanner.v1alpha.ScanConfig.schedule: object expected"); + message.schedule = $root.google.cloud.websecurityscanner.v1alpha.ScanConfig.Schedule.fromObject(object.schedule); + } + if (object.targetPlatforms) { + if (!Array.isArray(object.targetPlatforms)) + throw TypeError(".google.cloud.websecurityscanner.v1alpha.ScanConfig.targetPlatforms: array expected"); + message.targetPlatforms = []; + for (var i = 0; i < object.targetPlatforms.length; ++i) + switch (object.targetPlatforms[i]) { + default: + if (typeof object.targetPlatforms[i] === "number") { + message.targetPlatforms[i] = object.targetPlatforms[i]; + break; + } + case "TARGET_PLATFORM_UNSPECIFIED": + case 0: + message.targetPlatforms[i] = 0; + break; + case "APP_ENGINE": + case 1: + message.targetPlatforms[i] = 1; + break; + case "COMPUTE": + case 2: + message.targetPlatforms[i] = 2; + break; + } + } + if (object.latestRun != null) { + if (typeof object.latestRun !== "object") + throw TypeError(".google.cloud.websecurityscanner.v1alpha.ScanConfig.latestRun: object expected"); + message.latestRun = $root.google.cloud.websecurityscanner.v1alpha.ScanRun.fromObject(object.latestRun); + } + return message; + }; + + /** + * Creates a plain object from a ScanConfig message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.websecurityscanner.v1alpha.ScanConfig + * @static + * @param {google.cloud.websecurityscanner.v1alpha.ScanConfig} message ScanConfig + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ScanConfig.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.startingUrls = []; + object.blacklistPatterns = []; + object.targetPlatforms = []; + } + if (options.defaults) { + object.name = ""; + object.displayName = ""; + object.maxQps = 0; + object.authentication = null; + object.userAgent = options.enums === String ? "USER_AGENT_UNSPECIFIED" : 0; + object.schedule = null; + object.latestRun = 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.maxQps != null && message.hasOwnProperty("maxQps")) + object.maxQps = message.maxQps; + if (message.startingUrls && message.startingUrls.length) { + object.startingUrls = []; + for (var j = 0; j < message.startingUrls.length; ++j) + object.startingUrls[j] = message.startingUrls[j]; + } + if (message.authentication != null && message.hasOwnProperty("authentication")) + object.authentication = $root.google.cloud.websecurityscanner.v1alpha.ScanConfig.Authentication.toObject(message.authentication, options); + if (message.userAgent != null && message.hasOwnProperty("userAgent")) + object.userAgent = options.enums === String ? $root.google.cloud.websecurityscanner.v1alpha.ScanConfig.UserAgent[message.userAgent] === undefined ? message.userAgent : $root.google.cloud.websecurityscanner.v1alpha.ScanConfig.UserAgent[message.userAgent] : message.userAgent; + if (message.blacklistPatterns && message.blacklistPatterns.length) { + object.blacklistPatterns = []; + for (var j = 0; j < message.blacklistPatterns.length; ++j) + object.blacklistPatterns[j] = message.blacklistPatterns[j]; + } + if (message.schedule != null && message.hasOwnProperty("schedule")) + object.schedule = $root.google.cloud.websecurityscanner.v1alpha.ScanConfig.Schedule.toObject(message.schedule, options); + if (message.targetPlatforms && message.targetPlatforms.length) { + object.targetPlatforms = []; + for (var j = 0; j < message.targetPlatforms.length; ++j) + object.targetPlatforms[j] = options.enums === String ? $root.google.cloud.websecurityscanner.v1alpha.ScanConfig.TargetPlatform[message.targetPlatforms[j]] === undefined ? message.targetPlatforms[j] : $root.google.cloud.websecurityscanner.v1alpha.ScanConfig.TargetPlatform[message.targetPlatforms[j]] : message.targetPlatforms[j]; + } + if (message.latestRun != null && message.hasOwnProperty("latestRun")) + object.latestRun = $root.google.cloud.websecurityscanner.v1alpha.ScanRun.toObject(message.latestRun, options); + return object; + }; + + /** + * Converts this ScanConfig to JSON. + * @function toJSON + * @memberof google.cloud.websecurityscanner.v1alpha.ScanConfig + * @instance + * @returns {Object.} JSON object + */ + ScanConfig.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ScanConfig + * @function getTypeUrl + * @memberof google.cloud.websecurityscanner.v1alpha.ScanConfig + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ScanConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.websecurityscanner.v1alpha.ScanConfig"; + }; + + ScanConfig.Authentication = (function() { + + /** + * Properties of an Authentication. + * @memberof google.cloud.websecurityscanner.v1alpha.ScanConfig + * @interface IAuthentication + * @property {google.cloud.websecurityscanner.v1alpha.ScanConfig.Authentication.IGoogleAccount|null} [googleAccount] Authentication googleAccount + * @property {google.cloud.websecurityscanner.v1alpha.ScanConfig.Authentication.ICustomAccount|null} [customAccount] Authentication customAccount + */ + + /** + * Constructs a new Authentication. + * @memberof google.cloud.websecurityscanner.v1alpha.ScanConfig + * @classdesc Represents an Authentication. + * @implements IAuthentication + * @constructor + * @param {google.cloud.websecurityscanner.v1alpha.ScanConfig.IAuthentication=} [properties] Properties to set + */ + function Authentication(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Authentication googleAccount. + * @member {google.cloud.websecurityscanner.v1alpha.ScanConfig.Authentication.IGoogleAccount|null|undefined} googleAccount + * @memberof google.cloud.websecurityscanner.v1alpha.ScanConfig.Authentication + * @instance + */ + Authentication.prototype.googleAccount = null; + + /** + * Authentication customAccount. + * @member {google.cloud.websecurityscanner.v1alpha.ScanConfig.Authentication.ICustomAccount|null|undefined} customAccount + * @memberof google.cloud.websecurityscanner.v1alpha.ScanConfig.Authentication + * @instance + */ + Authentication.prototype.customAccount = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * Authentication authentication. + * @member {"googleAccount"|"customAccount"|undefined} authentication + * @memberof google.cloud.websecurityscanner.v1alpha.ScanConfig.Authentication + * @instance + */ + Object.defineProperty(Authentication.prototype, "authentication", { + get: $util.oneOfGetter($oneOfFields = ["googleAccount", "customAccount"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new Authentication instance using the specified properties. + * @function create + * @memberof google.cloud.websecurityscanner.v1alpha.ScanConfig.Authentication + * @static + * @param {google.cloud.websecurityscanner.v1alpha.ScanConfig.IAuthentication=} [properties] Properties to set + * @returns {google.cloud.websecurityscanner.v1alpha.ScanConfig.Authentication} Authentication instance + */ + Authentication.create = function create(properties) { + return new Authentication(properties); + }; + + /** + * Encodes the specified Authentication message. Does not implicitly {@link google.cloud.websecurityscanner.v1alpha.ScanConfig.Authentication.verify|verify} messages. + * @function encode + * @memberof google.cloud.websecurityscanner.v1alpha.ScanConfig.Authentication + * @static + * @param {google.cloud.websecurityscanner.v1alpha.ScanConfig.IAuthentication} message Authentication message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Authentication.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.googleAccount != null && Object.hasOwnProperty.call(message, "googleAccount")) + $root.google.cloud.websecurityscanner.v1alpha.ScanConfig.Authentication.GoogleAccount.encode(message.googleAccount, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.customAccount != null && Object.hasOwnProperty.call(message, "customAccount")) + $root.google.cloud.websecurityscanner.v1alpha.ScanConfig.Authentication.CustomAccount.encode(message.customAccount, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified Authentication message, length delimited. Does not implicitly {@link google.cloud.websecurityscanner.v1alpha.ScanConfig.Authentication.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.websecurityscanner.v1alpha.ScanConfig.Authentication + * @static + * @param {google.cloud.websecurityscanner.v1alpha.ScanConfig.IAuthentication} message Authentication message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Authentication.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an Authentication message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.websecurityscanner.v1alpha.ScanConfig.Authentication + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.websecurityscanner.v1alpha.ScanConfig.Authentication} Authentication + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Authentication.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.websecurityscanner.v1alpha.ScanConfig.Authentication(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.googleAccount = $root.google.cloud.websecurityscanner.v1alpha.ScanConfig.Authentication.GoogleAccount.decode(reader, reader.uint32()); + break; + } + case 2: { + message.customAccount = $root.google.cloud.websecurityscanner.v1alpha.ScanConfig.Authentication.CustomAccount.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an Authentication message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.websecurityscanner.v1alpha.ScanConfig.Authentication + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.websecurityscanner.v1alpha.ScanConfig.Authentication} Authentication + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Authentication.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an Authentication message. + * @function verify + * @memberof google.cloud.websecurityscanner.v1alpha.ScanConfig.Authentication + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Authentication.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.googleAccount != null && message.hasOwnProperty("googleAccount")) { + properties.authentication = 1; + { + var error = $root.google.cloud.websecurityscanner.v1alpha.ScanConfig.Authentication.GoogleAccount.verify(message.googleAccount); + if (error) + return "googleAccount." + error; + } + } + if (message.customAccount != null && message.hasOwnProperty("customAccount")) { + if (properties.authentication === 1) + return "authentication: multiple values"; + properties.authentication = 1; + { + var error = $root.google.cloud.websecurityscanner.v1alpha.ScanConfig.Authentication.CustomAccount.verify(message.customAccount); + if (error) + return "customAccount." + error; + } + } + return null; + }; + + /** + * Creates an Authentication message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.websecurityscanner.v1alpha.ScanConfig.Authentication + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.websecurityscanner.v1alpha.ScanConfig.Authentication} Authentication + */ + Authentication.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.websecurityscanner.v1alpha.ScanConfig.Authentication) + return object; + var message = new $root.google.cloud.websecurityscanner.v1alpha.ScanConfig.Authentication(); + if (object.googleAccount != null) { + if (typeof object.googleAccount !== "object") + throw TypeError(".google.cloud.websecurityscanner.v1alpha.ScanConfig.Authentication.googleAccount: object expected"); + message.googleAccount = $root.google.cloud.websecurityscanner.v1alpha.ScanConfig.Authentication.GoogleAccount.fromObject(object.googleAccount); + } + if (object.customAccount != null) { + if (typeof object.customAccount !== "object") + throw TypeError(".google.cloud.websecurityscanner.v1alpha.ScanConfig.Authentication.customAccount: object expected"); + message.customAccount = $root.google.cloud.websecurityscanner.v1alpha.ScanConfig.Authentication.CustomAccount.fromObject(object.customAccount); + } + return message; + }; + + /** + * Creates a plain object from an Authentication message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.websecurityscanner.v1alpha.ScanConfig.Authentication + * @static + * @param {google.cloud.websecurityscanner.v1alpha.ScanConfig.Authentication} message Authentication + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Authentication.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.googleAccount != null && message.hasOwnProperty("googleAccount")) { + object.googleAccount = $root.google.cloud.websecurityscanner.v1alpha.ScanConfig.Authentication.GoogleAccount.toObject(message.googleAccount, options); + if (options.oneofs) + object.authentication = "googleAccount"; + } + if (message.customAccount != null && message.hasOwnProperty("customAccount")) { + object.customAccount = $root.google.cloud.websecurityscanner.v1alpha.ScanConfig.Authentication.CustomAccount.toObject(message.customAccount, options); + if (options.oneofs) + object.authentication = "customAccount"; + } + return object; + }; + + /** + * Converts this Authentication to JSON. + * @function toJSON + * @memberof google.cloud.websecurityscanner.v1alpha.ScanConfig.Authentication + * @instance + * @returns {Object.} JSON object + */ + Authentication.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Authentication + * @function getTypeUrl + * @memberof google.cloud.websecurityscanner.v1alpha.ScanConfig.Authentication + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Authentication.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.websecurityscanner.v1alpha.ScanConfig.Authentication"; + }; + + Authentication.GoogleAccount = (function() { + + /** + * Properties of a GoogleAccount. + * @memberof google.cloud.websecurityscanner.v1alpha.ScanConfig.Authentication + * @interface IGoogleAccount + * @property {string|null} [username] GoogleAccount username + * @property {string|null} [password] GoogleAccount password + */ + + /** + * Constructs a new GoogleAccount. + * @memberof google.cloud.websecurityscanner.v1alpha.ScanConfig.Authentication + * @classdesc Represents a GoogleAccount. + * @implements IGoogleAccount + * @constructor + * @param {google.cloud.websecurityscanner.v1alpha.ScanConfig.Authentication.IGoogleAccount=} [properties] Properties to set + */ + function GoogleAccount(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GoogleAccount username. + * @member {string} username + * @memberof google.cloud.websecurityscanner.v1alpha.ScanConfig.Authentication.GoogleAccount + * @instance + */ + GoogleAccount.prototype.username = ""; + + /** + * GoogleAccount password. + * @member {string} password + * @memberof google.cloud.websecurityscanner.v1alpha.ScanConfig.Authentication.GoogleAccount + * @instance + */ + GoogleAccount.prototype.password = ""; + + /** + * Creates a new GoogleAccount instance using the specified properties. + * @function create + * @memberof google.cloud.websecurityscanner.v1alpha.ScanConfig.Authentication.GoogleAccount + * @static + * @param {google.cloud.websecurityscanner.v1alpha.ScanConfig.Authentication.IGoogleAccount=} [properties] Properties to set + * @returns {google.cloud.websecurityscanner.v1alpha.ScanConfig.Authentication.GoogleAccount} GoogleAccount instance + */ + GoogleAccount.create = function create(properties) { + return new GoogleAccount(properties); + }; + + /** + * Encodes the specified GoogleAccount message. Does not implicitly {@link google.cloud.websecurityscanner.v1alpha.ScanConfig.Authentication.GoogleAccount.verify|verify} messages. + * @function encode + * @memberof google.cloud.websecurityscanner.v1alpha.ScanConfig.Authentication.GoogleAccount + * @static + * @param {google.cloud.websecurityscanner.v1alpha.ScanConfig.Authentication.IGoogleAccount} message GoogleAccount message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GoogleAccount.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.username != null && Object.hasOwnProperty.call(message, "username")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.username); + if (message.password != null && Object.hasOwnProperty.call(message, "password")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.password); + return writer; + }; + + /** + * Encodes the specified GoogleAccount message, length delimited. Does not implicitly {@link google.cloud.websecurityscanner.v1alpha.ScanConfig.Authentication.GoogleAccount.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.websecurityscanner.v1alpha.ScanConfig.Authentication.GoogleAccount + * @static + * @param {google.cloud.websecurityscanner.v1alpha.ScanConfig.Authentication.IGoogleAccount} message GoogleAccount message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GoogleAccount.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GoogleAccount message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.websecurityscanner.v1alpha.ScanConfig.Authentication.GoogleAccount + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.websecurityscanner.v1alpha.ScanConfig.Authentication.GoogleAccount} GoogleAccount + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GoogleAccount.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.websecurityscanner.v1alpha.ScanConfig.Authentication.GoogleAccount(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.username = reader.string(); + break; + } + case 2: { + message.password = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GoogleAccount message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.websecurityscanner.v1alpha.ScanConfig.Authentication.GoogleAccount + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.websecurityscanner.v1alpha.ScanConfig.Authentication.GoogleAccount} GoogleAccount + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GoogleAccount.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GoogleAccount message. + * @function verify + * @memberof google.cloud.websecurityscanner.v1alpha.ScanConfig.Authentication.GoogleAccount + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GoogleAccount.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.username != null && message.hasOwnProperty("username")) + if (!$util.isString(message.username)) + return "username: string expected"; + if (message.password != null && message.hasOwnProperty("password")) + if (!$util.isString(message.password)) + return "password: string expected"; + return null; + }; + + /** + * Creates a GoogleAccount message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.websecurityscanner.v1alpha.ScanConfig.Authentication.GoogleAccount + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.websecurityscanner.v1alpha.ScanConfig.Authentication.GoogleAccount} GoogleAccount + */ + GoogleAccount.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.websecurityscanner.v1alpha.ScanConfig.Authentication.GoogleAccount) + return object; + var message = new $root.google.cloud.websecurityscanner.v1alpha.ScanConfig.Authentication.GoogleAccount(); + if (object.username != null) + message.username = String(object.username); + if (object.password != null) + message.password = String(object.password); + return message; + }; + + /** + * Creates a plain object from a GoogleAccount message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.websecurityscanner.v1alpha.ScanConfig.Authentication.GoogleAccount + * @static + * @param {google.cloud.websecurityscanner.v1alpha.ScanConfig.Authentication.GoogleAccount} message GoogleAccount + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GoogleAccount.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.username = ""; + object.password = ""; + } + if (message.username != null && message.hasOwnProperty("username")) + object.username = message.username; + if (message.password != null && message.hasOwnProperty("password")) + object.password = message.password; + return object; + }; + + /** + * Converts this GoogleAccount to JSON. + * @function toJSON + * @memberof google.cloud.websecurityscanner.v1alpha.ScanConfig.Authentication.GoogleAccount + * @instance + * @returns {Object.} JSON object + */ + GoogleAccount.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GoogleAccount + * @function getTypeUrl + * @memberof google.cloud.websecurityscanner.v1alpha.ScanConfig.Authentication.GoogleAccount + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GoogleAccount.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.websecurityscanner.v1alpha.ScanConfig.Authentication.GoogleAccount"; + }; + + return GoogleAccount; + })(); + + Authentication.CustomAccount = (function() { + + /** + * Properties of a CustomAccount. + * @memberof google.cloud.websecurityscanner.v1alpha.ScanConfig.Authentication + * @interface ICustomAccount + * @property {string|null} [username] CustomAccount username + * @property {string|null} [password] CustomAccount password + * @property {string|null} [loginUrl] CustomAccount loginUrl + */ + + /** + * Constructs a new CustomAccount. + * @memberof google.cloud.websecurityscanner.v1alpha.ScanConfig.Authentication + * @classdesc Represents a CustomAccount. + * @implements ICustomAccount + * @constructor + * @param {google.cloud.websecurityscanner.v1alpha.ScanConfig.Authentication.ICustomAccount=} [properties] Properties to set + */ + function CustomAccount(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * CustomAccount username. + * @member {string} username + * @memberof google.cloud.websecurityscanner.v1alpha.ScanConfig.Authentication.CustomAccount + * @instance + */ + CustomAccount.prototype.username = ""; + + /** + * CustomAccount password. + * @member {string} password + * @memberof google.cloud.websecurityscanner.v1alpha.ScanConfig.Authentication.CustomAccount + * @instance + */ + CustomAccount.prototype.password = ""; + + /** + * CustomAccount loginUrl. + * @member {string} loginUrl + * @memberof google.cloud.websecurityscanner.v1alpha.ScanConfig.Authentication.CustomAccount + * @instance + */ + CustomAccount.prototype.loginUrl = ""; + + /** + * Creates a new CustomAccount instance using the specified properties. + * @function create + * @memberof google.cloud.websecurityscanner.v1alpha.ScanConfig.Authentication.CustomAccount + * @static + * @param {google.cloud.websecurityscanner.v1alpha.ScanConfig.Authentication.ICustomAccount=} [properties] Properties to set + * @returns {google.cloud.websecurityscanner.v1alpha.ScanConfig.Authentication.CustomAccount} CustomAccount instance + */ + CustomAccount.create = function create(properties) { + return new CustomAccount(properties); + }; + + /** + * Encodes the specified CustomAccount message. Does not implicitly {@link google.cloud.websecurityscanner.v1alpha.ScanConfig.Authentication.CustomAccount.verify|verify} messages. + * @function encode + * @memberof google.cloud.websecurityscanner.v1alpha.ScanConfig.Authentication.CustomAccount + * @static + * @param {google.cloud.websecurityscanner.v1alpha.ScanConfig.Authentication.ICustomAccount} message CustomAccount message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CustomAccount.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.username != null && Object.hasOwnProperty.call(message, "username")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.username); + if (message.password != null && Object.hasOwnProperty.call(message, "password")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.password); + if (message.loginUrl != null && Object.hasOwnProperty.call(message, "loginUrl")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.loginUrl); + return writer; + }; + + /** + * Encodes the specified CustomAccount message, length delimited. Does not implicitly {@link google.cloud.websecurityscanner.v1alpha.ScanConfig.Authentication.CustomAccount.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.websecurityscanner.v1alpha.ScanConfig.Authentication.CustomAccount + * @static + * @param {google.cloud.websecurityscanner.v1alpha.ScanConfig.Authentication.ICustomAccount} message CustomAccount message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CustomAccount.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CustomAccount message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.websecurityscanner.v1alpha.ScanConfig.Authentication.CustomAccount + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.websecurityscanner.v1alpha.ScanConfig.Authentication.CustomAccount} CustomAccount + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CustomAccount.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.websecurityscanner.v1alpha.ScanConfig.Authentication.CustomAccount(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.username = reader.string(); + break; + } + case 2: { + message.password = reader.string(); + break; + } + case 3: { + message.loginUrl = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CustomAccount message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.websecurityscanner.v1alpha.ScanConfig.Authentication.CustomAccount + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.websecurityscanner.v1alpha.ScanConfig.Authentication.CustomAccount} CustomAccount + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CustomAccount.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CustomAccount message. + * @function verify + * @memberof google.cloud.websecurityscanner.v1alpha.ScanConfig.Authentication.CustomAccount + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CustomAccount.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.username != null && message.hasOwnProperty("username")) + if (!$util.isString(message.username)) + return "username: string expected"; + if (message.password != null && message.hasOwnProperty("password")) + if (!$util.isString(message.password)) + return "password: string expected"; + if (message.loginUrl != null && message.hasOwnProperty("loginUrl")) + if (!$util.isString(message.loginUrl)) + return "loginUrl: string expected"; + return null; + }; + + /** + * Creates a CustomAccount message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.websecurityscanner.v1alpha.ScanConfig.Authentication.CustomAccount + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.websecurityscanner.v1alpha.ScanConfig.Authentication.CustomAccount} CustomAccount + */ + CustomAccount.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.websecurityscanner.v1alpha.ScanConfig.Authentication.CustomAccount) + return object; + var message = new $root.google.cloud.websecurityscanner.v1alpha.ScanConfig.Authentication.CustomAccount(); + if (object.username != null) + message.username = String(object.username); + if (object.password != null) + message.password = String(object.password); + if (object.loginUrl != null) + message.loginUrl = String(object.loginUrl); + return message; + }; + + /** + * Creates a plain object from a CustomAccount message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.websecurityscanner.v1alpha.ScanConfig.Authentication.CustomAccount + * @static + * @param {google.cloud.websecurityscanner.v1alpha.ScanConfig.Authentication.CustomAccount} message CustomAccount + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CustomAccount.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.username = ""; + object.password = ""; + object.loginUrl = ""; + } + if (message.username != null && message.hasOwnProperty("username")) + object.username = message.username; + if (message.password != null && message.hasOwnProperty("password")) + object.password = message.password; + if (message.loginUrl != null && message.hasOwnProperty("loginUrl")) + object.loginUrl = message.loginUrl; + return object; + }; + + /** + * Converts this CustomAccount to JSON. + * @function toJSON + * @memberof google.cloud.websecurityscanner.v1alpha.ScanConfig.Authentication.CustomAccount + * @instance + * @returns {Object.} JSON object + */ + CustomAccount.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CustomAccount + * @function getTypeUrl + * @memberof google.cloud.websecurityscanner.v1alpha.ScanConfig.Authentication.CustomAccount + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CustomAccount.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.websecurityscanner.v1alpha.ScanConfig.Authentication.CustomAccount"; + }; + + return CustomAccount; + })(); + + return Authentication; + })(); + + ScanConfig.Schedule = (function() { + + /** + * Properties of a Schedule. + * @memberof google.cloud.websecurityscanner.v1alpha.ScanConfig + * @interface ISchedule + * @property {google.protobuf.ITimestamp|null} [scheduleTime] Schedule scheduleTime + * @property {number|null} [intervalDurationDays] Schedule intervalDurationDays + */ + + /** + * Constructs a new Schedule. + * @memberof google.cloud.websecurityscanner.v1alpha.ScanConfig + * @classdesc Represents a Schedule. + * @implements ISchedule + * @constructor + * @param {google.cloud.websecurityscanner.v1alpha.ScanConfig.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]]; + } + + /** + * Schedule scheduleTime. + * @member {google.protobuf.ITimestamp|null|undefined} scheduleTime + * @memberof google.cloud.websecurityscanner.v1alpha.ScanConfig.Schedule + * @instance + */ + Schedule.prototype.scheduleTime = null; + + /** + * Schedule intervalDurationDays. + * @member {number} intervalDurationDays + * @memberof google.cloud.websecurityscanner.v1alpha.ScanConfig.Schedule + * @instance + */ + Schedule.prototype.intervalDurationDays = 0; + + /** + * Creates a new Schedule instance using the specified properties. + * @function create + * @memberof google.cloud.websecurityscanner.v1alpha.ScanConfig.Schedule + * @static + * @param {google.cloud.websecurityscanner.v1alpha.ScanConfig.ISchedule=} [properties] Properties to set + * @returns {google.cloud.websecurityscanner.v1alpha.ScanConfig.Schedule} Schedule instance + */ + Schedule.create = function create(properties) { + return new Schedule(properties); + }; + + /** + * Encodes the specified Schedule message. Does not implicitly {@link google.cloud.websecurityscanner.v1alpha.ScanConfig.Schedule.verify|verify} messages. + * @function encode + * @memberof google.cloud.websecurityscanner.v1alpha.ScanConfig.Schedule + * @static + * @param {google.cloud.websecurityscanner.v1alpha.ScanConfig.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.scheduleTime != null && Object.hasOwnProperty.call(message, "scheduleTime")) + $root.google.protobuf.Timestamp.encode(message.scheduleTime, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.intervalDurationDays != null && Object.hasOwnProperty.call(message, "intervalDurationDays")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.intervalDurationDays); + return writer; + }; + + /** + * Encodes the specified Schedule message, length delimited. Does not implicitly {@link google.cloud.websecurityscanner.v1alpha.ScanConfig.Schedule.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.websecurityscanner.v1alpha.ScanConfig.Schedule + * @static + * @param {google.cloud.websecurityscanner.v1alpha.ScanConfig.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(); + }; + + /** + * Decodes a Schedule message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.websecurityscanner.v1alpha.ScanConfig.Schedule + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.websecurityscanner.v1alpha.ScanConfig.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.websecurityscanner.v1alpha.ScanConfig.Schedule(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.scheduleTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 2: { + message.intervalDurationDays = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Schedule message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.websecurityscanner.v1alpha.ScanConfig.Schedule + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.websecurityscanner.v1alpha.ScanConfig.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()); + }; + + /** + * Verifies a Schedule message. + * @function verify + * @memberof google.cloud.websecurityscanner.v1alpha.ScanConfig.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"; + if (message.scheduleTime != null && message.hasOwnProperty("scheduleTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.scheduleTime); + if (error) + return "scheduleTime." + error; + } + if (message.intervalDurationDays != null && message.hasOwnProperty("intervalDurationDays")) + if (!$util.isInteger(message.intervalDurationDays)) + return "intervalDurationDays: integer expected"; + return null; + }; + + /** + * Creates a Schedule message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.websecurityscanner.v1alpha.ScanConfig.Schedule + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.websecurityscanner.v1alpha.ScanConfig.Schedule} Schedule + */ + Schedule.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.websecurityscanner.v1alpha.ScanConfig.Schedule) + return object; + var message = new $root.google.cloud.websecurityscanner.v1alpha.ScanConfig.Schedule(); + if (object.scheduleTime != null) { + if (typeof object.scheduleTime !== "object") + throw TypeError(".google.cloud.websecurityscanner.v1alpha.ScanConfig.Schedule.scheduleTime: object expected"); + message.scheduleTime = $root.google.protobuf.Timestamp.fromObject(object.scheduleTime); + } + if (object.intervalDurationDays != null) + message.intervalDurationDays = object.intervalDurationDays | 0; + return message; + }; + + /** + * Creates a plain object from a Schedule message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.websecurityscanner.v1alpha.ScanConfig.Schedule + * @static + * @param {google.cloud.websecurityscanner.v1alpha.ScanConfig.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.scheduleTime = null; + object.intervalDurationDays = 0; + } + if (message.scheduleTime != null && message.hasOwnProperty("scheduleTime")) + object.scheduleTime = $root.google.protobuf.Timestamp.toObject(message.scheduleTime, options); + if (message.intervalDurationDays != null && message.hasOwnProperty("intervalDurationDays")) + object.intervalDurationDays = message.intervalDurationDays; + return object; + }; + + /** + * Converts this Schedule to JSON. + * @function toJSON + * @memberof google.cloud.websecurityscanner.v1alpha.ScanConfig.Schedule + * @instance + * @returns {Object.} JSON object + */ + Schedule.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Schedule + * @function getTypeUrl + * @memberof google.cloud.websecurityscanner.v1alpha.ScanConfig.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.websecurityscanner.v1alpha.ScanConfig.Schedule"; + }; + + return Schedule; + })(); + + /** + * UserAgent enum. + * @name google.cloud.websecurityscanner.v1alpha.ScanConfig.UserAgent + * @enum {number} + * @property {number} USER_AGENT_UNSPECIFIED=0 USER_AGENT_UNSPECIFIED value + * @property {number} CHROME_LINUX=1 CHROME_LINUX value + * @property {number} CHROME_ANDROID=2 CHROME_ANDROID value + * @property {number} SAFARI_IPHONE=3 SAFARI_IPHONE value + */ + ScanConfig.UserAgent = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "USER_AGENT_UNSPECIFIED"] = 0; + values[valuesById[1] = "CHROME_LINUX"] = 1; + values[valuesById[2] = "CHROME_ANDROID"] = 2; + values[valuesById[3] = "SAFARI_IPHONE"] = 3; + return values; + })(); + + /** + * TargetPlatform enum. + * @name google.cloud.websecurityscanner.v1alpha.ScanConfig.TargetPlatform + * @enum {number} + * @property {number} TARGET_PLATFORM_UNSPECIFIED=0 TARGET_PLATFORM_UNSPECIFIED value + * @property {number} APP_ENGINE=1 APP_ENGINE value + * @property {number} COMPUTE=2 COMPUTE value + */ + ScanConfig.TargetPlatform = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "TARGET_PLATFORM_UNSPECIFIED"] = 0; + values[valuesById[1] = "APP_ENGINE"] = 1; + values[valuesById[2] = "COMPUTE"] = 2; + return values; + })(); + + return ScanConfig; + })(); + + v1alpha.ScanRun = (function() { + + /** + * Properties of a ScanRun. + * @memberof google.cloud.websecurityscanner.v1alpha + * @interface IScanRun + * @property {string|null} [name] ScanRun name + * @property {google.cloud.websecurityscanner.v1alpha.ScanRun.ExecutionState|null} [executionState] ScanRun executionState + * @property {google.cloud.websecurityscanner.v1alpha.ScanRun.ResultState|null} [resultState] ScanRun resultState + * @property {google.protobuf.ITimestamp|null} [startTime] ScanRun startTime + * @property {google.protobuf.ITimestamp|null} [endTime] ScanRun endTime + * @property {number|Long|null} [urlsCrawledCount] ScanRun urlsCrawledCount + * @property {number|Long|null} [urlsTestedCount] ScanRun urlsTestedCount + * @property {boolean|null} [hasVulnerabilities] ScanRun hasVulnerabilities + * @property {number|null} [progressPercent] ScanRun progressPercent + */ + + /** + * Constructs a new ScanRun. + * @memberof google.cloud.websecurityscanner.v1alpha + * @classdesc Represents a ScanRun. + * @implements IScanRun + * @constructor + * @param {google.cloud.websecurityscanner.v1alpha.IScanRun=} [properties] Properties to set + */ + function ScanRun(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ScanRun name. + * @member {string} name + * @memberof google.cloud.websecurityscanner.v1alpha.ScanRun + * @instance + */ + ScanRun.prototype.name = ""; + + /** + * ScanRun executionState. + * @member {google.cloud.websecurityscanner.v1alpha.ScanRun.ExecutionState} executionState + * @memberof google.cloud.websecurityscanner.v1alpha.ScanRun + * @instance + */ + ScanRun.prototype.executionState = 0; + + /** + * ScanRun resultState. + * @member {google.cloud.websecurityscanner.v1alpha.ScanRun.ResultState} resultState + * @memberof google.cloud.websecurityscanner.v1alpha.ScanRun + * @instance + */ + ScanRun.prototype.resultState = 0; + + /** + * ScanRun startTime. + * @member {google.protobuf.ITimestamp|null|undefined} startTime + * @memberof google.cloud.websecurityscanner.v1alpha.ScanRun + * @instance + */ + ScanRun.prototype.startTime = null; + + /** + * ScanRun endTime. + * @member {google.protobuf.ITimestamp|null|undefined} endTime + * @memberof google.cloud.websecurityscanner.v1alpha.ScanRun + * @instance + */ + ScanRun.prototype.endTime = null; + + /** + * ScanRun urlsCrawledCount. + * @member {number|Long} urlsCrawledCount + * @memberof google.cloud.websecurityscanner.v1alpha.ScanRun + * @instance + */ + ScanRun.prototype.urlsCrawledCount = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * ScanRun urlsTestedCount. + * @member {number|Long} urlsTestedCount + * @memberof google.cloud.websecurityscanner.v1alpha.ScanRun + * @instance + */ + ScanRun.prototype.urlsTestedCount = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * ScanRun hasVulnerabilities. + * @member {boolean} hasVulnerabilities + * @memberof google.cloud.websecurityscanner.v1alpha.ScanRun + * @instance + */ + ScanRun.prototype.hasVulnerabilities = false; + + /** + * ScanRun progressPercent. + * @member {number} progressPercent + * @memberof google.cloud.websecurityscanner.v1alpha.ScanRun + * @instance + */ + ScanRun.prototype.progressPercent = 0; + + /** + * Creates a new ScanRun instance using the specified properties. + * @function create + * @memberof google.cloud.websecurityscanner.v1alpha.ScanRun + * @static + * @param {google.cloud.websecurityscanner.v1alpha.IScanRun=} [properties] Properties to set + * @returns {google.cloud.websecurityscanner.v1alpha.ScanRun} ScanRun instance + */ + ScanRun.create = function create(properties) { + return new ScanRun(properties); + }; + + /** + * Encodes the specified ScanRun message. Does not implicitly {@link google.cloud.websecurityscanner.v1alpha.ScanRun.verify|verify} messages. + * @function encode + * @memberof google.cloud.websecurityscanner.v1alpha.ScanRun + * @static + * @param {google.cloud.websecurityscanner.v1alpha.IScanRun} message ScanRun message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ScanRun.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.executionState != null && Object.hasOwnProperty.call(message, "executionState")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.executionState); + if (message.resultState != null && Object.hasOwnProperty.call(message, "resultState")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.resultState); + if (message.startTime != null && Object.hasOwnProperty.call(message, "startTime")) + $root.google.protobuf.Timestamp.encode(message.startTime, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.endTime != null && Object.hasOwnProperty.call(message, "endTime")) + $root.google.protobuf.Timestamp.encode(message.endTime, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.urlsCrawledCount != null && Object.hasOwnProperty.call(message, "urlsCrawledCount")) + writer.uint32(/* id 6, wireType 0 =*/48).int64(message.urlsCrawledCount); + if (message.urlsTestedCount != null && Object.hasOwnProperty.call(message, "urlsTestedCount")) + writer.uint32(/* id 7, wireType 0 =*/56).int64(message.urlsTestedCount); + if (message.hasVulnerabilities != null && Object.hasOwnProperty.call(message, "hasVulnerabilities")) + writer.uint32(/* id 8, wireType 0 =*/64).bool(message.hasVulnerabilities); + if (message.progressPercent != null && Object.hasOwnProperty.call(message, "progressPercent")) + writer.uint32(/* id 9, wireType 0 =*/72).int32(message.progressPercent); + return writer; + }; + + /** + * Encodes the specified ScanRun message, length delimited. Does not implicitly {@link google.cloud.websecurityscanner.v1alpha.ScanRun.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.websecurityscanner.v1alpha.ScanRun + * @static + * @param {google.cloud.websecurityscanner.v1alpha.IScanRun} message ScanRun message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ScanRun.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ScanRun message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.websecurityscanner.v1alpha.ScanRun + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.websecurityscanner.v1alpha.ScanRun} ScanRun + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ScanRun.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.websecurityscanner.v1alpha.ScanRun(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.executionState = reader.int32(); + break; + } + case 3: { + message.resultState = reader.int32(); + break; + } + case 4: { + message.startTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 5: { + message.endTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 6: { + message.urlsCrawledCount = reader.int64(); + break; + } + case 7: { + message.urlsTestedCount = reader.int64(); + break; + } + case 8: { + message.hasVulnerabilities = reader.bool(); + break; + } + case 9: { + message.progressPercent = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ScanRun message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.websecurityscanner.v1alpha.ScanRun + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.websecurityscanner.v1alpha.ScanRun} ScanRun + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ScanRun.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ScanRun message. + * @function verify + * @memberof google.cloud.websecurityscanner.v1alpha.ScanRun + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ScanRun.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.executionState != null && message.hasOwnProperty("executionState")) + switch (message.executionState) { + default: + return "executionState: enum value expected"; + case 0: + case 1: + case 2: + case 3: + break; + } + if (message.resultState != null && message.hasOwnProperty("resultState")) + switch (message.resultState) { + default: + return "resultState: enum value expected"; + case 0: + case 1: + case 2: + case 3: + break; + } + 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.urlsCrawledCount != null && message.hasOwnProperty("urlsCrawledCount")) + if (!$util.isInteger(message.urlsCrawledCount) && !(message.urlsCrawledCount && $util.isInteger(message.urlsCrawledCount.low) && $util.isInteger(message.urlsCrawledCount.high))) + return "urlsCrawledCount: integer|Long expected"; + if (message.urlsTestedCount != null && message.hasOwnProperty("urlsTestedCount")) + if (!$util.isInteger(message.urlsTestedCount) && !(message.urlsTestedCount && $util.isInteger(message.urlsTestedCount.low) && $util.isInteger(message.urlsTestedCount.high))) + return "urlsTestedCount: integer|Long expected"; + if (message.hasVulnerabilities != null && message.hasOwnProperty("hasVulnerabilities")) + if (typeof message.hasVulnerabilities !== "boolean") + return "hasVulnerabilities: boolean expected"; + if (message.progressPercent != null && message.hasOwnProperty("progressPercent")) + if (!$util.isInteger(message.progressPercent)) + return "progressPercent: integer expected"; + return null; + }; + + /** + * Creates a ScanRun message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.websecurityscanner.v1alpha.ScanRun + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.websecurityscanner.v1alpha.ScanRun} ScanRun + */ + ScanRun.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.websecurityscanner.v1alpha.ScanRun) + return object; + var message = new $root.google.cloud.websecurityscanner.v1alpha.ScanRun(); + if (object.name != null) + message.name = String(object.name); + switch (object.executionState) { + default: + if (typeof object.executionState === "number") { + message.executionState = object.executionState; + break; + } + break; + case "EXECUTION_STATE_UNSPECIFIED": + case 0: + message.executionState = 0; + break; + case "QUEUED": + case 1: + message.executionState = 1; + break; + case "SCANNING": + case 2: + message.executionState = 2; + break; + case "FINISHED": + case 3: + message.executionState = 3; + break; + } + switch (object.resultState) { + default: + if (typeof object.resultState === "number") { + message.resultState = object.resultState; + break; + } + break; + case "RESULT_STATE_UNSPECIFIED": + case 0: + message.resultState = 0; + break; + case "SUCCESS": + case 1: + message.resultState = 1; + break; + case "ERROR": + case 2: + message.resultState = 2; + break; + case "KILLED": + case 3: + message.resultState = 3; + break; + } + if (object.startTime != null) { + if (typeof object.startTime !== "object") + throw TypeError(".google.cloud.websecurityscanner.v1alpha.ScanRun.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.websecurityscanner.v1alpha.ScanRun.endTime: object expected"); + message.endTime = $root.google.protobuf.Timestamp.fromObject(object.endTime); + } + if (object.urlsCrawledCount != null) + if ($util.Long) + (message.urlsCrawledCount = $util.Long.fromValue(object.urlsCrawledCount)).unsigned = false; + else if (typeof object.urlsCrawledCount === "string") + message.urlsCrawledCount = parseInt(object.urlsCrawledCount, 10); + else if (typeof object.urlsCrawledCount === "number") + message.urlsCrawledCount = object.urlsCrawledCount; + else if (typeof object.urlsCrawledCount === "object") + message.urlsCrawledCount = new $util.LongBits(object.urlsCrawledCount.low >>> 0, object.urlsCrawledCount.high >>> 0).toNumber(); + if (object.urlsTestedCount != null) + if ($util.Long) + (message.urlsTestedCount = $util.Long.fromValue(object.urlsTestedCount)).unsigned = false; + else if (typeof object.urlsTestedCount === "string") + message.urlsTestedCount = parseInt(object.urlsTestedCount, 10); + else if (typeof object.urlsTestedCount === "number") + message.urlsTestedCount = object.urlsTestedCount; + else if (typeof object.urlsTestedCount === "object") + message.urlsTestedCount = new $util.LongBits(object.urlsTestedCount.low >>> 0, object.urlsTestedCount.high >>> 0).toNumber(); + if (object.hasVulnerabilities != null) + message.hasVulnerabilities = Boolean(object.hasVulnerabilities); + if (object.progressPercent != null) + message.progressPercent = object.progressPercent | 0; + return message; + }; + + /** + * Creates a plain object from a ScanRun message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.websecurityscanner.v1alpha.ScanRun + * @static + * @param {google.cloud.websecurityscanner.v1alpha.ScanRun} message ScanRun + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ScanRun.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.executionState = options.enums === String ? "EXECUTION_STATE_UNSPECIFIED" : 0; + object.resultState = options.enums === String ? "RESULT_STATE_UNSPECIFIED" : 0; + object.startTime = null; + object.endTime = null; + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.urlsCrawledCount = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.urlsCrawledCount = options.longs === String ? "0" : 0; + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.urlsTestedCount = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.urlsTestedCount = options.longs === String ? "0" : 0; + object.hasVulnerabilities = false; + object.progressPercent = 0; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.executionState != null && message.hasOwnProperty("executionState")) + object.executionState = options.enums === String ? $root.google.cloud.websecurityscanner.v1alpha.ScanRun.ExecutionState[message.executionState] === undefined ? message.executionState : $root.google.cloud.websecurityscanner.v1alpha.ScanRun.ExecutionState[message.executionState] : message.executionState; + if (message.resultState != null && message.hasOwnProperty("resultState")) + object.resultState = options.enums === String ? $root.google.cloud.websecurityscanner.v1alpha.ScanRun.ResultState[message.resultState] === undefined ? message.resultState : $root.google.cloud.websecurityscanner.v1alpha.ScanRun.ResultState[message.resultState] : message.resultState; + 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.urlsCrawledCount != null && message.hasOwnProperty("urlsCrawledCount")) + if (typeof message.urlsCrawledCount === "number") + object.urlsCrawledCount = options.longs === String ? String(message.urlsCrawledCount) : message.urlsCrawledCount; + else + object.urlsCrawledCount = options.longs === String ? $util.Long.prototype.toString.call(message.urlsCrawledCount) : options.longs === Number ? new $util.LongBits(message.urlsCrawledCount.low >>> 0, message.urlsCrawledCount.high >>> 0).toNumber() : message.urlsCrawledCount; + if (message.urlsTestedCount != null && message.hasOwnProperty("urlsTestedCount")) + if (typeof message.urlsTestedCount === "number") + object.urlsTestedCount = options.longs === String ? String(message.urlsTestedCount) : message.urlsTestedCount; + else + object.urlsTestedCount = options.longs === String ? $util.Long.prototype.toString.call(message.urlsTestedCount) : options.longs === Number ? new $util.LongBits(message.urlsTestedCount.low >>> 0, message.urlsTestedCount.high >>> 0).toNumber() : message.urlsTestedCount; + if (message.hasVulnerabilities != null && message.hasOwnProperty("hasVulnerabilities")) + object.hasVulnerabilities = message.hasVulnerabilities; + if (message.progressPercent != null && message.hasOwnProperty("progressPercent")) + object.progressPercent = message.progressPercent; + return object; + }; + + /** + * Converts this ScanRun to JSON. + * @function toJSON + * @memberof google.cloud.websecurityscanner.v1alpha.ScanRun + * @instance + * @returns {Object.} JSON object + */ + ScanRun.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ScanRun + * @function getTypeUrl + * @memberof google.cloud.websecurityscanner.v1alpha.ScanRun + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ScanRun.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.websecurityscanner.v1alpha.ScanRun"; + }; + + /** + * ExecutionState enum. + * @name google.cloud.websecurityscanner.v1alpha.ScanRun.ExecutionState + * @enum {number} + * @property {number} EXECUTION_STATE_UNSPECIFIED=0 EXECUTION_STATE_UNSPECIFIED value + * @property {number} QUEUED=1 QUEUED value + * @property {number} SCANNING=2 SCANNING value + * @property {number} FINISHED=3 FINISHED value + */ + ScanRun.ExecutionState = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "EXECUTION_STATE_UNSPECIFIED"] = 0; + values[valuesById[1] = "QUEUED"] = 1; + values[valuesById[2] = "SCANNING"] = 2; + values[valuesById[3] = "FINISHED"] = 3; + return values; + })(); + + /** + * ResultState enum. + * @name google.cloud.websecurityscanner.v1alpha.ScanRun.ResultState + * @enum {number} + * @property {number} RESULT_STATE_UNSPECIFIED=0 RESULT_STATE_UNSPECIFIED value + * @property {number} SUCCESS=1 SUCCESS value + * @property {number} ERROR=2 ERROR value + * @property {number} KILLED=3 KILLED value + */ + ScanRun.ResultState = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "RESULT_STATE_UNSPECIFIED"] = 0; + values[valuesById[1] = "SUCCESS"] = 1; + values[valuesById[2] = "ERROR"] = 2; + values[valuesById[3] = "KILLED"] = 3; + return values; + })(); + + return ScanRun; + })(); + + v1alpha.WebSecurityScanner = (function() { + + /** + * Constructs a new WebSecurityScanner service. + * @memberof google.cloud.websecurityscanner.v1alpha + * @classdesc Represents a WebSecurityScanner + * @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 WebSecurityScanner(rpcImpl, requestDelimited, responseDelimited) { + $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited); + } + + (WebSecurityScanner.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = WebSecurityScanner; + + /** + * Creates new WebSecurityScanner service using the specified rpc implementation. + * @function create + * @memberof google.cloud.websecurityscanner.v1alpha.WebSecurityScanner + * @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 {WebSecurityScanner} RPC service. Useful where requests and/or responses are streamed. + */ + WebSecurityScanner.create = function create(rpcImpl, requestDelimited, responseDelimited) { + return new this(rpcImpl, requestDelimited, responseDelimited); + }; + + /** + * Callback as used by {@link google.cloud.websecurityscanner.v1alpha.WebSecurityScanner|createScanConfig}. + * @memberof google.cloud.websecurityscanner.v1alpha.WebSecurityScanner + * @typedef CreateScanConfigCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.websecurityscanner.v1alpha.ScanConfig} [response] ScanConfig + */ + + /** + * Calls CreateScanConfig. + * @function createScanConfig + * @memberof google.cloud.websecurityscanner.v1alpha.WebSecurityScanner + * @instance + * @param {google.cloud.websecurityscanner.v1alpha.ICreateScanConfigRequest} request CreateScanConfigRequest message or plain object + * @param {google.cloud.websecurityscanner.v1alpha.WebSecurityScanner.CreateScanConfigCallback} callback Node-style callback called with the error, if any, and ScanConfig + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(WebSecurityScanner.prototype.createScanConfig = function createScanConfig(request, callback) { + return this.rpcCall(createScanConfig, $root.google.cloud.websecurityscanner.v1alpha.CreateScanConfigRequest, $root.google.cloud.websecurityscanner.v1alpha.ScanConfig, request, callback); + }, "name", { value: "CreateScanConfig" }); + + /** + * Calls CreateScanConfig. + * @function createScanConfig + * @memberof google.cloud.websecurityscanner.v1alpha.WebSecurityScanner + * @instance + * @param {google.cloud.websecurityscanner.v1alpha.ICreateScanConfigRequest} request CreateScanConfigRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.websecurityscanner.v1alpha.WebSecurityScanner|deleteScanConfig}. + * @memberof google.cloud.websecurityscanner.v1alpha.WebSecurityScanner + * @typedef DeleteScanConfigCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.protobuf.Empty} [response] Empty + */ + + /** + * Calls DeleteScanConfig. + * @function deleteScanConfig + * @memberof google.cloud.websecurityscanner.v1alpha.WebSecurityScanner + * @instance + * @param {google.cloud.websecurityscanner.v1alpha.IDeleteScanConfigRequest} request DeleteScanConfigRequest message or plain object + * @param {google.cloud.websecurityscanner.v1alpha.WebSecurityScanner.DeleteScanConfigCallback} callback Node-style callback called with the error, if any, and Empty + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(WebSecurityScanner.prototype.deleteScanConfig = function deleteScanConfig(request, callback) { + return this.rpcCall(deleteScanConfig, $root.google.cloud.websecurityscanner.v1alpha.DeleteScanConfigRequest, $root.google.protobuf.Empty, request, callback); + }, "name", { value: "DeleteScanConfig" }); + + /** + * Calls DeleteScanConfig. + * @function deleteScanConfig + * @memberof google.cloud.websecurityscanner.v1alpha.WebSecurityScanner + * @instance + * @param {google.cloud.websecurityscanner.v1alpha.IDeleteScanConfigRequest} request DeleteScanConfigRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.websecurityscanner.v1alpha.WebSecurityScanner|getScanConfig}. + * @memberof google.cloud.websecurityscanner.v1alpha.WebSecurityScanner + * @typedef GetScanConfigCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.websecurityscanner.v1alpha.ScanConfig} [response] ScanConfig + */ + + /** + * Calls GetScanConfig. + * @function getScanConfig + * @memberof google.cloud.websecurityscanner.v1alpha.WebSecurityScanner + * @instance + * @param {google.cloud.websecurityscanner.v1alpha.IGetScanConfigRequest} request GetScanConfigRequest message or plain object + * @param {google.cloud.websecurityscanner.v1alpha.WebSecurityScanner.GetScanConfigCallback} callback Node-style callback called with the error, if any, and ScanConfig + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(WebSecurityScanner.prototype.getScanConfig = function getScanConfig(request, callback) { + return this.rpcCall(getScanConfig, $root.google.cloud.websecurityscanner.v1alpha.GetScanConfigRequest, $root.google.cloud.websecurityscanner.v1alpha.ScanConfig, request, callback); + }, "name", { value: "GetScanConfig" }); + + /** + * Calls GetScanConfig. + * @function getScanConfig + * @memberof google.cloud.websecurityscanner.v1alpha.WebSecurityScanner + * @instance + * @param {google.cloud.websecurityscanner.v1alpha.IGetScanConfigRequest} request GetScanConfigRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.websecurityscanner.v1alpha.WebSecurityScanner|listScanConfigs}. + * @memberof google.cloud.websecurityscanner.v1alpha.WebSecurityScanner + * @typedef ListScanConfigsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.websecurityscanner.v1alpha.ListScanConfigsResponse} [response] ListScanConfigsResponse + */ + + /** + * Calls ListScanConfigs. + * @function listScanConfigs + * @memberof google.cloud.websecurityscanner.v1alpha.WebSecurityScanner + * @instance + * @param {google.cloud.websecurityscanner.v1alpha.IListScanConfigsRequest} request ListScanConfigsRequest message or plain object + * @param {google.cloud.websecurityscanner.v1alpha.WebSecurityScanner.ListScanConfigsCallback} callback Node-style callback called with the error, if any, and ListScanConfigsResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(WebSecurityScanner.prototype.listScanConfigs = function listScanConfigs(request, callback) { + return this.rpcCall(listScanConfigs, $root.google.cloud.websecurityscanner.v1alpha.ListScanConfigsRequest, $root.google.cloud.websecurityscanner.v1alpha.ListScanConfigsResponse, request, callback); + }, "name", { value: "ListScanConfigs" }); + + /** + * Calls ListScanConfigs. + * @function listScanConfigs + * @memberof google.cloud.websecurityscanner.v1alpha.WebSecurityScanner + * @instance + * @param {google.cloud.websecurityscanner.v1alpha.IListScanConfigsRequest} request ListScanConfigsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.websecurityscanner.v1alpha.WebSecurityScanner|updateScanConfig}. + * @memberof google.cloud.websecurityscanner.v1alpha.WebSecurityScanner + * @typedef UpdateScanConfigCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.websecurityscanner.v1alpha.ScanConfig} [response] ScanConfig + */ + + /** + * Calls UpdateScanConfig. + * @function updateScanConfig + * @memberof google.cloud.websecurityscanner.v1alpha.WebSecurityScanner + * @instance + * @param {google.cloud.websecurityscanner.v1alpha.IUpdateScanConfigRequest} request UpdateScanConfigRequest message or plain object + * @param {google.cloud.websecurityscanner.v1alpha.WebSecurityScanner.UpdateScanConfigCallback} callback Node-style callback called with the error, if any, and ScanConfig + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(WebSecurityScanner.prototype.updateScanConfig = function updateScanConfig(request, callback) { + return this.rpcCall(updateScanConfig, $root.google.cloud.websecurityscanner.v1alpha.UpdateScanConfigRequest, $root.google.cloud.websecurityscanner.v1alpha.ScanConfig, request, callback); + }, "name", { value: "UpdateScanConfig" }); + + /** + * Calls UpdateScanConfig. + * @function updateScanConfig + * @memberof google.cloud.websecurityscanner.v1alpha.WebSecurityScanner + * @instance + * @param {google.cloud.websecurityscanner.v1alpha.IUpdateScanConfigRequest} request UpdateScanConfigRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.websecurityscanner.v1alpha.WebSecurityScanner|startScanRun}. + * @memberof google.cloud.websecurityscanner.v1alpha.WebSecurityScanner + * @typedef StartScanRunCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.websecurityscanner.v1alpha.ScanRun} [response] ScanRun + */ + + /** + * Calls StartScanRun. + * @function startScanRun + * @memberof google.cloud.websecurityscanner.v1alpha.WebSecurityScanner + * @instance + * @param {google.cloud.websecurityscanner.v1alpha.IStartScanRunRequest} request StartScanRunRequest message or plain object + * @param {google.cloud.websecurityscanner.v1alpha.WebSecurityScanner.StartScanRunCallback} callback Node-style callback called with the error, if any, and ScanRun + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(WebSecurityScanner.prototype.startScanRun = function startScanRun(request, callback) { + return this.rpcCall(startScanRun, $root.google.cloud.websecurityscanner.v1alpha.StartScanRunRequest, $root.google.cloud.websecurityscanner.v1alpha.ScanRun, request, callback); + }, "name", { value: "StartScanRun" }); + + /** + * Calls StartScanRun. + * @function startScanRun + * @memberof google.cloud.websecurityscanner.v1alpha.WebSecurityScanner + * @instance + * @param {google.cloud.websecurityscanner.v1alpha.IStartScanRunRequest} request StartScanRunRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.websecurityscanner.v1alpha.WebSecurityScanner|getScanRun}. + * @memberof google.cloud.websecurityscanner.v1alpha.WebSecurityScanner + * @typedef GetScanRunCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.websecurityscanner.v1alpha.ScanRun} [response] ScanRun + */ + + /** + * Calls GetScanRun. + * @function getScanRun + * @memberof google.cloud.websecurityscanner.v1alpha.WebSecurityScanner + * @instance + * @param {google.cloud.websecurityscanner.v1alpha.IGetScanRunRequest} request GetScanRunRequest message or plain object + * @param {google.cloud.websecurityscanner.v1alpha.WebSecurityScanner.GetScanRunCallback} callback Node-style callback called with the error, if any, and ScanRun + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(WebSecurityScanner.prototype.getScanRun = function getScanRun(request, callback) { + return this.rpcCall(getScanRun, $root.google.cloud.websecurityscanner.v1alpha.GetScanRunRequest, $root.google.cloud.websecurityscanner.v1alpha.ScanRun, request, callback); + }, "name", { value: "GetScanRun" }); + + /** + * Calls GetScanRun. + * @function getScanRun + * @memberof google.cloud.websecurityscanner.v1alpha.WebSecurityScanner + * @instance + * @param {google.cloud.websecurityscanner.v1alpha.IGetScanRunRequest} request GetScanRunRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.websecurityscanner.v1alpha.WebSecurityScanner|listScanRuns}. + * @memberof google.cloud.websecurityscanner.v1alpha.WebSecurityScanner + * @typedef ListScanRunsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.websecurityscanner.v1alpha.ListScanRunsResponse} [response] ListScanRunsResponse + */ + + /** + * Calls ListScanRuns. + * @function listScanRuns + * @memberof google.cloud.websecurityscanner.v1alpha.WebSecurityScanner + * @instance + * @param {google.cloud.websecurityscanner.v1alpha.IListScanRunsRequest} request ListScanRunsRequest message or plain object + * @param {google.cloud.websecurityscanner.v1alpha.WebSecurityScanner.ListScanRunsCallback} callback Node-style callback called with the error, if any, and ListScanRunsResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(WebSecurityScanner.prototype.listScanRuns = function listScanRuns(request, callback) { + return this.rpcCall(listScanRuns, $root.google.cloud.websecurityscanner.v1alpha.ListScanRunsRequest, $root.google.cloud.websecurityscanner.v1alpha.ListScanRunsResponse, request, callback); + }, "name", { value: "ListScanRuns" }); + + /** + * Calls ListScanRuns. + * @function listScanRuns + * @memberof google.cloud.websecurityscanner.v1alpha.WebSecurityScanner + * @instance + * @param {google.cloud.websecurityscanner.v1alpha.IListScanRunsRequest} request ListScanRunsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.websecurityscanner.v1alpha.WebSecurityScanner|stopScanRun}. + * @memberof google.cloud.websecurityscanner.v1alpha.WebSecurityScanner + * @typedef StopScanRunCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.websecurityscanner.v1alpha.ScanRun} [response] ScanRun + */ + + /** + * Calls StopScanRun. + * @function stopScanRun + * @memberof google.cloud.websecurityscanner.v1alpha.WebSecurityScanner + * @instance + * @param {google.cloud.websecurityscanner.v1alpha.IStopScanRunRequest} request StopScanRunRequest message or plain object + * @param {google.cloud.websecurityscanner.v1alpha.WebSecurityScanner.StopScanRunCallback} callback Node-style callback called with the error, if any, and ScanRun + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(WebSecurityScanner.prototype.stopScanRun = function stopScanRun(request, callback) { + return this.rpcCall(stopScanRun, $root.google.cloud.websecurityscanner.v1alpha.StopScanRunRequest, $root.google.cloud.websecurityscanner.v1alpha.ScanRun, request, callback); + }, "name", { value: "StopScanRun" }); + + /** + * Calls StopScanRun. + * @function stopScanRun + * @memberof google.cloud.websecurityscanner.v1alpha.WebSecurityScanner + * @instance + * @param {google.cloud.websecurityscanner.v1alpha.IStopScanRunRequest} request StopScanRunRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.websecurityscanner.v1alpha.WebSecurityScanner|listCrawledUrls}. + * @memberof google.cloud.websecurityscanner.v1alpha.WebSecurityScanner + * @typedef ListCrawledUrlsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.websecurityscanner.v1alpha.ListCrawledUrlsResponse} [response] ListCrawledUrlsResponse + */ + + /** + * Calls ListCrawledUrls. + * @function listCrawledUrls + * @memberof google.cloud.websecurityscanner.v1alpha.WebSecurityScanner + * @instance + * @param {google.cloud.websecurityscanner.v1alpha.IListCrawledUrlsRequest} request ListCrawledUrlsRequest message or plain object + * @param {google.cloud.websecurityscanner.v1alpha.WebSecurityScanner.ListCrawledUrlsCallback} callback Node-style callback called with the error, if any, and ListCrawledUrlsResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(WebSecurityScanner.prototype.listCrawledUrls = function listCrawledUrls(request, callback) { + return this.rpcCall(listCrawledUrls, $root.google.cloud.websecurityscanner.v1alpha.ListCrawledUrlsRequest, $root.google.cloud.websecurityscanner.v1alpha.ListCrawledUrlsResponse, request, callback); + }, "name", { value: "ListCrawledUrls" }); + + /** + * Calls ListCrawledUrls. + * @function listCrawledUrls + * @memberof google.cloud.websecurityscanner.v1alpha.WebSecurityScanner + * @instance + * @param {google.cloud.websecurityscanner.v1alpha.IListCrawledUrlsRequest} request ListCrawledUrlsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.websecurityscanner.v1alpha.WebSecurityScanner|getFinding}. + * @memberof google.cloud.websecurityscanner.v1alpha.WebSecurityScanner + * @typedef GetFindingCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.websecurityscanner.v1alpha.Finding} [response] Finding + */ + + /** + * Calls GetFinding. + * @function getFinding + * @memberof google.cloud.websecurityscanner.v1alpha.WebSecurityScanner + * @instance + * @param {google.cloud.websecurityscanner.v1alpha.IGetFindingRequest} request GetFindingRequest message or plain object + * @param {google.cloud.websecurityscanner.v1alpha.WebSecurityScanner.GetFindingCallback} callback Node-style callback called with the error, if any, and Finding + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(WebSecurityScanner.prototype.getFinding = function getFinding(request, callback) { + return this.rpcCall(getFinding, $root.google.cloud.websecurityscanner.v1alpha.GetFindingRequest, $root.google.cloud.websecurityscanner.v1alpha.Finding, request, callback); + }, "name", { value: "GetFinding" }); + + /** + * Calls GetFinding. + * @function getFinding + * @memberof google.cloud.websecurityscanner.v1alpha.WebSecurityScanner + * @instance + * @param {google.cloud.websecurityscanner.v1alpha.IGetFindingRequest} request GetFindingRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.websecurityscanner.v1alpha.WebSecurityScanner|listFindings}. + * @memberof google.cloud.websecurityscanner.v1alpha.WebSecurityScanner + * @typedef ListFindingsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.websecurityscanner.v1alpha.ListFindingsResponse} [response] ListFindingsResponse + */ + + /** + * Calls ListFindings. + * @function listFindings + * @memberof google.cloud.websecurityscanner.v1alpha.WebSecurityScanner + * @instance + * @param {google.cloud.websecurityscanner.v1alpha.IListFindingsRequest} request ListFindingsRequest message or plain object + * @param {google.cloud.websecurityscanner.v1alpha.WebSecurityScanner.ListFindingsCallback} callback Node-style callback called with the error, if any, and ListFindingsResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(WebSecurityScanner.prototype.listFindings = function listFindings(request, callback) { + return this.rpcCall(listFindings, $root.google.cloud.websecurityscanner.v1alpha.ListFindingsRequest, $root.google.cloud.websecurityscanner.v1alpha.ListFindingsResponse, request, callback); + }, "name", { value: "ListFindings" }); + + /** + * Calls ListFindings. + * @function listFindings + * @memberof google.cloud.websecurityscanner.v1alpha.WebSecurityScanner + * @instance + * @param {google.cloud.websecurityscanner.v1alpha.IListFindingsRequest} request ListFindingsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.websecurityscanner.v1alpha.WebSecurityScanner|listFindingTypeStats}. + * @memberof google.cloud.websecurityscanner.v1alpha.WebSecurityScanner + * @typedef ListFindingTypeStatsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.websecurityscanner.v1alpha.ListFindingTypeStatsResponse} [response] ListFindingTypeStatsResponse + */ + + /** + * Calls ListFindingTypeStats. + * @function listFindingTypeStats + * @memberof google.cloud.websecurityscanner.v1alpha.WebSecurityScanner + * @instance + * @param {google.cloud.websecurityscanner.v1alpha.IListFindingTypeStatsRequest} request ListFindingTypeStatsRequest message or plain object + * @param {google.cloud.websecurityscanner.v1alpha.WebSecurityScanner.ListFindingTypeStatsCallback} callback Node-style callback called with the error, if any, and ListFindingTypeStatsResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(WebSecurityScanner.prototype.listFindingTypeStats = function listFindingTypeStats(request, callback) { + return this.rpcCall(listFindingTypeStats, $root.google.cloud.websecurityscanner.v1alpha.ListFindingTypeStatsRequest, $root.google.cloud.websecurityscanner.v1alpha.ListFindingTypeStatsResponse, request, callback); + }, "name", { value: "ListFindingTypeStats" }); + + /** + * Calls ListFindingTypeStats. + * @function listFindingTypeStats + * @memberof google.cloud.websecurityscanner.v1alpha.WebSecurityScanner + * @instance + * @param {google.cloud.websecurityscanner.v1alpha.IListFindingTypeStatsRequest} request ListFindingTypeStatsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + return WebSecurityScanner; + })(); + + v1alpha.CreateScanConfigRequest = (function() { + + /** + * Properties of a CreateScanConfigRequest. + * @memberof google.cloud.websecurityscanner.v1alpha + * @interface ICreateScanConfigRequest + * @property {string|null} [parent] CreateScanConfigRequest parent + * @property {google.cloud.websecurityscanner.v1alpha.IScanConfig|null} [scanConfig] CreateScanConfigRequest scanConfig + */ + + /** + * Constructs a new CreateScanConfigRequest. + * @memberof google.cloud.websecurityscanner.v1alpha + * @classdesc Represents a CreateScanConfigRequest. + * @implements ICreateScanConfigRequest + * @constructor + * @param {google.cloud.websecurityscanner.v1alpha.ICreateScanConfigRequest=} [properties] Properties to set + */ + function CreateScanConfigRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * CreateScanConfigRequest parent. + * @member {string} parent + * @memberof google.cloud.websecurityscanner.v1alpha.CreateScanConfigRequest + * @instance + */ + CreateScanConfigRequest.prototype.parent = ""; + + /** + * CreateScanConfigRequest scanConfig. + * @member {google.cloud.websecurityscanner.v1alpha.IScanConfig|null|undefined} scanConfig + * @memberof google.cloud.websecurityscanner.v1alpha.CreateScanConfigRequest + * @instance + */ + CreateScanConfigRequest.prototype.scanConfig = null; + + /** + * Creates a new CreateScanConfigRequest instance using the specified properties. + * @function create + * @memberof google.cloud.websecurityscanner.v1alpha.CreateScanConfigRequest + * @static + * @param {google.cloud.websecurityscanner.v1alpha.ICreateScanConfigRequest=} [properties] Properties to set + * @returns {google.cloud.websecurityscanner.v1alpha.CreateScanConfigRequest} CreateScanConfigRequest instance + */ + CreateScanConfigRequest.create = function create(properties) { + return new CreateScanConfigRequest(properties); + }; + + /** + * Encodes the specified CreateScanConfigRequest message. Does not implicitly {@link google.cloud.websecurityscanner.v1alpha.CreateScanConfigRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.websecurityscanner.v1alpha.CreateScanConfigRequest + * @static + * @param {google.cloud.websecurityscanner.v1alpha.ICreateScanConfigRequest} message CreateScanConfigRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateScanConfigRequest.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.scanConfig != null && Object.hasOwnProperty.call(message, "scanConfig")) + $root.google.cloud.websecurityscanner.v1alpha.ScanConfig.encode(message.scanConfig, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified CreateScanConfigRequest message, length delimited. Does not implicitly {@link google.cloud.websecurityscanner.v1alpha.CreateScanConfigRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.websecurityscanner.v1alpha.CreateScanConfigRequest + * @static + * @param {google.cloud.websecurityscanner.v1alpha.ICreateScanConfigRequest} message CreateScanConfigRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateScanConfigRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CreateScanConfigRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.websecurityscanner.v1alpha.CreateScanConfigRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.websecurityscanner.v1alpha.CreateScanConfigRequest} CreateScanConfigRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateScanConfigRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.websecurityscanner.v1alpha.CreateScanConfigRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + message.scanConfig = $root.google.cloud.websecurityscanner.v1alpha.ScanConfig.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CreateScanConfigRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.websecurityscanner.v1alpha.CreateScanConfigRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.websecurityscanner.v1alpha.CreateScanConfigRequest} CreateScanConfigRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateScanConfigRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CreateScanConfigRequest message. + * @function verify + * @memberof google.cloud.websecurityscanner.v1alpha.CreateScanConfigRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CreateScanConfigRequest.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.scanConfig != null && message.hasOwnProperty("scanConfig")) { + var error = $root.google.cloud.websecurityscanner.v1alpha.ScanConfig.verify(message.scanConfig); + if (error) + return "scanConfig." + error; + } + return null; + }; + + /** + * Creates a CreateScanConfigRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.websecurityscanner.v1alpha.CreateScanConfigRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.websecurityscanner.v1alpha.CreateScanConfigRequest} CreateScanConfigRequest + */ + CreateScanConfigRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.websecurityscanner.v1alpha.CreateScanConfigRequest) + return object; + var message = new $root.google.cloud.websecurityscanner.v1alpha.CreateScanConfigRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.scanConfig != null) { + if (typeof object.scanConfig !== "object") + throw TypeError(".google.cloud.websecurityscanner.v1alpha.CreateScanConfigRequest.scanConfig: object expected"); + message.scanConfig = $root.google.cloud.websecurityscanner.v1alpha.ScanConfig.fromObject(object.scanConfig); + } + return message; + }; + + /** + * Creates a plain object from a CreateScanConfigRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.websecurityscanner.v1alpha.CreateScanConfigRequest + * @static + * @param {google.cloud.websecurityscanner.v1alpha.CreateScanConfigRequest} message CreateScanConfigRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CreateScanConfigRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.scanConfig = null; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.scanConfig != null && message.hasOwnProperty("scanConfig")) + object.scanConfig = $root.google.cloud.websecurityscanner.v1alpha.ScanConfig.toObject(message.scanConfig, options); + return object; + }; + + /** + * Converts this CreateScanConfigRequest to JSON. + * @function toJSON + * @memberof google.cloud.websecurityscanner.v1alpha.CreateScanConfigRequest + * @instance + * @returns {Object.} JSON object + */ + CreateScanConfigRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CreateScanConfigRequest + * @function getTypeUrl + * @memberof google.cloud.websecurityscanner.v1alpha.CreateScanConfigRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CreateScanConfigRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.websecurityscanner.v1alpha.CreateScanConfigRequest"; + }; + + return CreateScanConfigRequest; + })(); + + v1alpha.DeleteScanConfigRequest = (function() { + + /** + * Properties of a DeleteScanConfigRequest. + * @memberof google.cloud.websecurityscanner.v1alpha + * @interface IDeleteScanConfigRequest + * @property {string|null} [name] DeleteScanConfigRequest name + */ + + /** + * Constructs a new DeleteScanConfigRequest. + * @memberof google.cloud.websecurityscanner.v1alpha + * @classdesc Represents a DeleteScanConfigRequest. + * @implements IDeleteScanConfigRequest + * @constructor + * @param {google.cloud.websecurityscanner.v1alpha.IDeleteScanConfigRequest=} [properties] Properties to set + */ + function DeleteScanConfigRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * DeleteScanConfigRequest name. + * @member {string} name + * @memberof google.cloud.websecurityscanner.v1alpha.DeleteScanConfigRequest + * @instance + */ + DeleteScanConfigRequest.prototype.name = ""; + + /** + * Creates a new DeleteScanConfigRequest instance using the specified properties. + * @function create + * @memberof google.cloud.websecurityscanner.v1alpha.DeleteScanConfigRequest + * @static + * @param {google.cloud.websecurityscanner.v1alpha.IDeleteScanConfigRequest=} [properties] Properties to set + * @returns {google.cloud.websecurityscanner.v1alpha.DeleteScanConfigRequest} DeleteScanConfigRequest instance + */ + DeleteScanConfigRequest.create = function create(properties) { + return new DeleteScanConfigRequest(properties); + }; + + /** + * Encodes the specified DeleteScanConfigRequest message. Does not implicitly {@link google.cloud.websecurityscanner.v1alpha.DeleteScanConfigRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.websecurityscanner.v1alpha.DeleteScanConfigRequest + * @static + * @param {google.cloud.websecurityscanner.v1alpha.IDeleteScanConfigRequest} message DeleteScanConfigRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteScanConfigRequest.encode = function encode(message, writer) { + 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 DeleteScanConfigRequest message, length delimited. Does not implicitly {@link google.cloud.websecurityscanner.v1alpha.DeleteScanConfigRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.websecurityscanner.v1alpha.DeleteScanConfigRequest + * @static + * @param {google.cloud.websecurityscanner.v1alpha.IDeleteScanConfigRequest} message DeleteScanConfigRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteScanConfigRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DeleteScanConfigRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.websecurityscanner.v1alpha.DeleteScanConfigRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.websecurityscanner.v1alpha.DeleteScanConfigRequest} DeleteScanConfigRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteScanConfigRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.websecurityscanner.v1alpha.DeleteScanConfigRequest(); + 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 DeleteScanConfigRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.websecurityscanner.v1alpha.DeleteScanConfigRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.websecurityscanner.v1alpha.DeleteScanConfigRequest} DeleteScanConfigRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteScanConfigRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DeleteScanConfigRequest message. + * @function verify + * @memberof google.cloud.websecurityscanner.v1alpha.DeleteScanConfigRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DeleteScanConfigRequest.verify = function verify(message) { + if (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 DeleteScanConfigRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.websecurityscanner.v1alpha.DeleteScanConfigRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.websecurityscanner.v1alpha.DeleteScanConfigRequest} DeleteScanConfigRequest + */ + DeleteScanConfigRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.websecurityscanner.v1alpha.DeleteScanConfigRequest) + return object; + var message = new $root.google.cloud.websecurityscanner.v1alpha.DeleteScanConfigRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a DeleteScanConfigRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.websecurityscanner.v1alpha.DeleteScanConfigRequest + * @static + * @param {google.cloud.websecurityscanner.v1alpha.DeleteScanConfigRequest} message DeleteScanConfigRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DeleteScanConfigRequest.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 DeleteScanConfigRequest to JSON. + * @function toJSON + * @memberof google.cloud.websecurityscanner.v1alpha.DeleteScanConfigRequest + * @instance + * @returns {Object.} JSON object + */ + DeleteScanConfigRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DeleteScanConfigRequest + * @function getTypeUrl + * @memberof google.cloud.websecurityscanner.v1alpha.DeleteScanConfigRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DeleteScanConfigRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.websecurityscanner.v1alpha.DeleteScanConfigRequest"; + }; + + return DeleteScanConfigRequest; + })(); + + v1alpha.GetScanConfigRequest = (function() { + + /** + * Properties of a GetScanConfigRequest. + * @memberof google.cloud.websecurityscanner.v1alpha + * @interface IGetScanConfigRequest + * @property {string|null} [name] GetScanConfigRequest name + */ + + /** + * Constructs a new GetScanConfigRequest. + * @memberof google.cloud.websecurityscanner.v1alpha + * @classdesc Represents a GetScanConfigRequest. + * @implements IGetScanConfigRequest + * @constructor + * @param {google.cloud.websecurityscanner.v1alpha.IGetScanConfigRequest=} [properties] Properties to set + */ + function GetScanConfigRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetScanConfigRequest name. + * @member {string} name + * @memberof google.cloud.websecurityscanner.v1alpha.GetScanConfigRequest + * @instance + */ + GetScanConfigRequest.prototype.name = ""; + + /** + * Creates a new GetScanConfigRequest instance using the specified properties. + * @function create + * @memberof google.cloud.websecurityscanner.v1alpha.GetScanConfigRequest + * @static + * @param {google.cloud.websecurityscanner.v1alpha.IGetScanConfigRequest=} [properties] Properties to set + * @returns {google.cloud.websecurityscanner.v1alpha.GetScanConfigRequest} GetScanConfigRequest instance + */ + GetScanConfigRequest.create = function create(properties) { + return new GetScanConfigRequest(properties); + }; + + /** + * Encodes the specified GetScanConfigRequest message. Does not implicitly {@link google.cloud.websecurityscanner.v1alpha.GetScanConfigRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.websecurityscanner.v1alpha.GetScanConfigRequest + * @static + * @param {google.cloud.websecurityscanner.v1alpha.IGetScanConfigRequest} message GetScanConfigRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetScanConfigRequest.encode = function encode(message, writer) { + 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 GetScanConfigRequest message, length delimited. Does not implicitly {@link google.cloud.websecurityscanner.v1alpha.GetScanConfigRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.websecurityscanner.v1alpha.GetScanConfigRequest + * @static + * @param {google.cloud.websecurityscanner.v1alpha.IGetScanConfigRequest} message GetScanConfigRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetScanConfigRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetScanConfigRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.websecurityscanner.v1alpha.GetScanConfigRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.websecurityscanner.v1alpha.GetScanConfigRequest} GetScanConfigRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetScanConfigRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.websecurityscanner.v1alpha.GetScanConfigRequest(); + 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 GetScanConfigRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.websecurityscanner.v1alpha.GetScanConfigRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.websecurityscanner.v1alpha.GetScanConfigRequest} GetScanConfigRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetScanConfigRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetScanConfigRequest message. + * @function verify + * @memberof google.cloud.websecurityscanner.v1alpha.GetScanConfigRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetScanConfigRequest.verify = function verify(message) { + if (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 GetScanConfigRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.websecurityscanner.v1alpha.GetScanConfigRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.websecurityscanner.v1alpha.GetScanConfigRequest} GetScanConfigRequest + */ + GetScanConfigRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.websecurityscanner.v1alpha.GetScanConfigRequest) + return object; + var message = new $root.google.cloud.websecurityscanner.v1alpha.GetScanConfigRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a GetScanConfigRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.websecurityscanner.v1alpha.GetScanConfigRequest + * @static + * @param {google.cloud.websecurityscanner.v1alpha.GetScanConfigRequest} message GetScanConfigRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetScanConfigRequest.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 GetScanConfigRequest to JSON. + * @function toJSON + * @memberof google.cloud.websecurityscanner.v1alpha.GetScanConfigRequest + * @instance + * @returns {Object.} JSON object + */ + GetScanConfigRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GetScanConfigRequest + * @function getTypeUrl + * @memberof google.cloud.websecurityscanner.v1alpha.GetScanConfigRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GetScanConfigRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.websecurityscanner.v1alpha.GetScanConfigRequest"; + }; + + return GetScanConfigRequest; + })(); + + v1alpha.ListScanConfigsRequest = (function() { + + /** + * Properties of a ListScanConfigsRequest. + * @memberof google.cloud.websecurityscanner.v1alpha + * @interface IListScanConfigsRequest + * @property {string|null} [parent] ListScanConfigsRequest parent + * @property {string|null} [pageToken] ListScanConfigsRequest pageToken + * @property {number|null} [pageSize] ListScanConfigsRequest pageSize + */ + + /** + * Constructs a new ListScanConfigsRequest. + * @memberof google.cloud.websecurityscanner.v1alpha + * @classdesc Represents a ListScanConfigsRequest. + * @implements IListScanConfigsRequest + * @constructor + * @param {google.cloud.websecurityscanner.v1alpha.IListScanConfigsRequest=} [properties] Properties to set + */ + function ListScanConfigsRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListScanConfigsRequest parent. + * @member {string} parent + * @memberof google.cloud.websecurityscanner.v1alpha.ListScanConfigsRequest + * @instance + */ + ListScanConfigsRequest.prototype.parent = ""; + + /** + * ListScanConfigsRequest pageToken. + * @member {string} pageToken + * @memberof google.cloud.websecurityscanner.v1alpha.ListScanConfigsRequest + * @instance + */ + ListScanConfigsRequest.prototype.pageToken = ""; + + /** + * ListScanConfigsRequest pageSize. + * @member {number} pageSize + * @memberof google.cloud.websecurityscanner.v1alpha.ListScanConfigsRequest + * @instance + */ + ListScanConfigsRequest.prototype.pageSize = 0; + + /** + * Creates a new ListScanConfigsRequest instance using the specified properties. + * @function create + * @memberof google.cloud.websecurityscanner.v1alpha.ListScanConfigsRequest + * @static + * @param {google.cloud.websecurityscanner.v1alpha.IListScanConfigsRequest=} [properties] Properties to set + * @returns {google.cloud.websecurityscanner.v1alpha.ListScanConfigsRequest} ListScanConfigsRequest instance + */ + ListScanConfigsRequest.create = function create(properties) { + return new ListScanConfigsRequest(properties); + }; + + /** + * Encodes the specified ListScanConfigsRequest message. Does not implicitly {@link google.cloud.websecurityscanner.v1alpha.ListScanConfigsRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.websecurityscanner.v1alpha.ListScanConfigsRequest + * @static + * @param {google.cloud.websecurityscanner.v1alpha.IListScanConfigsRequest} message ListScanConfigsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListScanConfigsRequest.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.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.pageToken); + if (message.pageSize != null && Object.hasOwnProperty.call(message, "pageSize")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.pageSize); + return writer; + }; + + /** + * Encodes the specified ListScanConfigsRequest message, length delimited. Does not implicitly {@link google.cloud.websecurityscanner.v1alpha.ListScanConfigsRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.websecurityscanner.v1alpha.ListScanConfigsRequest + * @static + * @param {google.cloud.websecurityscanner.v1alpha.IListScanConfigsRequest} message ListScanConfigsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListScanConfigsRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListScanConfigsRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.websecurityscanner.v1alpha.ListScanConfigsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.websecurityscanner.v1alpha.ListScanConfigsRequest} ListScanConfigsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListScanConfigsRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.websecurityscanner.v1alpha.ListScanConfigsRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + message.pageToken = reader.string(); + break; + } + case 3: { + message.pageSize = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListScanConfigsRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.websecurityscanner.v1alpha.ListScanConfigsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.websecurityscanner.v1alpha.ListScanConfigsRequest} ListScanConfigsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListScanConfigsRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListScanConfigsRequest message. + * @function verify + * @memberof google.cloud.websecurityscanner.v1alpha.ListScanConfigsRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListScanConfigsRequest.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.pageToken != null && message.hasOwnProperty("pageToken")) + if (!$util.isString(message.pageToken)) + return "pageToken: string expected"; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + if (!$util.isInteger(message.pageSize)) + return "pageSize: integer expected"; + return null; + }; + + /** + * Creates a ListScanConfigsRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.websecurityscanner.v1alpha.ListScanConfigsRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.websecurityscanner.v1alpha.ListScanConfigsRequest} ListScanConfigsRequest + */ + ListScanConfigsRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.websecurityscanner.v1alpha.ListScanConfigsRequest) + return object; + var message = new $root.google.cloud.websecurityscanner.v1alpha.ListScanConfigsRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.pageToken != null) + message.pageToken = String(object.pageToken); + if (object.pageSize != null) + message.pageSize = object.pageSize | 0; + return message; + }; + + /** + * Creates a plain object from a ListScanConfigsRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.websecurityscanner.v1alpha.ListScanConfigsRequest + * @static + * @param {google.cloud.websecurityscanner.v1alpha.ListScanConfigsRequest} message ListScanConfigsRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListScanConfigsRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.pageToken = ""; + object.pageSize = 0; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + object.pageToken = message.pageToken; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + object.pageSize = message.pageSize; + return object; + }; + + /** + * Converts this ListScanConfigsRequest to JSON. + * @function toJSON + * @memberof google.cloud.websecurityscanner.v1alpha.ListScanConfigsRequest + * @instance + * @returns {Object.} JSON object + */ + ListScanConfigsRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListScanConfigsRequest + * @function getTypeUrl + * @memberof google.cloud.websecurityscanner.v1alpha.ListScanConfigsRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListScanConfigsRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.websecurityscanner.v1alpha.ListScanConfigsRequest"; + }; + + return ListScanConfigsRequest; + })(); + + v1alpha.UpdateScanConfigRequest = (function() { + + /** + * Properties of an UpdateScanConfigRequest. + * @memberof google.cloud.websecurityscanner.v1alpha + * @interface IUpdateScanConfigRequest + * @property {google.cloud.websecurityscanner.v1alpha.IScanConfig|null} [scanConfig] UpdateScanConfigRequest scanConfig + * @property {google.protobuf.IFieldMask|null} [updateMask] UpdateScanConfigRequest updateMask + */ + + /** + * Constructs a new UpdateScanConfigRequest. + * @memberof google.cloud.websecurityscanner.v1alpha + * @classdesc Represents an UpdateScanConfigRequest. + * @implements IUpdateScanConfigRequest + * @constructor + * @param {google.cloud.websecurityscanner.v1alpha.IUpdateScanConfigRequest=} [properties] Properties to set + */ + function UpdateScanConfigRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * UpdateScanConfigRequest scanConfig. + * @member {google.cloud.websecurityscanner.v1alpha.IScanConfig|null|undefined} scanConfig + * @memberof google.cloud.websecurityscanner.v1alpha.UpdateScanConfigRequest + * @instance + */ + UpdateScanConfigRequest.prototype.scanConfig = null; + + /** + * UpdateScanConfigRequest updateMask. + * @member {google.protobuf.IFieldMask|null|undefined} updateMask + * @memberof google.cloud.websecurityscanner.v1alpha.UpdateScanConfigRequest + * @instance + */ + UpdateScanConfigRequest.prototype.updateMask = null; + + /** + * Creates a new UpdateScanConfigRequest instance using the specified properties. + * @function create + * @memberof google.cloud.websecurityscanner.v1alpha.UpdateScanConfigRequest + * @static + * @param {google.cloud.websecurityscanner.v1alpha.IUpdateScanConfigRequest=} [properties] Properties to set + * @returns {google.cloud.websecurityscanner.v1alpha.UpdateScanConfigRequest} UpdateScanConfigRequest instance + */ + UpdateScanConfigRequest.create = function create(properties) { + return new UpdateScanConfigRequest(properties); + }; + + /** + * Encodes the specified UpdateScanConfigRequest message. Does not implicitly {@link google.cloud.websecurityscanner.v1alpha.UpdateScanConfigRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.websecurityscanner.v1alpha.UpdateScanConfigRequest + * @static + * @param {google.cloud.websecurityscanner.v1alpha.IUpdateScanConfigRequest} message UpdateScanConfigRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateScanConfigRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.scanConfig != null && Object.hasOwnProperty.call(message, "scanConfig")) + $root.google.cloud.websecurityscanner.v1alpha.ScanConfig.encode(message.scanConfig, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.updateMask != null && Object.hasOwnProperty.call(message, "updateMask")) + $root.google.protobuf.FieldMask.encode(message.updateMask, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified UpdateScanConfigRequest message, length delimited. Does not implicitly {@link google.cloud.websecurityscanner.v1alpha.UpdateScanConfigRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.websecurityscanner.v1alpha.UpdateScanConfigRequest + * @static + * @param {google.cloud.websecurityscanner.v1alpha.IUpdateScanConfigRequest} message UpdateScanConfigRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateScanConfigRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an UpdateScanConfigRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.websecurityscanner.v1alpha.UpdateScanConfigRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.websecurityscanner.v1alpha.UpdateScanConfigRequest} UpdateScanConfigRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateScanConfigRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.websecurityscanner.v1alpha.UpdateScanConfigRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 2: { + message.scanConfig = $root.google.cloud.websecurityscanner.v1alpha.ScanConfig.decode(reader, reader.uint32()); + break; + } + case 3: { + message.updateMask = $root.google.protobuf.FieldMask.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an UpdateScanConfigRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.websecurityscanner.v1alpha.UpdateScanConfigRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.websecurityscanner.v1alpha.UpdateScanConfigRequest} UpdateScanConfigRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateScanConfigRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an UpdateScanConfigRequest message. + * @function verify + * @memberof google.cloud.websecurityscanner.v1alpha.UpdateScanConfigRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + UpdateScanConfigRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.scanConfig != null && message.hasOwnProperty("scanConfig")) { + var error = $root.google.cloud.websecurityscanner.v1alpha.ScanConfig.verify(message.scanConfig); + if (error) + return "scanConfig." + 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 UpdateScanConfigRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.websecurityscanner.v1alpha.UpdateScanConfigRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.websecurityscanner.v1alpha.UpdateScanConfigRequest} UpdateScanConfigRequest + */ + UpdateScanConfigRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.websecurityscanner.v1alpha.UpdateScanConfigRequest) + return object; + var message = new $root.google.cloud.websecurityscanner.v1alpha.UpdateScanConfigRequest(); + if (object.scanConfig != null) { + if (typeof object.scanConfig !== "object") + throw TypeError(".google.cloud.websecurityscanner.v1alpha.UpdateScanConfigRequest.scanConfig: object expected"); + message.scanConfig = $root.google.cloud.websecurityscanner.v1alpha.ScanConfig.fromObject(object.scanConfig); + } + if (object.updateMask != null) { + if (typeof object.updateMask !== "object") + throw TypeError(".google.cloud.websecurityscanner.v1alpha.UpdateScanConfigRequest.updateMask: object expected"); + message.updateMask = $root.google.protobuf.FieldMask.fromObject(object.updateMask); + } + return message; + }; + + /** + * Creates a plain object from an UpdateScanConfigRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.websecurityscanner.v1alpha.UpdateScanConfigRequest + * @static + * @param {google.cloud.websecurityscanner.v1alpha.UpdateScanConfigRequest} message UpdateScanConfigRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + UpdateScanConfigRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.scanConfig = null; + object.updateMask = null; + } + if (message.scanConfig != null && message.hasOwnProperty("scanConfig")) + object.scanConfig = $root.google.cloud.websecurityscanner.v1alpha.ScanConfig.toObject(message.scanConfig, options); + if (message.updateMask != null && message.hasOwnProperty("updateMask")) + object.updateMask = $root.google.protobuf.FieldMask.toObject(message.updateMask, options); + return object; + }; + + /** + * Converts this UpdateScanConfigRequest to JSON. + * @function toJSON + * @memberof google.cloud.websecurityscanner.v1alpha.UpdateScanConfigRequest + * @instance + * @returns {Object.} JSON object + */ + UpdateScanConfigRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for UpdateScanConfigRequest + * @function getTypeUrl + * @memberof google.cloud.websecurityscanner.v1alpha.UpdateScanConfigRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + UpdateScanConfigRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.websecurityscanner.v1alpha.UpdateScanConfigRequest"; + }; + + return UpdateScanConfigRequest; + })(); + + v1alpha.ListScanConfigsResponse = (function() { + + /** + * Properties of a ListScanConfigsResponse. + * @memberof google.cloud.websecurityscanner.v1alpha + * @interface IListScanConfigsResponse + * @property {Array.|null} [scanConfigs] ListScanConfigsResponse scanConfigs + * @property {string|null} [nextPageToken] ListScanConfigsResponse nextPageToken + */ + + /** + * Constructs a new ListScanConfigsResponse. + * @memberof google.cloud.websecurityscanner.v1alpha + * @classdesc Represents a ListScanConfigsResponse. + * @implements IListScanConfigsResponse + * @constructor + * @param {google.cloud.websecurityscanner.v1alpha.IListScanConfigsResponse=} [properties] Properties to set + */ + function ListScanConfigsResponse(properties) { + this.scanConfigs = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListScanConfigsResponse scanConfigs. + * @member {Array.} scanConfigs + * @memberof google.cloud.websecurityscanner.v1alpha.ListScanConfigsResponse + * @instance + */ + ListScanConfigsResponse.prototype.scanConfigs = $util.emptyArray; + + /** + * ListScanConfigsResponse nextPageToken. + * @member {string} nextPageToken + * @memberof google.cloud.websecurityscanner.v1alpha.ListScanConfigsResponse + * @instance + */ + ListScanConfigsResponse.prototype.nextPageToken = ""; + + /** + * Creates a new ListScanConfigsResponse instance using the specified properties. + * @function create + * @memberof google.cloud.websecurityscanner.v1alpha.ListScanConfigsResponse + * @static + * @param {google.cloud.websecurityscanner.v1alpha.IListScanConfigsResponse=} [properties] Properties to set + * @returns {google.cloud.websecurityscanner.v1alpha.ListScanConfigsResponse} ListScanConfigsResponse instance + */ + ListScanConfigsResponse.create = function create(properties) { + return new ListScanConfigsResponse(properties); + }; + + /** + * Encodes the specified ListScanConfigsResponse message. Does not implicitly {@link google.cloud.websecurityscanner.v1alpha.ListScanConfigsResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.websecurityscanner.v1alpha.ListScanConfigsResponse + * @static + * @param {google.cloud.websecurityscanner.v1alpha.IListScanConfigsResponse} message ListScanConfigsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListScanConfigsResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.scanConfigs != null && message.scanConfigs.length) + for (var i = 0; i < message.scanConfigs.length; ++i) + $root.google.cloud.websecurityscanner.v1alpha.ScanConfig.encode(message.scanConfigs[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 ListScanConfigsResponse message, length delimited. Does not implicitly {@link google.cloud.websecurityscanner.v1alpha.ListScanConfigsResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.websecurityscanner.v1alpha.ListScanConfigsResponse + * @static + * @param {google.cloud.websecurityscanner.v1alpha.IListScanConfigsResponse} message ListScanConfigsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListScanConfigsResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListScanConfigsResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.websecurityscanner.v1alpha.ListScanConfigsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.websecurityscanner.v1alpha.ListScanConfigsResponse} ListScanConfigsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListScanConfigsResponse.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.websecurityscanner.v1alpha.ListScanConfigsResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.scanConfigs && message.scanConfigs.length)) + message.scanConfigs = []; + message.scanConfigs.push($root.google.cloud.websecurityscanner.v1alpha.ScanConfig.decode(reader, reader.uint32())); + break; + } + case 2: { + message.nextPageToken = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListScanConfigsResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.websecurityscanner.v1alpha.ListScanConfigsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.websecurityscanner.v1alpha.ListScanConfigsResponse} ListScanConfigsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListScanConfigsResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListScanConfigsResponse message. + * @function verify + * @memberof google.cloud.websecurityscanner.v1alpha.ListScanConfigsResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListScanConfigsResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.scanConfigs != null && message.hasOwnProperty("scanConfigs")) { + if (!Array.isArray(message.scanConfigs)) + return "scanConfigs: array expected"; + for (var i = 0; i < message.scanConfigs.length; ++i) { + var error = $root.google.cloud.websecurityscanner.v1alpha.ScanConfig.verify(message.scanConfigs[i]); + if (error) + return "scanConfigs." + error; + } + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; + return null; + }; + + /** + * Creates a ListScanConfigsResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.websecurityscanner.v1alpha.ListScanConfigsResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.websecurityscanner.v1alpha.ListScanConfigsResponse} ListScanConfigsResponse + */ + ListScanConfigsResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.websecurityscanner.v1alpha.ListScanConfigsResponse) + return object; + var message = new $root.google.cloud.websecurityscanner.v1alpha.ListScanConfigsResponse(); + if (object.scanConfigs) { + if (!Array.isArray(object.scanConfigs)) + throw TypeError(".google.cloud.websecurityscanner.v1alpha.ListScanConfigsResponse.scanConfigs: array expected"); + message.scanConfigs = []; + for (var i = 0; i < object.scanConfigs.length; ++i) { + if (typeof object.scanConfigs[i] !== "object") + throw TypeError(".google.cloud.websecurityscanner.v1alpha.ListScanConfigsResponse.scanConfigs: object expected"); + message.scanConfigs[i] = $root.google.cloud.websecurityscanner.v1alpha.ScanConfig.fromObject(object.scanConfigs[i]); + } + } + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + return message; + }; + + /** + * Creates a plain object from a ListScanConfigsResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.websecurityscanner.v1alpha.ListScanConfigsResponse + * @static + * @param {google.cloud.websecurityscanner.v1alpha.ListScanConfigsResponse} message ListScanConfigsResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListScanConfigsResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.scanConfigs = []; + if (options.defaults) + object.nextPageToken = ""; + if (message.scanConfigs && message.scanConfigs.length) { + object.scanConfigs = []; + for (var j = 0; j < message.scanConfigs.length; ++j) + object.scanConfigs[j] = $root.google.cloud.websecurityscanner.v1alpha.ScanConfig.toObject(message.scanConfigs[j], options); + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + object.nextPageToken = message.nextPageToken; + return object; + }; + + /** + * Converts this ListScanConfigsResponse to JSON. + * @function toJSON + * @memberof google.cloud.websecurityscanner.v1alpha.ListScanConfigsResponse + * @instance + * @returns {Object.} JSON object + */ + ListScanConfigsResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListScanConfigsResponse + * @function getTypeUrl + * @memberof google.cloud.websecurityscanner.v1alpha.ListScanConfigsResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListScanConfigsResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.websecurityscanner.v1alpha.ListScanConfigsResponse"; + }; + + return ListScanConfigsResponse; + })(); + + v1alpha.StartScanRunRequest = (function() { + + /** + * Properties of a StartScanRunRequest. + * @memberof google.cloud.websecurityscanner.v1alpha + * @interface IStartScanRunRequest + * @property {string|null} [name] StartScanRunRequest name + */ + + /** + * Constructs a new StartScanRunRequest. + * @memberof google.cloud.websecurityscanner.v1alpha + * @classdesc Represents a StartScanRunRequest. + * @implements IStartScanRunRequest + * @constructor + * @param {google.cloud.websecurityscanner.v1alpha.IStartScanRunRequest=} [properties] Properties to set + */ + function StartScanRunRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * StartScanRunRequest name. + * @member {string} name + * @memberof google.cloud.websecurityscanner.v1alpha.StartScanRunRequest + * @instance + */ + StartScanRunRequest.prototype.name = ""; + + /** + * Creates a new StartScanRunRequest instance using the specified properties. + * @function create + * @memberof google.cloud.websecurityscanner.v1alpha.StartScanRunRequest + * @static + * @param {google.cloud.websecurityscanner.v1alpha.IStartScanRunRequest=} [properties] Properties to set + * @returns {google.cloud.websecurityscanner.v1alpha.StartScanRunRequest} StartScanRunRequest instance + */ + StartScanRunRequest.create = function create(properties) { + return new StartScanRunRequest(properties); + }; + + /** + * Encodes the specified StartScanRunRequest message. Does not implicitly {@link google.cloud.websecurityscanner.v1alpha.StartScanRunRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.websecurityscanner.v1alpha.StartScanRunRequest + * @static + * @param {google.cloud.websecurityscanner.v1alpha.IStartScanRunRequest} message StartScanRunRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + StartScanRunRequest.encode = function encode(message, writer) { + 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 StartScanRunRequest message, length delimited. Does not implicitly {@link google.cloud.websecurityscanner.v1alpha.StartScanRunRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.websecurityscanner.v1alpha.StartScanRunRequest + * @static + * @param {google.cloud.websecurityscanner.v1alpha.IStartScanRunRequest} message StartScanRunRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + StartScanRunRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a StartScanRunRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.websecurityscanner.v1alpha.StartScanRunRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.websecurityscanner.v1alpha.StartScanRunRequest} StartScanRunRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + StartScanRunRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.websecurityscanner.v1alpha.StartScanRunRequest(); + 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 StartScanRunRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.websecurityscanner.v1alpha.StartScanRunRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.websecurityscanner.v1alpha.StartScanRunRequest} StartScanRunRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + StartScanRunRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a StartScanRunRequest message. + * @function verify + * @memberof google.cloud.websecurityscanner.v1alpha.StartScanRunRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + StartScanRunRequest.verify = function verify(message) { + if (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 StartScanRunRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.websecurityscanner.v1alpha.StartScanRunRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.websecurityscanner.v1alpha.StartScanRunRequest} StartScanRunRequest + */ + StartScanRunRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.websecurityscanner.v1alpha.StartScanRunRequest) + return object; + var message = new $root.google.cloud.websecurityscanner.v1alpha.StartScanRunRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a StartScanRunRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.websecurityscanner.v1alpha.StartScanRunRequest + * @static + * @param {google.cloud.websecurityscanner.v1alpha.StartScanRunRequest} message StartScanRunRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + StartScanRunRequest.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 StartScanRunRequest to JSON. + * @function toJSON + * @memberof google.cloud.websecurityscanner.v1alpha.StartScanRunRequest + * @instance + * @returns {Object.} JSON object + */ + StartScanRunRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for StartScanRunRequest + * @function getTypeUrl + * @memberof google.cloud.websecurityscanner.v1alpha.StartScanRunRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + StartScanRunRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.websecurityscanner.v1alpha.StartScanRunRequest"; + }; + + return StartScanRunRequest; + })(); + + v1alpha.GetScanRunRequest = (function() { + + /** + * Properties of a GetScanRunRequest. + * @memberof google.cloud.websecurityscanner.v1alpha + * @interface IGetScanRunRequest + * @property {string|null} [name] GetScanRunRequest name + */ + + /** + * Constructs a new GetScanRunRequest. + * @memberof google.cloud.websecurityscanner.v1alpha + * @classdesc Represents a GetScanRunRequest. + * @implements IGetScanRunRequest + * @constructor + * @param {google.cloud.websecurityscanner.v1alpha.IGetScanRunRequest=} [properties] Properties to set + */ + function GetScanRunRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetScanRunRequest name. + * @member {string} name + * @memberof google.cloud.websecurityscanner.v1alpha.GetScanRunRequest + * @instance + */ + GetScanRunRequest.prototype.name = ""; + + /** + * Creates a new GetScanRunRequest instance using the specified properties. + * @function create + * @memberof google.cloud.websecurityscanner.v1alpha.GetScanRunRequest + * @static + * @param {google.cloud.websecurityscanner.v1alpha.IGetScanRunRequest=} [properties] Properties to set + * @returns {google.cloud.websecurityscanner.v1alpha.GetScanRunRequest} GetScanRunRequest instance + */ + GetScanRunRequest.create = function create(properties) { + return new GetScanRunRequest(properties); + }; + + /** + * Encodes the specified GetScanRunRequest message. Does not implicitly {@link google.cloud.websecurityscanner.v1alpha.GetScanRunRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.websecurityscanner.v1alpha.GetScanRunRequest + * @static + * @param {google.cloud.websecurityscanner.v1alpha.IGetScanRunRequest} message GetScanRunRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetScanRunRequest.encode = function encode(message, writer) { + 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 GetScanRunRequest message, length delimited. Does not implicitly {@link google.cloud.websecurityscanner.v1alpha.GetScanRunRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.websecurityscanner.v1alpha.GetScanRunRequest + * @static + * @param {google.cloud.websecurityscanner.v1alpha.IGetScanRunRequest} message GetScanRunRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetScanRunRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetScanRunRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.websecurityscanner.v1alpha.GetScanRunRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.websecurityscanner.v1alpha.GetScanRunRequest} GetScanRunRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetScanRunRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.websecurityscanner.v1alpha.GetScanRunRequest(); + 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 GetScanRunRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.websecurityscanner.v1alpha.GetScanRunRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.websecurityscanner.v1alpha.GetScanRunRequest} GetScanRunRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetScanRunRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetScanRunRequest message. + * @function verify + * @memberof google.cloud.websecurityscanner.v1alpha.GetScanRunRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetScanRunRequest.verify = function verify(message) { + if (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 GetScanRunRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.websecurityscanner.v1alpha.GetScanRunRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.websecurityscanner.v1alpha.GetScanRunRequest} GetScanRunRequest + */ + GetScanRunRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.websecurityscanner.v1alpha.GetScanRunRequest) + return object; + var message = new $root.google.cloud.websecurityscanner.v1alpha.GetScanRunRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a GetScanRunRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.websecurityscanner.v1alpha.GetScanRunRequest + * @static + * @param {google.cloud.websecurityscanner.v1alpha.GetScanRunRequest} message GetScanRunRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetScanRunRequest.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 GetScanRunRequest to JSON. + * @function toJSON + * @memberof google.cloud.websecurityscanner.v1alpha.GetScanRunRequest + * @instance + * @returns {Object.} JSON object + */ + GetScanRunRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GetScanRunRequest + * @function getTypeUrl + * @memberof google.cloud.websecurityscanner.v1alpha.GetScanRunRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GetScanRunRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.websecurityscanner.v1alpha.GetScanRunRequest"; + }; + + return GetScanRunRequest; + })(); + + v1alpha.ListScanRunsRequest = (function() { + + /** + * Properties of a ListScanRunsRequest. + * @memberof google.cloud.websecurityscanner.v1alpha + * @interface IListScanRunsRequest + * @property {string|null} [parent] ListScanRunsRequest parent + * @property {string|null} [pageToken] ListScanRunsRequest pageToken + * @property {number|null} [pageSize] ListScanRunsRequest pageSize + */ + + /** + * Constructs a new ListScanRunsRequest. + * @memberof google.cloud.websecurityscanner.v1alpha + * @classdesc Represents a ListScanRunsRequest. + * @implements IListScanRunsRequest + * @constructor + * @param {google.cloud.websecurityscanner.v1alpha.IListScanRunsRequest=} [properties] Properties to set + */ + function ListScanRunsRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListScanRunsRequest parent. + * @member {string} parent + * @memberof google.cloud.websecurityscanner.v1alpha.ListScanRunsRequest + * @instance + */ + ListScanRunsRequest.prototype.parent = ""; + + /** + * ListScanRunsRequest pageToken. + * @member {string} pageToken + * @memberof google.cloud.websecurityscanner.v1alpha.ListScanRunsRequest + * @instance + */ + ListScanRunsRequest.prototype.pageToken = ""; + + /** + * ListScanRunsRequest pageSize. + * @member {number} pageSize + * @memberof google.cloud.websecurityscanner.v1alpha.ListScanRunsRequest + * @instance + */ + ListScanRunsRequest.prototype.pageSize = 0; + + /** + * Creates a new ListScanRunsRequest instance using the specified properties. + * @function create + * @memberof google.cloud.websecurityscanner.v1alpha.ListScanRunsRequest + * @static + * @param {google.cloud.websecurityscanner.v1alpha.IListScanRunsRequest=} [properties] Properties to set + * @returns {google.cloud.websecurityscanner.v1alpha.ListScanRunsRequest} ListScanRunsRequest instance + */ + ListScanRunsRequest.create = function create(properties) { + return new ListScanRunsRequest(properties); + }; + + /** + * Encodes the specified ListScanRunsRequest message. Does not implicitly {@link google.cloud.websecurityscanner.v1alpha.ListScanRunsRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.websecurityscanner.v1alpha.ListScanRunsRequest + * @static + * @param {google.cloud.websecurityscanner.v1alpha.IListScanRunsRequest} message ListScanRunsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListScanRunsRequest.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.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.pageToken); + if (message.pageSize != null && Object.hasOwnProperty.call(message, "pageSize")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.pageSize); + return writer; + }; + + /** + * Encodes the specified ListScanRunsRequest message, length delimited. Does not implicitly {@link google.cloud.websecurityscanner.v1alpha.ListScanRunsRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.websecurityscanner.v1alpha.ListScanRunsRequest + * @static + * @param {google.cloud.websecurityscanner.v1alpha.IListScanRunsRequest} message ListScanRunsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListScanRunsRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListScanRunsRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.websecurityscanner.v1alpha.ListScanRunsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.websecurityscanner.v1alpha.ListScanRunsRequest} ListScanRunsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListScanRunsRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.websecurityscanner.v1alpha.ListScanRunsRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + message.pageToken = reader.string(); + break; + } + case 3: { + message.pageSize = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListScanRunsRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.websecurityscanner.v1alpha.ListScanRunsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.websecurityscanner.v1alpha.ListScanRunsRequest} ListScanRunsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListScanRunsRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListScanRunsRequest message. + * @function verify + * @memberof google.cloud.websecurityscanner.v1alpha.ListScanRunsRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListScanRunsRequest.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.pageToken != null && message.hasOwnProperty("pageToken")) + if (!$util.isString(message.pageToken)) + return "pageToken: string expected"; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + if (!$util.isInteger(message.pageSize)) + return "pageSize: integer expected"; + return null; + }; + + /** + * Creates a ListScanRunsRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.websecurityscanner.v1alpha.ListScanRunsRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.websecurityscanner.v1alpha.ListScanRunsRequest} ListScanRunsRequest + */ + ListScanRunsRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.websecurityscanner.v1alpha.ListScanRunsRequest) + return object; + var message = new $root.google.cloud.websecurityscanner.v1alpha.ListScanRunsRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.pageToken != null) + message.pageToken = String(object.pageToken); + if (object.pageSize != null) + message.pageSize = object.pageSize | 0; + return message; + }; + + /** + * Creates a plain object from a ListScanRunsRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.websecurityscanner.v1alpha.ListScanRunsRequest + * @static + * @param {google.cloud.websecurityscanner.v1alpha.ListScanRunsRequest} message ListScanRunsRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListScanRunsRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.pageToken = ""; + object.pageSize = 0; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + object.pageToken = message.pageToken; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + object.pageSize = message.pageSize; + return object; + }; + + /** + * Converts this ListScanRunsRequest to JSON. + * @function toJSON + * @memberof google.cloud.websecurityscanner.v1alpha.ListScanRunsRequest + * @instance + * @returns {Object.} JSON object + */ + ListScanRunsRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListScanRunsRequest + * @function getTypeUrl + * @memberof google.cloud.websecurityscanner.v1alpha.ListScanRunsRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListScanRunsRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.websecurityscanner.v1alpha.ListScanRunsRequest"; + }; + + return ListScanRunsRequest; + })(); + + v1alpha.ListScanRunsResponse = (function() { + + /** + * Properties of a ListScanRunsResponse. + * @memberof google.cloud.websecurityscanner.v1alpha + * @interface IListScanRunsResponse + * @property {Array.|null} [scanRuns] ListScanRunsResponse scanRuns + * @property {string|null} [nextPageToken] ListScanRunsResponse nextPageToken + */ + + /** + * Constructs a new ListScanRunsResponse. + * @memberof google.cloud.websecurityscanner.v1alpha + * @classdesc Represents a ListScanRunsResponse. + * @implements IListScanRunsResponse + * @constructor + * @param {google.cloud.websecurityscanner.v1alpha.IListScanRunsResponse=} [properties] Properties to set + */ + function ListScanRunsResponse(properties) { + this.scanRuns = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListScanRunsResponse scanRuns. + * @member {Array.} scanRuns + * @memberof google.cloud.websecurityscanner.v1alpha.ListScanRunsResponse + * @instance + */ + ListScanRunsResponse.prototype.scanRuns = $util.emptyArray; + + /** + * ListScanRunsResponse nextPageToken. + * @member {string} nextPageToken + * @memberof google.cloud.websecurityscanner.v1alpha.ListScanRunsResponse + * @instance + */ + ListScanRunsResponse.prototype.nextPageToken = ""; + + /** + * Creates a new ListScanRunsResponse instance using the specified properties. + * @function create + * @memberof google.cloud.websecurityscanner.v1alpha.ListScanRunsResponse + * @static + * @param {google.cloud.websecurityscanner.v1alpha.IListScanRunsResponse=} [properties] Properties to set + * @returns {google.cloud.websecurityscanner.v1alpha.ListScanRunsResponse} ListScanRunsResponse instance + */ + ListScanRunsResponse.create = function create(properties) { + return new ListScanRunsResponse(properties); + }; + + /** + * Encodes the specified ListScanRunsResponse message. Does not implicitly {@link google.cloud.websecurityscanner.v1alpha.ListScanRunsResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.websecurityscanner.v1alpha.ListScanRunsResponse + * @static + * @param {google.cloud.websecurityscanner.v1alpha.IListScanRunsResponse} message ListScanRunsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListScanRunsResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.scanRuns != null && message.scanRuns.length) + for (var i = 0; i < message.scanRuns.length; ++i) + $root.google.cloud.websecurityscanner.v1alpha.ScanRun.encode(message.scanRuns[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 ListScanRunsResponse message, length delimited. Does not implicitly {@link google.cloud.websecurityscanner.v1alpha.ListScanRunsResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.websecurityscanner.v1alpha.ListScanRunsResponse + * @static + * @param {google.cloud.websecurityscanner.v1alpha.IListScanRunsResponse} message ListScanRunsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListScanRunsResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListScanRunsResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.websecurityscanner.v1alpha.ListScanRunsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.websecurityscanner.v1alpha.ListScanRunsResponse} ListScanRunsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListScanRunsResponse.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.websecurityscanner.v1alpha.ListScanRunsResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.scanRuns && message.scanRuns.length)) + message.scanRuns = []; + message.scanRuns.push($root.google.cloud.websecurityscanner.v1alpha.ScanRun.decode(reader, reader.uint32())); + break; + } + case 2: { + message.nextPageToken = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListScanRunsResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.websecurityscanner.v1alpha.ListScanRunsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.websecurityscanner.v1alpha.ListScanRunsResponse} ListScanRunsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListScanRunsResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListScanRunsResponse message. + * @function verify + * @memberof google.cloud.websecurityscanner.v1alpha.ListScanRunsResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListScanRunsResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.scanRuns != null && message.hasOwnProperty("scanRuns")) { + if (!Array.isArray(message.scanRuns)) + return "scanRuns: array expected"; + for (var i = 0; i < message.scanRuns.length; ++i) { + var error = $root.google.cloud.websecurityscanner.v1alpha.ScanRun.verify(message.scanRuns[i]); + if (error) + return "scanRuns." + error; + } + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; + return null; + }; + + /** + * Creates a ListScanRunsResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.websecurityscanner.v1alpha.ListScanRunsResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.websecurityscanner.v1alpha.ListScanRunsResponse} ListScanRunsResponse + */ + ListScanRunsResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.websecurityscanner.v1alpha.ListScanRunsResponse) + return object; + var message = new $root.google.cloud.websecurityscanner.v1alpha.ListScanRunsResponse(); + if (object.scanRuns) { + if (!Array.isArray(object.scanRuns)) + throw TypeError(".google.cloud.websecurityscanner.v1alpha.ListScanRunsResponse.scanRuns: array expected"); + message.scanRuns = []; + for (var i = 0; i < object.scanRuns.length; ++i) { + if (typeof object.scanRuns[i] !== "object") + throw TypeError(".google.cloud.websecurityscanner.v1alpha.ListScanRunsResponse.scanRuns: object expected"); + message.scanRuns[i] = $root.google.cloud.websecurityscanner.v1alpha.ScanRun.fromObject(object.scanRuns[i]); + } + } + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + return message; + }; + + /** + * Creates a plain object from a ListScanRunsResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.websecurityscanner.v1alpha.ListScanRunsResponse + * @static + * @param {google.cloud.websecurityscanner.v1alpha.ListScanRunsResponse} message ListScanRunsResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListScanRunsResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.scanRuns = []; + if (options.defaults) + object.nextPageToken = ""; + if (message.scanRuns && message.scanRuns.length) { + object.scanRuns = []; + for (var j = 0; j < message.scanRuns.length; ++j) + object.scanRuns[j] = $root.google.cloud.websecurityscanner.v1alpha.ScanRun.toObject(message.scanRuns[j], options); + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + object.nextPageToken = message.nextPageToken; + return object; + }; + + /** + * Converts this ListScanRunsResponse to JSON. + * @function toJSON + * @memberof google.cloud.websecurityscanner.v1alpha.ListScanRunsResponse + * @instance + * @returns {Object.} JSON object + */ + ListScanRunsResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListScanRunsResponse + * @function getTypeUrl + * @memberof google.cloud.websecurityscanner.v1alpha.ListScanRunsResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListScanRunsResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.websecurityscanner.v1alpha.ListScanRunsResponse"; + }; + + return ListScanRunsResponse; + })(); + + v1alpha.StopScanRunRequest = (function() { + + /** + * Properties of a StopScanRunRequest. + * @memberof google.cloud.websecurityscanner.v1alpha + * @interface IStopScanRunRequest + * @property {string|null} [name] StopScanRunRequest name + */ + + /** + * Constructs a new StopScanRunRequest. + * @memberof google.cloud.websecurityscanner.v1alpha + * @classdesc Represents a StopScanRunRequest. + * @implements IStopScanRunRequest + * @constructor + * @param {google.cloud.websecurityscanner.v1alpha.IStopScanRunRequest=} [properties] Properties to set + */ + function StopScanRunRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * StopScanRunRequest name. + * @member {string} name + * @memberof google.cloud.websecurityscanner.v1alpha.StopScanRunRequest + * @instance + */ + StopScanRunRequest.prototype.name = ""; + + /** + * Creates a new StopScanRunRequest instance using the specified properties. + * @function create + * @memberof google.cloud.websecurityscanner.v1alpha.StopScanRunRequest + * @static + * @param {google.cloud.websecurityscanner.v1alpha.IStopScanRunRequest=} [properties] Properties to set + * @returns {google.cloud.websecurityscanner.v1alpha.StopScanRunRequest} StopScanRunRequest instance + */ + StopScanRunRequest.create = function create(properties) { + return new StopScanRunRequest(properties); + }; + + /** + * Encodes the specified StopScanRunRequest message. Does not implicitly {@link google.cloud.websecurityscanner.v1alpha.StopScanRunRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.websecurityscanner.v1alpha.StopScanRunRequest + * @static + * @param {google.cloud.websecurityscanner.v1alpha.IStopScanRunRequest} message StopScanRunRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + StopScanRunRequest.encode = function encode(message, writer) { + 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 StopScanRunRequest message, length delimited. Does not implicitly {@link google.cloud.websecurityscanner.v1alpha.StopScanRunRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.websecurityscanner.v1alpha.StopScanRunRequest + * @static + * @param {google.cloud.websecurityscanner.v1alpha.IStopScanRunRequest} message StopScanRunRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + StopScanRunRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a StopScanRunRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.websecurityscanner.v1alpha.StopScanRunRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.websecurityscanner.v1alpha.StopScanRunRequest} StopScanRunRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + StopScanRunRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.websecurityscanner.v1alpha.StopScanRunRequest(); + 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 StopScanRunRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.websecurityscanner.v1alpha.StopScanRunRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.websecurityscanner.v1alpha.StopScanRunRequest} StopScanRunRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + StopScanRunRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a StopScanRunRequest message. + * @function verify + * @memberof google.cloud.websecurityscanner.v1alpha.StopScanRunRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + StopScanRunRequest.verify = function verify(message) { + if (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 StopScanRunRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.websecurityscanner.v1alpha.StopScanRunRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.websecurityscanner.v1alpha.StopScanRunRequest} StopScanRunRequest + */ + StopScanRunRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.websecurityscanner.v1alpha.StopScanRunRequest) + return object; + var message = new $root.google.cloud.websecurityscanner.v1alpha.StopScanRunRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a StopScanRunRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.websecurityscanner.v1alpha.StopScanRunRequest + * @static + * @param {google.cloud.websecurityscanner.v1alpha.StopScanRunRequest} message StopScanRunRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + StopScanRunRequest.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 StopScanRunRequest to JSON. + * @function toJSON + * @memberof google.cloud.websecurityscanner.v1alpha.StopScanRunRequest + * @instance + * @returns {Object.} JSON object + */ + StopScanRunRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for StopScanRunRequest + * @function getTypeUrl + * @memberof google.cloud.websecurityscanner.v1alpha.StopScanRunRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + StopScanRunRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.websecurityscanner.v1alpha.StopScanRunRequest"; + }; + + return StopScanRunRequest; + })(); + + v1alpha.ListCrawledUrlsRequest = (function() { + + /** + * Properties of a ListCrawledUrlsRequest. + * @memberof google.cloud.websecurityscanner.v1alpha + * @interface IListCrawledUrlsRequest + * @property {string|null} [parent] ListCrawledUrlsRequest parent + * @property {string|null} [pageToken] ListCrawledUrlsRequest pageToken + * @property {number|null} [pageSize] ListCrawledUrlsRequest pageSize + */ + + /** + * Constructs a new ListCrawledUrlsRequest. + * @memberof google.cloud.websecurityscanner.v1alpha + * @classdesc Represents a ListCrawledUrlsRequest. + * @implements IListCrawledUrlsRequest + * @constructor + * @param {google.cloud.websecurityscanner.v1alpha.IListCrawledUrlsRequest=} [properties] Properties to set + */ + function ListCrawledUrlsRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListCrawledUrlsRequest parent. + * @member {string} parent + * @memberof google.cloud.websecurityscanner.v1alpha.ListCrawledUrlsRequest + * @instance + */ + ListCrawledUrlsRequest.prototype.parent = ""; + + /** + * ListCrawledUrlsRequest pageToken. + * @member {string} pageToken + * @memberof google.cloud.websecurityscanner.v1alpha.ListCrawledUrlsRequest + * @instance + */ + ListCrawledUrlsRequest.prototype.pageToken = ""; + + /** + * ListCrawledUrlsRequest pageSize. + * @member {number} pageSize + * @memberof google.cloud.websecurityscanner.v1alpha.ListCrawledUrlsRequest + * @instance + */ + ListCrawledUrlsRequest.prototype.pageSize = 0; + + /** + * Creates a new ListCrawledUrlsRequest instance using the specified properties. + * @function create + * @memberof google.cloud.websecurityscanner.v1alpha.ListCrawledUrlsRequest + * @static + * @param {google.cloud.websecurityscanner.v1alpha.IListCrawledUrlsRequest=} [properties] Properties to set + * @returns {google.cloud.websecurityscanner.v1alpha.ListCrawledUrlsRequest} ListCrawledUrlsRequest instance + */ + ListCrawledUrlsRequest.create = function create(properties) { + return new ListCrawledUrlsRequest(properties); + }; + + /** + * Encodes the specified ListCrawledUrlsRequest message. Does not implicitly {@link google.cloud.websecurityscanner.v1alpha.ListCrawledUrlsRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.websecurityscanner.v1alpha.ListCrawledUrlsRequest + * @static + * @param {google.cloud.websecurityscanner.v1alpha.IListCrawledUrlsRequest} message ListCrawledUrlsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListCrawledUrlsRequest.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.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.pageToken); + if (message.pageSize != null && Object.hasOwnProperty.call(message, "pageSize")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.pageSize); + return writer; + }; + + /** + * Encodes the specified ListCrawledUrlsRequest message, length delimited. Does not implicitly {@link google.cloud.websecurityscanner.v1alpha.ListCrawledUrlsRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.websecurityscanner.v1alpha.ListCrawledUrlsRequest + * @static + * @param {google.cloud.websecurityscanner.v1alpha.IListCrawledUrlsRequest} message ListCrawledUrlsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListCrawledUrlsRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListCrawledUrlsRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.websecurityscanner.v1alpha.ListCrawledUrlsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.websecurityscanner.v1alpha.ListCrawledUrlsRequest} ListCrawledUrlsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListCrawledUrlsRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.websecurityscanner.v1alpha.ListCrawledUrlsRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + message.pageToken = reader.string(); + break; + } + case 3: { + message.pageSize = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListCrawledUrlsRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.websecurityscanner.v1alpha.ListCrawledUrlsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.websecurityscanner.v1alpha.ListCrawledUrlsRequest} ListCrawledUrlsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListCrawledUrlsRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListCrawledUrlsRequest message. + * @function verify + * @memberof google.cloud.websecurityscanner.v1alpha.ListCrawledUrlsRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListCrawledUrlsRequest.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.pageToken != null && message.hasOwnProperty("pageToken")) + if (!$util.isString(message.pageToken)) + return "pageToken: string expected"; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + if (!$util.isInteger(message.pageSize)) + return "pageSize: integer expected"; + return null; + }; + + /** + * Creates a ListCrawledUrlsRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.websecurityscanner.v1alpha.ListCrawledUrlsRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.websecurityscanner.v1alpha.ListCrawledUrlsRequest} ListCrawledUrlsRequest + */ + ListCrawledUrlsRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.websecurityscanner.v1alpha.ListCrawledUrlsRequest) + return object; + var message = new $root.google.cloud.websecurityscanner.v1alpha.ListCrawledUrlsRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.pageToken != null) + message.pageToken = String(object.pageToken); + if (object.pageSize != null) + message.pageSize = object.pageSize | 0; + return message; + }; + + /** + * Creates a plain object from a ListCrawledUrlsRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.websecurityscanner.v1alpha.ListCrawledUrlsRequest + * @static + * @param {google.cloud.websecurityscanner.v1alpha.ListCrawledUrlsRequest} message ListCrawledUrlsRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListCrawledUrlsRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.pageToken = ""; + object.pageSize = 0; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + object.pageToken = message.pageToken; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + object.pageSize = message.pageSize; + return object; + }; + + /** + * Converts this ListCrawledUrlsRequest to JSON. + * @function toJSON + * @memberof google.cloud.websecurityscanner.v1alpha.ListCrawledUrlsRequest + * @instance + * @returns {Object.} JSON object + */ + ListCrawledUrlsRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListCrawledUrlsRequest + * @function getTypeUrl + * @memberof google.cloud.websecurityscanner.v1alpha.ListCrawledUrlsRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListCrawledUrlsRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.websecurityscanner.v1alpha.ListCrawledUrlsRequest"; + }; + + return ListCrawledUrlsRequest; + })(); + + v1alpha.ListCrawledUrlsResponse = (function() { + + /** + * Properties of a ListCrawledUrlsResponse. + * @memberof google.cloud.websecurityscanner.v1alpha + * @interface IListCrawledUrlsResponse + * @property {Array.|null} [crawledUrls] ListCrawledUrlsResponse crawledUrls + * @property {string|null} [nextPageToken] ListCrawledUrlsResponse nextPageToken + */ + + /** + * Constructs a new ListCrawledUrlsResponse. + * @memberof google.cloud.websecurityscanner.v1alpha + * @classdesc Represents a ListCrawledUrlsResponse. + * @implements IListCrawledUrlsResponse + * @constructor + * @param {google.cloud.websecurityscanner.v1alpha.IListCrawledUrlsResponse=} [properties] Properties to set + */ + function ListCrawledUrlsResponse(properties) { + this.crawledUrls = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListCrawledUrlsResponse crawledUrls. + * @member {Array.} crawledUrls + * @memberof google.cloud.websecurityscanner.v1alpha.ListCrawledUrlsResponse + * @instance + */ + ListCrawledUrlsResponse.prototype.crawledUrls = $util.emptyArray; + + /** + * ListCrawledUrlsResponse nextPageToken. + * @member {string} nextPageToken + * @memberof google.cloud.websecurityscanner.v1alpha.ListCrawledUrlsResponse + * @instance + */ + ListCrawledUrlsResponse.prototype.nextPageToken = ""; + + /** + * Creates a new ListCrawledUrlsResponse instance using the specified properties. + * @function create + * @memberof google.cloud.websecurityscanner.v1alpha.ListCrawledUrlsResponse + * @static + * @param {google.cloud.websecurityscanner.v1alpha.IListCrawledUrlsResponse=} [properties] Properties to set + * @returns {google.cloud.websecurityscanner.v1alpha.ListCrawledUrlsResponse} ListCrawledUrlsResponse instance + */ + ListCrawledUrlsResponse.create = function create(properties) { + return new ListCrawledUrlsResponse(properties); + }; + + /** + * Encodes the specified ListCrawledUrlsResponse message. Does not implicitly {@link google.cloud.websecurityscanner.v1alpha.ListCrawledUrlsResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.websecurityscanner.v1alpha.ListCrawledUrlsResponse + * @static + * @param {google.cloud.websecurityscanner.v1alpha.IListCrawledUrlsResponse} message ListCrawledUrlsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListCrawledUrlsResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.crawledUrls != null && message.crawledUrls.length) + for (var i = 0; i < message.crawledUrls.length; ++i) + $root.google.cloud.websecurityscanner.v1alpha.CrawledUrl.encode(message.crawledUrls[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 ListCrawledUrlsResponse message, length delimited. Does not implicitly {@link google.cloud.websecurityscanner.v1alpha.ListCrawledUrlsResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.websecurityscanner.v1alpha.ListCrawledUrlsResponse + * @static + * @param {google.cloud.websecurityscanner.v1alpha.IListCrawledUrlsResponse} message ListCrawledUrlsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListCrawledUrlsResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListCrawledUrlsResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.websecurityscanner.v1alpha.ListCrawledUrlsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.websecurityscanner.v1alpha.ListCrawledUrlsResponse} ListCrawledUrlsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListCrawledUrlsResponse.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.websecurityscanner.v1alpha.ListCrawledUrlsResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.crawledUrls && message.crawledUrls.length)) + message.crawledUrls = []; + message.crawledUrls.push($root.google.cloud.websecurityscanner.v1alpha.CrawledUrl.decode(reader, reader.uint32())); + break; + } + case 2: { + message.nextPageToken = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListCrawledUrlsResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.websecurityscanner.v1alpha.ListCrawledUrlsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.websecurityscanner.v1alpha.ListCrawledUrlsResponse} ListCrawledUrlsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListCrawledUrlsResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListCrawledUrlsResponse message. + * @function verify + * @memberof google.cloud.websecurityscanner.v1alpha.ListCrawledUrlsResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListCrawledUrlsResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.crawledUrls != null && message.hasOwnProperty("crawledUrls")) { + if (!Array.isArray(message.crawledUrls)) + return "crawledUrls: array expected"; + for (var i = 0; i < message.crawledUrls.length; ++i) { + var error = $root.google.cloud.websecurityscanner.v1alpha.CrawledUrl.verify(message.crawledUrls[i]); + if (error) + return "crawledUrls." + error; + } + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; + return null; + }; + + /** + * Creates a ListCrawledUrlsResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.websecurityscanner.v1alpha.ListCrawledUrlsResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.websecurityscanner.v1alpha.ListCrawledUrlsResponse} ListCrawledUrlsResponse + */ + ListCrawledUrlsResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.websecurityscanner.v1alpha.ListCrawledUrlsResponse) + return object; + var message = new $root.google.cloud.websecurityscanner.v1alpha.ListCrawledUrlsResponse(); + if (object.crawledUrls) { + if (!Array.isArray(object.crawledUrls)) + throw TypeError(".google.cloud.websecurityscanner.v1alpha.ListCrawledUrlsResponse.crawledUrls: array expected"); + message.crawledUrls = []; + for (var i = 0; i < object.crawledUrls.length; ++i) { + if (typeof object.crawledUrls[i] !== "object") + throw TypeError(".google.cloud.websecurityscanner.v1alpha.ListCrawledUrlsResponse.crawledUrls: object expected"); + message.crawledUrls[i] = $root.google.cloud.websecurityscanner.v1alpha.CrawledUrl.fromObject(object.crawledUrls[i]); + } + } + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + return message; + }; + + /** + * Creates a plain object from a ListCrawledUrlsResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.websecurityscanner.v1alpha.ListCrawledUrlsResponse + * @static + * @param {google.cloud.websecurityscanner.v1alpha.ListCrawledUrlsResponse} message ListCrawledUrlsResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListCrawledUrlsResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.crawledUrls = []; + if (options.defaults) + object.nextPageToken = ""; + if (message.crawledUrls && message.crawledUrls.length) { + object.crawledUrls = []; + for (var j = 0; j < message.crawledUrls.length; ++j) + object.crawledUrls[j] = $root.google.cloud.websecurityscanner.v1alpha.CrawledUrl.toObject(message.crawledUrls[j], options); + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + object.nextPageToken = message.nextPageToken; + return object; + }; + + /** + * Converts this ListCrawledUrlsResponse to JSON. + * @function toJSON + * @memberof google.cloud.websecurityscanner.v1alpha.ListCrawledUrlsResponse + * @instance + * @returns {Object.} JSON object + */ + ListCrawledUrlsResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListCrawledUrlsResponse + * @function getTypeUrl + * @memberof google.cloud.websecurityscanner.v1alpha.ListCrawledUrlsResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListCrawledUrlsResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.websecurityscanner.v1alpha.ListCrawledUrlsResponse"; + }; + + return ListCrawledUrlsResponse; + })(); + + v1alpha.GetFindingRequest = (function() { + + /** + * Properties of a GetFindingRequest. + * @memberof google.cloud.websecurityscanner.v1alpha + * @interface IGetFindingRequest + * @property {string|null} [name] GetFindingRequest name + */ + + /** + * Constructs a new GetFindingRequest. + * @memberof google.cloud.websecurityscanner.v1alpha + * @classdesc Represents a GetFindingRequest. + * @implements IGetFindingRequest + * @constructor + * @param {google.cloud.websecurityscanner.v1alpha.IGetFindingRequest=} [properties] Properties to set + */ + function GetFindingRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetFindingRequest name. + * @member {string} name + * @memberof google.cloud.websecurityscanner.v1alpha.GetFindingRequest + * @instance + */ + GetFindingRequest.prototype.name = ""; + + /** + * Creates a new GetFindingRequest instance using the specified properties. + * @function create + * @memberof google.cloud.websecurityscanner.v1alpha.GetFindingRequest + * @static + * @param {google.cloud.websecurityscanner.v1alpha.IGetFindingRequest=} [properties] Properties to set + * @returns {google.cloud.websecurityscanner.v1alpha.GetFindingRequest} GetFindingRequest instance + */ + GetFindingRequest.create = function create(properties) { + return new GetFindingRequest(properties); + }; + + /** + * Encodes the specified GetFindingRequest message. Does not implicitly {@link google.cloud.websecurityscanner.v1alpha.GetFindingRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.websecurityscanner.v1alpha.GetFindingRequest + * @static + * @param {google.cloud.websecurityscanner.v1alpha.IGetFindingRequest} message GetFindingRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetFindingRequest.encode = function encode(message, writer) { + 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 GetFindingRequest message, length delimited. Does not implicitly {@link google.cloud.websecurityscanner.v1alpha.GetFindingRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.websecurityscanner.v1alpha.GetFindingRequest + * @static + * @param {google.cloud.websecurityscanner.v1alpha.IGetFindingRequest} message GetFindingRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetFindingRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetFindingRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.websecurityscanner.v1alpha.GetFindingRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.websecurityscanner.v1alpha.GetFindingRequest} GetFindingRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetFindingRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.websecurityscanner.v1alpha.GetFindingRequest(); + 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 GetFindingRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.websecurityscanner.v1alpha.GetFindingRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.websecurityscanner.v1alpha.GetFindingRequest} GetFindingRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetFindingRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetFindingRequest message. + * @function verify + * @memberof google.cloud.websecurityscanner.v1alpha.GetFindingRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetFindingRequest.verify = function verify(message) { + if (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 GetFindingRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.websecurityscanner.v1alpha.GetFindingRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.websecurityscanner.v1alpha.GetFindingRequest} GetFindingRequest + */ + GetFindingRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.websecurityscanner.v1alpha.GetFindingRequest) + return object; + var message = new $root.google.cloud.websecurityscanner.v1alpha.GetFindingRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a GetFindingRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.websecurityscanner.v1alpha.GetFindingRequest + * @static + * @param {google.cloud.websecurityscanner.v1alpha.GetFindingRequest} message GetFindingRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetFindingRequest.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 GetFindingRequest to JSON. + * @function toJSON + * @memberof google.cloud.websecurityscanner.v1alpha.GetFindingRequest + * @instance + * @returns {Object.} JSON object + */ + GetFindingRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GetFindingRequest + * @function getTypeUrl + * @memberof google.cloud.websecurityscanner.v1alpha.GetFindingRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GetFindingRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.websecurityscanner.v1alpha.GetFindingRequest"; + }; + + return GetFindingRequest; + })(); + + v1alpha.ListFindingsRequest = (function() { + + /** + * Properties of a ListFindingsRequest. + * @memberof google.cloud.websecurityscanner.v1alpha + * @interface IListFindingsRequest + * @property {string|null} [parent] ListFindingsRequest parent + * @property {string|null} [filter] ListFindingsRequest filter + * @property {string|null} [pageToken] ListFindingsRequest pageToken + * @property {number|null} [pageSize] ListFindingsRequest pageSize + */ + + /** + * Constructs a new ListFindingsRequest. + * @memberof google.cloud.websecurityscanner.v1alpha + * @classdesc Represents a ListFindingsRequest. + * @implements IListFindingsRequest + * @constructor + * @param {google.cloud.websecurityscanner.v1alpha.IListFindingsRequest=} [properties] Properties to set + */ + function ListFindingsRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListFindingsRequest parent. + * @member {string} parent + * @memberof google.cloud.websecurityscanner.v1alpha.ListFindingsRequest + * @instance + */ + ListFindingsRequest.prototype.parent = ""; + + /** + * ListFindingsRequest filter. + * @member {string} filter + * @memberof google.cloud.websecurityscanner.v1alpha.ListFindingsRequest + * @instance + */ + ListFindingsRequest.prototype.filter = ""; + + /** + * ListFindingsRequest pageToken. + * @member {string} pageToken + * @memberof google.cloud.websecurityscanner.v1alpha.ListFindingsRequest + * @instance + */ + ListFindingsRequest.prototype.pageToken = ""; + + /** + * ListFindingsRequest pageSize. + * @member {number} pageSize + * @memberof google.cloud.websecurityscanner.v1alpha.ListFindingsRequest + * @instance + */ + ListFindingsRequest.prototype.pageSize = 0; + + /** + * Creates a new ListFindingsRequest instance using the specified properties. + * @function create + * @memberof google.cloud.websecurityscanner.v1alpha.ListFindingsRequest + * @static + * @param {google.cloud.websecurityscanner.v1alpha.IListFindingsRequest=} [properties] Properties to set + * @returns {google.cloud.websecurityscanner.v1alpha.ListFindingsRequest} ListFindingsRequest instance + */ + ListFindingsRequest.create = function create(properties) { + return new ListFindingsRequest(properties); + }; + + /** + * Encodes the specified ListFindingsRequest message. Does not implicitly {@link google.cloud.websecurityscanner.v1alpha.ListFindingsRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.websecurityscanner.v1alpha.ListFindingsRequest + * @static + * @param {google.cloud.websecurityscanner.v1alpha.IListFindingsRequest} message ListFindingsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListFindingsRequest.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.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.pageToken); + if (message.pageSize != null && Object.hasOwnProperty.call(message, "pageSize")) + writer.uint32(/* id 4, wireType 0 =*/32).int32(message.pageSize); + return writer; + }; + + /** + * Encodes the specified ListFindingsRequest message, length delimited. Does not implicitly {@link google.cloud.websecurityscanner.v1alpha.ListFindingsRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.websecurityscanner.v1alpha.ListFindingsRequest + * @static + * @param {google.cloud.websecurityscanner.v1alpha.IListFindingsRequest} message ListFindingsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListFindingsRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListFindingsRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.websecurityscanner.v1alpha.ListFindingsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.websecurityscanner.v1alpha.ListFindingsRequest} ListFindingsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListFindingsRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.websecurityscanner.v1alpha.ListFindingsRequest(); + 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.pageToken = reader.string(); + break; + } + case 4: { + message.pageSize = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListFindingsRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.websecurityscanner.v1alpha.ListFindingsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.websecurityscanner.v1alpha.ListFindingsRequest} ListFindingsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListFindingsRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListFindingsRequest message. + * @function verify + * @memberof google.cloud.websecurityscanner.v1alpha.ListFindingsRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListFindingsRequest.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.pageToken != null && message.hasOwnProperty("pageToken")) + if (!$util.isString(message.pageToken)) + return "pageToken: string expected"; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + if (!$util.isInteger(message.pageSize)) + return "pageSize: integer expected"; + return null; + }; + + /** + * Creates a ListFindingsRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.websecurityscanner.v1alpha.ListFindingsRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.websecurityscanner.v1alpha.ListFindingsRequest} ListFindingsRequest + */ + ListFindingsRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.websecurityscanner.v1alpha.ListFindingsRequest) + return object; + var message = new $root.google.cloud.websecurityscanner.v1alpha.ListFindingsRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.filter != null) + message.filter = String(object.filter); + if (object.pageToken != null) + message.pageToken = String(object.pageToken); + if (object.pageSize != null) + message.pageSize = object.pageSize | 0; + return message; + }; + + /** + * Creates a plain object from a ListFindingsRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.websecurityscanner.v1alpha.ListFindingsRequest + * @static + * @param {google.cloud.websecurityscanner.v1alpha.ListFindingsRequest} message ListFindingsRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListFindingsRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.filter = ""; + object.pageToken = ""; + object.pageSize = 0; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.filter != null && message.hasOwnProperty("filter")) + object.filter = message.filter; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + object.pageToken = message.pageToken; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + object.pageSize = message.pageSize; + return object; + }; + + /** + * Converts this ListFindingsRequest to JSON. + * @function toJSON + * @memberof google.cloud.websecurityscanner.v1alpha.ListFindingsRequest + * @instance + * @returns {Object.} JSON object + */ + ListFindingsRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListFindingsRequest + * @function getTypeUrl + * @memberof google.cloud.websecurityscanner.v1alpha.ListFindingsRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListFindingsRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.websecurityscanner.v1alpha.ListFindingsRequest"; + }; + + return ListFindingsRequest; + })(); + + v1alpha.ListFindingsResponse = (function() { + + /** + * Properties of a ListFindingsResponse. + * @memberof google.cloud.websecurityscanner.v1alpha + * @interface IListFindingsResponse + * @property {Array.|null} [findings] ListFindingsResponse findings + * @property {string|null} [nextPageToken] ListFindingsResponse nextPageToken + */ + + /** + * Constructs a new ListFindingsResponse. + * @memberof google.cloud.websecurityscanner.v1alpha + * @classdesc Represents a ListFindingsResponse. + * @implements IListFindingsResponse + * @constructor + * @param {google.cloud.websecurityscanner.v1alpha.IListFindingsResponse=} [properties] Properties to set + */ + function ListFindingsResponse(properties) { + this.findings = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListFindingsResponse findings. + * @member {Array.} findings + * @memberof google.cloud.websecurityscanner.v1alpha.ListFindingsResponse + * @instance + */ + ListFindingsResponse.prototype.findings = $util.emptyArray; + + /** + * ListFindingsResponse nextPageToken. + * @member {string} nextPageToken + * @memberof google.cloud.websecurityscanner.v1alpha.ListFindingsResponse + * @instance + */ + ListFindingsResponse.prototype.nextPageToken = ""; + + /** + * Creates a new ListFindingsResponse instance using the specified properties. + * @function create + * @memberof google.cloud.websecurityscanner.v1alpha.ListFindingsResponse + * @static + * @param {google.cloud.websecurityscanner.v1alpha.IListFindingsResponse=} [properties] Properties to set + * @returns {google.cloud.websecurityscanner.v1alpha.ListFindingsResponse} ListFindingsResponse instance + */ + ListFindingsResponse.create = function create(properties) { + return new ListFindingsResponse(properties); + }; + + /** + * Encodes the specified ListFindingsResponse message. Does not implicitly {@link google.cloud.websecurityscanner.v1alpha.ListFindingsResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.websecurityscanner.v1alpha.ListFindingsResponse + * @static + * @param {google.cloud.websecurityscanner.v1alpha.IListFindingsResponse} message ListFindingsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListFindingsResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.findings != null && message.findings.length) + for (var i = 0; i < message.findings.length; ++i) + $root.google.cloud.websecurityscanner.v1alpha.Finding.encode(message.findings[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 ListFindingsResponse message, length delimited. Does not implicitly {@link google.cloud.websecurityscanner.v1alpha.ListFindingsResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.websecurityscanner.v1alpha.ListFindingsResponse + * @static + * @param {google.cloud.websecurityscanner.v1alpha.IListFindingsResponse} message ListFindingsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListFindingsResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListFindingsResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.websecurityscanner.v1alpha.ListFindingsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.websecurityscanner.v1alpha.ListFindingsResponse} ListFindingsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListFindingsResponse.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.websecurityscanner.v1alpha.ListFindingsResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.findings && message.findings.length)) + message.findings = []; + message.findings.push($root.google.cloud.websecurityscanner.v1alpha.Finding.decode(reader, reader.uint32())); + break; + } + case 2: { + message.nextPageToken = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListFindingsResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.websecurityscanner.v1alpha.ListFindingsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.websecurityscanner.v1alpha.ListFindingsResponse} ListFindingsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListFindingsResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListFindingsResponse message. + * @function verify + * @memberof google.cloud.websecurityscanner.v1alpha.ListFindingsResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListFindingsResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.findings != null && message.hasOwnProperty("findings")) { + if (!Array.isArray(message.findings)) + return "findings: array expected"; + for (var i = 0; i < message.findings.length; ++i) { + var error = $root.google.cloud.websecurityscanner.v1alpha.Finding.verify(message.findings[i]); + if (error) + return "findings." + error; + } + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; + return null; + }; + + /** + * Creates a ListFindingsResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.websecurityscanner.v1alpha.ListFindingsResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.websecurityscanner.v1alpha.ListFindingsResponse} ListFindingsResponse + */ + ListFindingsResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.websecurityscanner.v1alpha.ListFindingsResponse) + return object; + var message = new $root.google.cloud.websecurityscanner.v1alpha.ListFindingsResponse(); + if (object.findings) { + if (!Array.isArray(object.findings)) + throw TypeError(".google.cloud.websecurityscanner.v1alpha.ListFindingsResponse.findings: array expected"); + message.findings = []; + for (var i = 0; i < object.findings.length; ++i) { + if (typeof object.findings[i] !== "object") + throw TypeError(".google.cloud.websecurityscanner.v1alpha.ListFindingsResponse.findings: object expected"); + message.findings[i] = $root.google.cloud.websecurityscanner.v1alpha.Finding.fromObject(object.findings[i]); + } + } + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + return message; + }; + + /** + * Creates a plain object from a ListFindingsResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.websecurityscanner.v1alpha.ListFindingsResponse + * @static + * @param {google.cloud.websecurityscanner.v1alpha.ListFindingsResponse} message ListFindingsResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListFindingsResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.findings = []; + if (options.defaults) + object.nextPageToken = ""; + if (message.findings && message.findings.length) { + object.findings = []; + for (var j = 0; j < message.findings.length; ++j) + object.findings[j] = $root.google.cloud.websecurityscanner.v1alpha.Finding.toObject(message.findings[j], options); + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + object.nextPageToken = message.nextPageToken; + return object; + }; + + /** + * Converts this ListFindingsResponse to JSON. + * @function toJSON + * @memberof google.cloud.websecurityscanner.v1alpha.ListFindingsResponse + * @instance + * @returns {Object.} JSON object + */ + ListFindingsResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListFindingsResponse + * @function getTypeUrl + * @memberof google.cloud.websecurityscanner.v1alpha.ListFindingsResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListFindingsResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.websecurityscanner.v1alpha.ListFindingsResponse"; + }; + + return ListFindingsResponse; + })(); + + v1alpha.ListFindingTypeStatsRequest = (function() { + + /** + * Properties of a ListFindingTypeStatsRequest. + * @memberof google.cloud.websecurityscanner.v1alpha + * @interface IListFindingTypeStatsRequest + * @property {string|null} [parent] ListFindingTypeStatsRequest parent + */ + + /** + * Constructs a new ListFindingTypeStatsRequest. + * @memberof google.cloud.websecurityscanner.v1alpha + * @classdesc Represents a ListFindingTypeStatsRequest. + * @implements IListFindingTypeStatsRequest + * @constructor + * @param {google.cloud.websecurityscanner.v1alpha.IListFindingTypeStatsRequest=} [properties] Properties to set + */ + function ListFindingTypeStatsRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListFindingTypeStatsRequest parent. + * @member {string} parent + * @memberof google.cloud.websecurityscanner.v1alpha.ListFindingTypeStatsRequest + * @instance + */ + ListFindingTypeStatsRequest.prototype.parent = ""; + + /** + * Creates a new ListFindingTypeStatsRequest instance using the specified properties. + * @function create + * @memberof google.cloud.websecurityscanner.v1alpha.ListFindingTypeStatsRequest + * @static + * @param {google.cloud.websecurityscanner.v1alpha.IListFindingTypeStatsRequest=} [properties] Properties to set + * @returns {google.cloud.websecurityscanner.v1alpha.ListFindingTypeStatsRequest} ListFindingTypeStatsRequest instance + */ + ListFindingTypeStatsRequest.create = function create(properties) { + return new ListFindingTypeStatsRequest(properties); + }; + + /** + * Encodes the specified ListFindingTypeStatsRequest message. Does not implicitly {@link google.cloud.websecurityscanner.v1alpha.ListFindingTypeStatsRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.websecurityscanner.v1alpha.ListFindingTypeStatsRequest + * @static + * @param {google.cloud.websecurityscanner.v1alpha.IListFindingTypeStatsRequest} message ListFindingTypeStatsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListFindingTypeStatsRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); + return writer; + }; + + /** + * Encodes the specified ListFindingTypeStatsRequest message, length delimited. Does not implicitly {@link google.cloud.websecurityscanner.v1alpha.ListFindingTypeStatsRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.websecurityscanner.v1alpha.ListFindingTypeStatsRequest + * @static + * @param {google.cloud.websecurityscanner.v1alpha.IListFindingTypeStatsRequest} message ListFindingTypeStatsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListFindingTypeStatsRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListFindingTypeStatsRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.websecurityscanner.v1alpha.ListFindingTypeStatsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.websecurityscanner.v1alpha.ListFindingTypeStatsRequest} ListFindingTypeStatsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListFindingTypeStatsRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.websecurityscanner.v1alpha.ListFindingTypeStatsRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.parent = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListFindingTypeStatsRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.websecurityscanner.v1alpha.ListFindingTypeStatsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.websecurityscanner.v1alpha.ListFindingTypeStatsRequest} ListFindingTypeStatsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListFindingTypeStatsRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListFindingTypeStatsRequest message. + * @function verify + * @memberof google.cloud.websecurityscanner.v1alpha.ListFindingTypeStatsRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListFindingTypeStatsRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.parent != null && message.hasOwnProperty("parent")) + if (!$util.isString(message.parent)) + return "parent: string expected"; + return null; + }; + + /** + * Creates a ListFindingTypeStatsRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.websecurityscanner.v1alpha.ListFindingTypeStatsRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.websecurityscanner.v1alpha.ListFindingTypeStatsRequest} ListFindingTypeStatsRequest + */ + ListFindingTypeStatsRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.websecurityscanner.v1alpha.ListFindingTypeStatsRequest) + return object; + var message = new $root.google.cloud.websecurityscanner.v1alpha.ListFindingTypeStatsRequest(); + if (object.parent != null) + message.parent = String(object.parent); + return message; + }; + + /** + * Creates a plain object from a ListFindingTypeStatsRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.websecurityscanner.v1alpha.ListFindingTypeStatsRequest + * @static + * @param {google.cloud.websecurityscanner.v1alpha.ListFindingTypeStatsRequest} message ListFindingTypeStatsRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListFindingTypeStatsRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.parent = ""; + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + return object; + }; + + /** + * Converts this ListFindingTypeStatsRequest to JSON. + * @function toJSON + * @memberof google.cloud.websecurityscanner.v1alpha.ListFindingTypeStatsRequest + * @instance + * @returns {Object.} JSON object + */ + ListFindingTypeStatsRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListFindingTypeStatsRequest + * @function getTypeUrl + * @memberof google.cloud.websecurityscanner.v1alpha.ListFindingTypeStatsRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListFindingTypeStatsRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.websecurityscanner.v1alpha.ListFindingTypeStatsRequest"; + }; + + return ListFindingTypeStatsRequest; + })(); + + v1alpha.ListFindingTypeStatsResponse = (function() { + + /** + * Properties of a ListFindingTypeStatsResponse. + * @memberof google.cloud.websecurityscanner.v1alpha + * @interface IListFindingTypeStatsResponse + * @property {Array.|null} [findingTypeStats] ListFindingTypeStatsResponse findingTypeStats + */ + + /** + * Constructs a new ListFindingTypeStatsResponse. + * @memberof google.cloud.websecurityscanner.v1alpha + * @classdesc Represents a ListFindingTypeStatsResponse. + * @implements IListFindingTypeStatsResponse + * @constructor + * @param {google.cloud.websecurityscanner.v1alpha.IListFindingTypeStatsResponse=} [properties] Properties to set + */ + function ListFindingTypeStatsResponse(properties) { + this.findingTypeStats = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListFindingTypeStatsResponse findingTypeStats. + * @member {Array.} findingTypeStats + * @memberof google.cloud.websecurityscanner.v1alpha.ListFindingTypeStatsResponse + * @instance + */ + ListFindingTypeStatsResponse.prototype.findingTypeStats = $util.emptyArray; + + /** + * Creates a new ListFindingTypeStatsResponse instance using the specified properties. + * @function create + * @memberof google.cloud.websecurityscanner.v1alpha.ListFindingTypeStatsResponse + * @static + * @param {google.cloud.websecurityscanner.v1alpha.IListFindingTypeStatsResponse=} [properties] Properties to set + * @returns {google.cloud.websecurityscanner.v1alpha.ListFindingTypeStatsResponse} ListFindingTypeStatsResponse instance + */ + ListFindingTypeStatsResponse.create = function create(properties) { + return new ListFindingTypeStatsResponse(properties); + }; + + /** + * Encodes the specified ListFindingTypeStatsResponse message. Does not implicitly {@link google.cloud.websecurityscanner.v1alpha.ListFindingTypeStatsResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.websecurityscanner.v1alpha.ListFindingTypeStatsResponse + * @static + * @param {google.cloud.websecurityscanner.v1alpha.IListFindingTypeStatsResponse} message ListFindingTypeStatsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListFindingTypeStatsResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.findingTypeStats != null && message.findingTypeStats.length) + for (var i = 0; i < message.findingTypeStats.length; ++i) + $root.google.cloud.websecurityscanner.v1alpha.FindingTypeStats.encode(message.findingTypeStats[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified ListFindingTypeStatsResponse message, length delimited. Does not implicitly {@link google.cloud.websecurityscanner.v1alpha.ListFindingTypeStatsResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.websecurityscanner.v1alpha.ListFindingTypeStatsResponse + * @static + * @param {google.cloud.websecurityscanner.v1alpha.IListFindingTypeStatsResponse} message ListFindingTypeStatsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListFindingTypeStatsResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListFindingTypeStatsResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.websecurityscanner.v1alpha.ListFindingTypeStatsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.websecurityscanner.v1alpha.ListFindingTypeStatsResponse} ListFindingTypeStatsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListFindingTypeStatsResponse.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.websecurityscanner.v1alpha.ListFindingTypeStatsResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.findingTypeStats && message.findingTypeStats.length)) + message.findingTypeStats = []; + message.findingTypeStats.push($root.google.cloud.websecurityscanner.v1alpha.FindingTypeStats.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListFindingTypeStatsResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.websecurityscanner.v1alpha.ListFindingTypeStatsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.websecurityscanner.v1alpha.ListFindingTypeStatsResponse} ListFindingTypeStatsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListFindingTypeStatsResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListFindingTypeStatsResponse message. + * @function verify + * @memberof google.cloud.websecurityscanner.v1alpha.ListFindingTypeStatsResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListFindingTypeStatsResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.findingTypeStats != null && message.hasOwnProperty("findingTypeStats")) { + if (!Array.isArray(message.findingTypeStats)) + return "findingTypeStats: array expected"; + for (var i = 0; i < message.findingTypeStats.length; ++i) { + var error = $root.google.cloud.websecurityscanner.v1alpha.FindingTypeStats.verify(message.findingTypeStats[i]); + if (error) + return "findingTypeStats." + error; + } + } + return null; + }; + + /** + * Creates a ListFindingTypeStatsResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.websecurityscanner.v1alpha.ListFindingTypeStatsResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.websecurityscanner.v1alpha.ListFindingTypeStatsResponse} ListFindingTypeStatsResponse + */ + ListFindingTypeStatsResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.websecurityscanner.v1alpha.ListFindingTypeStatsResponse) + return object; + var message = new $root.google.cloud.websecurityscanner.v1alpha.ListFindingTypeStatsResponse(); + if (object.findingTypeStats) { + if (!Array.isArray(object.findingTypeStats)) + throw TypeError(".google.cloud.websecurityscanner.v1alpha.ListFindingTypeStatsResponse.findingTypeStats: array expected"); + message.findingTypeStats = []; + for (var i = 0; i < object.findingTypeStats.length; ++i) { + if (typeof object.findingTypeStats[i] !== "object") + throw TypeError(".google.cloud.websecurityscanner.v1alpha.ListFindingTypeStatsResponse.findingTypeStats: object expected"); + message.findingTypeStats[i] = $root.google.cloud.websecurityscanner.v1alpha.FindingTypeStats.fromObject(object.findingTypeStats[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a ListFindingTypeStatsResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.websecurityscanner.v1alpha.ListFindingTypeStatsResponse + * @static + * @param {google.cloud.websecurityscanner.v1alpha.ListFindingTypeStatsResponse} message ListFindingTypeStatsResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListFindingTypeStatsResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.findingTypeStats = []; + if (message.findingTypeStats && message.findingTypeStats.length) { + object.findingTypeStats = []; + for (var j = 0; j < message.findingTypeStats.length; ++j) + object.findingTypeStats[j] = $root.google.cloud.websecurityscanner.v1alpha.FindingTypeStats.toObject(message.findingTypeStats[j], options); + } + return object; + }; + + /** + * Converts this ListFindingTypeStatsResponse to JSON. + * @function toJSON + * @memberof google.cloud.websecurityscanner.v1alpha.ListFindingTypeStatsResponse + * @instance + * @returns {Object.} JSON object + */ + ListFindingTypeStatsResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListFindingTypeStatsResponse + * @function getTypeUrl + * @memberof google.cloud.websecurityscanner.v1alpha.ListFindingTypeStatsResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListFindingTypeStatsResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.websecurityscanner.v1alpha.ListFindingTypeStatsResponse"; + }; + + return ListFindingTypeStatsResponse; + })(); + + return v1alpha; + })(); + + websecurityscanner.v1beta = (function() { + + /** + * Namespace v1beta. + * @memberof google.cloud.websecurityscanner + * @namespace + */ + var v1beta = {}; + + v1beta.CrawledUrl = (function() { + + /** + * Properties of a CrawledUrl. + * @memberof google.cloud.websecurityscanner.v1beta + * @interface ICrawledUrl + * @property {string|null} [httpMethod] CrawledUrl httpMethod + * @property {string|null} [url] CrawledUrl url + * @property {string|null} [body] CrawledUrl body + */ + + /** + * Constructs a new CrawledUrl. + * @memberof google.cloud.websecurityscanner.v1beta + * @classdesc Represents a CrawledUrl. + * @implements ICrawledUrl + * @constructor + * @param {google.cloud.websecurityscanner.v1beta.ICrawledUrl=} [properties] Properties to set + */ + function CrawledUrl(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * CrawledUrl httpMethod. + * @member {string} httpMethod + * @memberof google.cloud.websecurityscanner.v1beta.CrawledUrl + * @instance + */ + CrawledUrl.prototype.httpMethod = ""; + + /** + * CrawledUrl url. + * @member {string} url + * @memberof google.cloud.websecurityscanner.v1beta.CrawledUrl + * @instance + */ + CrawledUrl.prototype.url = ""; + + /** + * CrawledUrl body. + * @member {string} body + * @memberof google.cloud.websecurityscanner.v1beta.CrawledUrl + * @instance + */ + CrawledUrl.prototype.body = ""; + + /** + * Creates a new CrawledUrl instance using the specified properties. + * @function create + * @memberof google.cloud.websecurityscanner.v1beta.CrawledUrl + * @static + * @param {google.cloud.websecurityscanner.v1beta.ICrawledUrl=} [properties] Properties to set + * @returns {google.cloud.websecurityscanner.v1beta.CrawledUrl} CrawledUrl instance + */ + CrawledUrl.create = function create(properties) { + return new CrawledUrl(properties); + }; + + /** + * Encodes the specified CrawledUrl message. Does not implicitly {@link google.cloud.websecurityscanner.v1beta.CrawledUrl.verify|verify} messages. + * @function encode + * @memberof google.cloud.websecurityscanner.v1beta.CrawledUrl + * @static + * @param {google.cloud.websecurityscanner.v1beta.ICrawledUrl} message CrawledUrl message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CrawledUrl.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.httpMethod != null && Object.hasOwnProperty.call(message, "httpMethod")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.httpMethod); + if (message.url != null && Object.hasOwnProperty.call(message, "url")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.url); + if (message.body != null && Object.hasOwnProperty.call(message, "body")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.body); + return writer; + }; + + /** + * Encodes the specified CrawledUrl message, length delimited. Does not implicitly {@link google.cloud.websecurityscanner.v1beta.CrawledUrl.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.websecurityscanner.v1beta.CrawledUrl + * @static + * @param {google.cloud.websecurityscanner.v1beta.ICrawledUrl} message CrawledUrl message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CrawledUrl.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CrawledUrl message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.websecurityscanner.v1beta.CrawledUrl + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.websecurityscanner.v1beta.CrawledUrl} CrawledUrl + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CrawledUrl.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.websecurityscanner.v1beta.CrawledUrl(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.httpMethod = reader.string(); + break; + } + case 2: { + message.url = reader.string(); + break; + } + case 3: { + message.body = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CrawledUrl message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.websecurityscanner.v1beta.CrawledUrl + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.websecurityscanner.v1beta.CrawledUrl} CrawledUrl + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CrawledUrl.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CrawledUrl message. + * @function verify + * @memberof google.cloud.websecurityscanner.v1beta.CrawledUrl + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CrawledUrl.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.httpMethod != null && message.hasOwnProperty("httpMethod")) + if (!$util.isString(message.httpMethod)) + return "httpMethod: string expected"; + if (message.url != null && message.hasOwnProperty("url")) + if (!$util.isString(message.url)) + return "url: string expected"; + if (message.body != null && message.hasOwnProperty("body")) + if (!$util.isString(message.body)) + return "body: string expected"; + return null; + }; + + /** + * Creates a CrawledUrl message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.websecurityscanner.v1beta.CrawledUrl + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.websecurityscanner.v1beta.CrawledUrl} CrawledUrl + */ + CrawledUrl.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.websecurityscanner.v1beta.CrawledUrl) + return object; + var message = new $root.google.cloud.websecurityscanner.v1beta.CrawledUrl(); + if (object.httpMethod != null) + message.httpMethod = String(object.httpMethod); + if (object.url != null) + message.url = String(object.url); + if (object.body != null) + message.body = String(object.body); + return message; + }; + + /** + * Creates a plain object from a CrawledUrl message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.websecurityscanner.v1beta.CrawledUrl + * @static + * @param {google.cloud.websecurityscanner.v1beta.CrawledUrl} message CrawledUrl + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CrawledUrl.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.httpMethod = ""; + object.url = ""; + object.body = ""; + } + if (message.httpMethod != null && message.hasOwnProperty("httpMethod")) + object.httpMethod = message.httpMethod; + if (message.url != null && message.hasOwnProperty("url")) + object.url = message.url; + if (message.body != null && message.hasOwnProperty("body")) + object.body = message.body; + return object; + }; + + /** + * Converts this CrawledUrl to JSON. + * @function toJSON + * @memberof google.cloud.websecurityscanner.v1beta.CrawledUrl + * @instance + * @returns {Object.} JSON object + */ + CrawledUrl.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CrawledUrl + * @function getTypeUrl + * @memberof google.cloud.websecurityscanner.v1beta.CrawledUrl + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CrawledUrl.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.websecurityscanner.v1beta.CrawledUrl"; + }; + + return CrawledUrl; + })(); + + v1beta.Finding = (function() { + + /** + * Properties of a Finding. + * @memberof google.cloud.websecurityscanner.v1beta + * @interface IFinding + * @property {string|null} [name] Finding name + * @property {string|null} [findingType] Finding findingType + * @property {string|null} [httpMethod] Finding httpMethod + * @property {string|null} [fuzzedUrl] Finding fuzzedUrl + * @property {string|null} [body] Finding body + * @property {string|null} [description] Finding description + * @property {string|null} [reproductionUrl] Finding reproductionUrl + * @property {string|null} [frameUrl] Finding frameUrl + * @property {string|null} [finalUrl] Finding finalUrl + * @property {string|null} [trackingId] Finding trackingId + * @property {google.cloud.websecurityscanner.v1beta.IForm|null} [form] Finding form + * @property {google.cloud.websecurityscanner.v1beta.IOutdatedLibrary|null} [outdatedLibrary] Finding outdatedLibrary + * @property {google.cloud.websecurityscanner.v1beta.IViolatingResource|null} [violatingResource] Finding violatingResource + * @property {google.cloud.websecurityscanner.v1beta.IVulnerableHeaders|null} [vulnerableHeaders] Finding vulnerableHeaders + * @property {google.cloud.websecurityscanner.v1beta.IVulnerableParameters|null} [vulnerableParameters] Finding vulnerableParameters + * @property {google.cloud.websecurityscanner.v1beta.IXss|null} [xss] Finding xss + */ + + /** + * Constructs a new Finding. + * @memberof google.cloud.websecurityscanner.v1beta + * @classdesc Represents a Finding. + * @implements IFinding + * @constructor + * @param {google.cloud.websecurityscanner.v1beta.IFinding=} [properties] Properties to set + */ + function Finding(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Finding name. + * @member {string} name + * @memberof google.cloud.websecurityscanner.v1beta.Finding + * @instance + */ + Finding.prototype.name = ""; + + /** + * Finding findingType. + * @member {string} findingType + * @memberof google.cloud.websecurityscanner.v1beta.Finding + * @instance + */ + Finding.prototype.findingType = ""; + + /** + * Finding httpMethod. + * @member {string} httpMethod + * @memberof google.cloud.websecurityscanner.v1beta.Finding + * @instance + */ + Finding.prototype.httpMethod = ""; + + /** + * Finding fuzzedUrl. + * @member {string} fuzzedUrl + * @memberof google.cloud.websecurityscanner.v1beta.Finding + * @instance + */ + Finding.prototype.fuzzedUrl = ""; + + /** + * Finding body. + * @member {string} body + * @memberof google.cloud.websecurityscanner.v1beta.Finding + * @instance + */ + Finding.prototype.body = ""; + + /** + * Finding description. + * @member {string} description + * @memberof google.cloud.websecurityscanner.v1beta.Finding + * @instance + */ + Finding.prototype.description = ""; + + /** + * Finding reproductionUrl. + * @member {string} reproductionUrl + * @memberof google.cloud.websecurityscanner.v1beta.Finding + * @instance + */ + Finding.prototype.reproductionUrl = ""; + + /** + * Finding frameUrl. + * @member {string} frameUrl + * @memberof google.cloud.websecurityscanner.v1beta.Finding + * @instance + */ + Finding.prototype.frameUrl = ""; + + /** + * Finding finalUrl. + * @member {string} finalUrl + * @memberof google.cloud.websecurityscanner.v1beta.Finding + * @instance + */ + Finding.prototype.finalUrl = ""; + + /** + * Finding trackingId. + * @member {string} trackingId + * @memberof google.cloud.websecurityscanner.v1beta.Finding + * @instance + */ + Finding.prototype.trackingId = ""; + + /** + * Finding form. + * @member {google.cloud.websecurityscanner.v1beta.IForm|null|undefined} form + * @memberof google.cloud.websecurityscanner.v1beta.Finding + * @instance + */ + Finding.prototype.form = null; + + /** + * Finding outdatedLibrary. + * @member {google.cloud.websecurityscanner.v1beta.IOutdatedLibrary|null|undefined} outdatedLibrary + * @memberof google.cloud.websecurityscanner.v1beta.Finding + * @instance + */ + Finding.prototype.outdatedLibrary = null; + + /** + * Finding violatingResource. + * @member {google.cloud.websecurityscanner.v1beta.IViolatingResource|null|undefined} violatingResource + * @memberof google.cloud.websecurityscanner.v1beta.Finding + * @instance + */ + Finding.prototype.violatingResource = null; + + /** + * Finding vulnerableHeaders. + * @member {google.cloud.websecurityscanner.v1beta.IVulnerableHeaders|null|undefined} vulnerableHeaders + * @memberof google.cloud.websecurityscanner.v1beta.Finding + * @instance + */ + Finding.prototype.vulnerableHeaders = null; + + /** + * Finding vulnerableParameters. + * @member {google.cloud.websecurityscanner.v1beta.IVulnerableParameters|null|undefined} vulnerableParameters + * @memberof google.cloud.websecurityscanner.v1beta.Finding + * @instance + */ + Finding.prototype.vulnerableParameters = null; + + /** + * Finding xss. + * @member {google.cloud.websecurityscanner.v1beta.IXss|null|undefined} xss + * @memberof google.cloud.websecurityscanner.v1beta.Finding + * @instance + */ + Finding.prototype.xss = null; + + /** + * Creates a new Finding instance using the specified properties. + * @function create + * @memberof google.cloud.websecurityscanner.v1beta.Finding + * @static + * @param {google.cloud.websecurityscanner.v1beta.IFinding=} [properties] Properties to set + * @returns {google.cloud.websecurityscanner.v1beta.Finding} Finding instance + */ + Finding.create = function create(properties) { + return new Finding(properties); + }; + + /** + * Encodes the specified Finding message. Does not implicitly {@link google.cloud.websecurityscanner.v1beta.Finding.verify|verify} messages. + * @function encode + * @memberof google.cloud.websecurityscanner.v1beta.Finding + * @static + * @param {google.cloud.websecurityscanner.v1beta.IFinding} message Finding message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Finding.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.findingType != null && Object.hasOwnProperty.call(message, "findingType")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.findingType); + if (message.httpMethod != null && Object.hasOwnProperty.call(message, "httpMethod")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.httpMethod); + if (message.fuzzedUrl != null && Object.hasOwnProperty.call(message, "fuzzedUrl")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.fuzzedUrl); + if (message.body != null && Object.hasOwnProperty.call(message, "body")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.body); + if (message.description != null && Object.hasOwnProperty.call(message, "description")) + writer.uint32(/* id 6, wireType 2 =*/50).string(message.description); + if (message.reproductionUrl != null && Object.hasOwnProperty.call(message, "reproductionUrl")) + writer.uint32(/* id 7, wireType 2 =*/58).string(message.reproductionUrl); + if (message.frameUrl != null && Object.hasOwnProperty.call(message, "frameUrl")) + writer.uint32(/* id 8, wireType 2 =*/66).string(message.frameUrl); + if (message.finalUrl != null && Object.hasOwnProperty.call(message, "finalUrl")) + writer.uint32(/* id 9, wireType 2 =*/74).string(message.finalUrl); + if (message.trackingId != null && Object.hasOwnProperty.call(message, "trackingId")) + writer.uint32(/* id 10, wireType 2 =*/82).string(message.trackingId); + if (message.outdatedLibrary != null && Object.hasOwnProperty.call(message, "outdatedLibrary")) + $root.google.cloud.websecurityscanner.v1beta.OutdatedLibrary.encode(message.outdatedLibrary, writer.uint32(/* id 11, wireType 2 =*/90).fork()).ldelim(); + if (message.violatingResource != null && Object.hasOwnProperty.call(message, "violatingResource")) + $root.google.cloud.websecurityscanner.v1beta.ViolatingResource.encode(message.violatingResource, writer.uint32(/* id 12, wireType 2 =*/98).fork()).ldelim(); + if (message.vulnerableParameters != null && Object.hasOwnProperty.call(message, "vulnerableParameters")) + $root.google.cloud.websecurityscanner.v1beta.VulnerableParameters.encode(message.vulnerableParameters, writer.uint32(/* id 13, wireType 2 =*/106).fork()).ldelim(); + if (message.xss != null && Object.hasOwnProperty.call(message, "xss")) + $root.google.cloud.websecurityscanner.v1beta.Xss.encode(message.xss, writer.uint32(/* id 14, wireType 2 =*/114).fork()).ldelim(); + if (message.vulnerableHeaders != null && Object.hasOwnProperty.call(message, "vulnerableHeaders")) + $root.google.cloud.websecurityscanner.v1beta.VulnerableHeaders.encode(message.vulnerableHeaders, writer.uint32(/* id 15, wireType 2 =*/122).fork()).ldelim(); + if (message.form != null && Object.hasOwnProperty.call(message, "form")) + $root.google.cloud.websecurityscanner.v1beta.Form.encode(message.form, writer.uint32(/* id 16, wireType 2 =*/130).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified Finding message, length delimited. Does not implicitly {@link google.cloud.websecurityscanner.v1beta.Finding.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.websecurityscanner.v1beta.Finding + * @static + * @param {google.cloud.websecurityscanner.v1beta.IFinding} message Finding message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Finding.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Finding message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.websecurityscanner.v1beta.Finding + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.websecurityscanner.v1beta.Finding} Finding + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Finding.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.websecurityscanner.v1beta.Finding(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.findingType = reader.string(); + break; + } + case 3: { + message.httpMethod = reader.string(); + break; + } + case 4: { + message.fuzzedUrl = reader.string(); + break; + } + case 5: { + message.body = reader.string(); + break; + } + case 6: { + message.description = reader.string(); + break; + } + case 7: { + message.reproductionUrl = reader.string(); + break; + } + case 8: { + message.frameUrl = reader.string(); + break; + } + case 9: { + message.finalUrl = reader.string(); + break; + } + case 10: { + message.trackingId = reader.string(); + break; + } + case 16: { + message.form = $root.google.cloud.websecurityscanner.v1beta.Form.decode(reader, reader.uint32()); + break; + } + case 11: { + message.outdatedLibrary = $root.google.cloud.websecurityscanner.v1beta.OutdatedLibrary.decode(reader, reader.uint32()); + break; + } + case 12: { + message.violatingResource = $root.google.cloud.websecurityscanner.v1beta.ViolatingResource.decode(reader, reader.uint32()); + break; + } + case 15: { + message.vulnerableHeaders = $root.google.cloud.websecurityscanner.v1beta.VulnerableHeaders.decode(reader, reader.uint32()); + break; + } + case 13: { + message.vulnerableParameters = $root.google.cloud.websecurityscanner.v1beta.VulnerableParameters.decode(reader, reader.uint32()); + break; + } + case 14: { + message.xss = $root.google.cloud.websecurityscanner.v1beta.Xss.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Finding message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.websecurityscanner.v1beta.Finding + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.websecurityscanner.v1beta.Finding} Finding + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Finding.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Finding message. + * @function verify + * @memberof google.cloud.websecurityscanner.v1beta.Finding + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Finding.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.findingType != null && message.hasOwnProperty("findingType")) + if (!$util.isString(message.findingType)) + return "findingType: string expected"; + if (message.httpMethod != null && message.hasOwnProperty("httpMethod")) + if (!$util.isString(message.httpMethod)) + return "httpMethod: string expected"; + if (message.fuzzedUrl != null && message.hasOwnProperty("fuzzedUrl")) + if (!$util.isString(message.fuzzedUrl)) + return "fuzzedUrl: string expected"; + if (message.body != null && message.hasOwnProperty("body")) + if (!$util.isString(message.body)) + return "body: string expected"; + if (message.description != null && message.hasOwnProperty("description")) + if (!$util.isString(message.description)) + return "description: string expected"; + if (message.reproductionUrl != null && message.hasOwnProperty("reproductionUrl")) + if (!$util.isString(message.reproductionUrl)) + return "reproductionUrl: string expected"; + if (message.frameUrl != null && message.hasOwnProperty("frameUrl")) + if (!$util.isString(message.frameUrl)) + return "frameUrl: string expected"; + if (message.finalUrl != null && message.hasOwnProperty("finalUrl")) + if (!$util.isString(message.finalUrl)) + return "finalUrl: string expected"; + if (message.trackingId != null && message.hasOwnProperty("trackingId")) + if (!$util.isString(message.trackingId)) + return "trackingId: string expected"; + if (message.form != null && message.hasOwnProperty("form")) { + var error = $root.google.cloud.websecurityscanner.v1beta.Form.verify(message.form); + if (error) + return "form." + error; + } + if (message.outdatedLibrary != null && message.hasOwnProperty("outdatedLibrary")) { + var error = $root.google.cloud.websecurityscanner.v1beta.OutdatedLibrary.verify(message.outdatedLibrary); + if (error) + return "outdatedLibrary." + error; + } + if (message.violatingResource != null && message.hasOwnProperty("violatingResource")) { + var error = $root.google.cloud.websecurityscanner.v1beta.ViolatingResource.verify(message.violatingResource); + if (error) + return "violatingResource." + error; + } + if (message.vulnerableHeaders != null && message.hasOwnProperty("vulnerableHeaders")) { + var error = $root.google.cloud.websecurityscanner.v1beta.VulnerableHeaders.verify(message.vulnerableHeaders); + if (error) + return "vulnerableHeaders." + error; + } + if (message.vulnerableParameters != null && message.hasOwnProperty("vulnerableParameters")) { + var error = $root.google.cloud.websecurityscanner.v1beta.VulnerableParameters.verify(message.vulnerableParameters); + if (error) + return "vulnerableParameters." + error; + } + if (message.xss != null && message.hasOwnProperty("xss")) { + var error = $root.google.cloud.websecurityscanner.v1beta.Xss.verify(message.xss); + if (error) + return "xss." + error; + } + return null; + }; + + /** + * Creates a Finding message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.websecurityscanner.v1beta.Finding + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.websecurityscanner.v1beta.Finding} Finding + */ + Finding.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.websecurityscanner.v1beta.Finding) + return object; + var message = new $root.google.cloud.websecurityscanner.v1beta.Finding(); + if (object.name != null) + message.name = String(object.name); + if (object.findingType != null) + message.findingType = String(object.findingType); + if (object.httpMethod != null) + message.httpMethod = String(object.httpMethod); + if (object.fuzzedUrl != null) + message.fuzzedUrl = String(object.fuzzedUrl); + if (object.body != null) + message.body = String(object.body); + if (object.description != null) + message.description = String(object.description); + if (object.reproductionUrl != null) + message.reproductionUrl = String(object.reproductionUrl); + if (object.frameUrl != null) + message.frameUrl = String(object.frameUrl); + if (object.finalUrl != null) + message.finalUrl = String(object.finalUrl); + if (object.trackingId != null) + message.trackingId = String(object.trackingId); + if (object.form != null) { + if (typeof object.form !== "object") + throw TypeError(".google.cloud.websecurityscanner.v1beta.Finding.form: object expected"); + message.form = $root.google.cloud.websecurityscanner.v1beta.Form.fromObject(object.form); + } + if (object.outdatedLibrary != null) { + if (typeof object.outdatedLibrary !== "object") + throw TypeError(".google.cloud.websecurityscanner.v1beta.Finding.outdatedLibrary: object expected"); + message.outdatedLibrary = $root.google.cloud.websecurityscanner.v1beta.OutdatedLibrary.fromObject(object.outdatedLibrary); + } + if (object.violatingResource != null) { + if (typeof object.violatingResource !== "object") + throw TypeError(".google.cloud.websecurityscanner.v1beta.Finding.violatingResource: object expected"); + message.violatingResource = $root.google.cloud.websecurityscanner.v1beta.ViolatingResource.fromObject(object.violatingResource); + } + if (object.vulnerableHeaders != null) { + if (typeof object.vulnerableHeaders !== "object") + throw TypeError(".google.cloud.websecurityscanner.v1beta.Finding.vulnerableHeaders: object expected"); + message.vulnerableHeaders = $root.google.cloud.websecurityscanner.v1beta.VulnerableHeaders.fromObject(object.vulnerableHeaders); + } + if (object.vulnerableParameters != null) { + if (typeof object.vulnerableParameters !== "object") + throw TypeError(".google.cloud.websecurityscanner.v1beta.Finding.vulnerableParameters: object expected"); + message.vulnerableParameters = $root.google.cloud.websecurityscanner.v1beta.VulnerableParameters.fromObject(object.vulnerableParameters); + } + if (object.xss != null) { + if (typeof object.xss !== "object") + throw TypeError(".google.cloud.websecurityscanner.v1beta.Finding.xss: object expected"); + message.xss = $root.google.cloud.websecurityscanner.v1beta.Xss.fromObject(object.xss); + } + return message; + }; + + /** + * Creates a plain object from a Finding message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.websecurityscanner.v1beta.Finding + * @static + * @param {google.cloud.websecurityscanner.v1beta.Finding} message Finding + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Finding.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.findingType = ""; + object.httpMethod = ""; + object.fuzzedUrl = ""; + object.body = ""; + object.description = ""; + object.reproductionUrl = ""; + object.frameUrl = ""; + object.finalUrl = ""; + object.trackingId = ""; + object.outdatedLibrary = null; + object.violatingResource = null; + object.vulnerableParameters = null; + object.xss = null; + object.vulnerableHeaders = null; + object.form = null; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.findingType != null && message.hasOwnProperty("findingType")) + object.findingType = message.findingType; + if (message.httpMethod != null && message.hasOwnProperty("httpMethod")) + object.httpMethod = message.httpMethod; + if (message.fuzzedUrl != null && message.hasOwnProperty("fuzzedUrl")) + object.fuzzedUrl = message.fuzzedUrl; + if (message.body != null && message.hasOwnProperty("body")) + object.body = message.body; + if (message.description != null && message.hasOwnProperty("description")) + object.description = message.description; + if (message.reproductionUrl != null && message.hasOwnProperty("reproductionUrl")) + object.reproductionUrl = message.reproductionUrl; + if (message.frameUrl != null && message.hasOwnProperty("frameUrl")) + object.frameUrl = message.frameUrl; + if (message.finalUrl != null && message.hasOwnProperty("finalUrl")) + object.finalUrl = message.finalUrl; + if (message.trackingId != null && message.hasOwnProperty("trackingId")) + object.trackingId = message.trackingId; + if (message.outdatedLibrary != null && message.hasOwnProperty("outdatedLibrary")) + object.outdatedLibrary = $root.google.cloud.websecurityscanner.v1beta.OutdatedLibrary.toObject(message.outdatedLibrary, options); + if (message.violatingResource != null && message.hasOwnProperty("violatingResource")) + object.violatingResource = $root.google.cloud.websecurityscanner.v1beta.ViolatingResource.toObject(message.violatingResource, options); + if (message.vulnerableParameters != null && message.hasOwnProperty("vulnerableParameters")) + object.vulnerableParameters = $root.google.cloud.websecurityscanner.v1beta.VulnerableParameters.toObject(message.vulnerableParameters, options); + if (message.xss != null && message.hasOwnProperty("xss")) + object.xss = $root.google.cloud.websecurityscanner.v1beta.Xss.toObject(message.xss, options); + if (message.vulnerableHeaders != null && message.hasOwnProperty("vulnerableHeaders")) + object.vulnerableHeaders = $root.google.cloud.websecurityscanner.v1beta.VulnerableHeaders.toObject(message.vulnerableHeaders, options); + if (message.form != null && message.hasOwnProperty("form")) + object.form = $root.google.cloud.websecurityscanner.v1beta.Form.toObject(message.form, options); + return object; + }; + + /** + * Converts this Finding to JSON. + * @function toJSON + * @memberof google.cloud.websecurityscanner.v1beta.Finding + * @instance + * @returns {Object.} JSON object + */ + Finding.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Finding + * @function getTypeUrl + * @memberof google.cloud.websecurityscanner.v1beta.Finding + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Finding.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.websecurityscanner.v1beta.Finding"; + }; + + return Finding; + })(); + + v1beta.Form = (function() { + + /** + * Properties of a Form. + * @memberof google.cloud.websecurityscanner.v1beta + * @interface IForm + * @property {string|null} [actionUri] Form actionUri + * @property {Array.|null} [fields] Form fields + */ + + /** + * Constructs a new Form. + * @memberof google.cloud.websecurityscanner.v1beta + * @classdesc Represents a Form. + * @implements IForm + * @constructor + * @param {google.cloud.websecurityscanner.v1beta.IForm=} [properties] Properties to set + */ + function Form(properties) { + this.fields = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Form actionUri. + * @member {string} actionUri + * @memberof google.cloud.websecurityscanner.v1beta.Form + * @instance + */ + Form.prototype.actionUri = ""; + + /** + * Form fields. + * @member {Array.} fields + * @memberof google.cloud.websecurityscanner.v1beta.Form + * @instance + */ + Form.prototype.fields = $util.emptyArray; + + /** + * Creates a new Form instance using the specified properties. + * @function create + * @memberof google.cloud.websecurityscanner.v1beta.Form + * @static + * @param {google.cloud.websecurityscanner.v1beta.IForm=} [properties] Properties to set + * @returns {google.cloud.websecurityscanner.v1beta.Form} Form instance + */ + Form.create = function create(properties) { + return new Form(properties); + }; + + /** + * Encodes the specified Form message. Does not implicitly {@link google.cloud.websecurityscanner.v1beta.Form.verify|verify} messages. + * @function encode + * @memberof google.cloud.websecurityscanner.v1beta.Form + * @static + * @param {google.cloud.websecurityscanner.v1beta.IForm} message Form message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Form.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.actionUri != null && Object.hasOwnProperty.call(message, "actionUri")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.actionUri); + if (message.fields != null && message.fields.length) + for (var i = 0; i < message.fields.length; ++i) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.fields[i]); + return writer; + }; + + /** + * Encodes the specified Form message, length delimited. Does not implicitly {@link google.cloud.websecurityscanner.v1beta.Form.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.websecurityscanner.v1beta.Form + * @static + * @param {google.cloud.websecurityscanner.v1beta.IForm} message Form message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Form.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Form message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.websecurityscanner.v1beta.Form + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.websecurityscanner.v1beta.Form} Form + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Form.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.websecurityscanner.v1beta.Form(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.actionUri = reader.string(); + break; + } + case 2: { + if (!(message.fields && message.fields.length)) + message.fields = []; + message.fields.push(reader.string()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Form message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.websecurityscanner.v1beta.Form + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.websecurityscanner.v1beta.Form} Form + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Form.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Form message. + * @function verify + * @memberof google.cloud.websecurityscanner.v1beta.Form + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Form.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.actionUri != null && message.hasOwnProperty("actionUri")) + if (!$util.isString(message.actionUri)) + return "actionUri: string expected"; + if (message.fields != null && message.hasOwnProperty("fields")) { + if (!Array.isArray(message.fields)) + return "fields: array expected"; + for (var i = 0; i < message.fields.length; ++i) + if (!$util.isString(message.fields[i])) + return "fields: string[] expected"; + } + return null; + }; + + /** + * Creates a Form message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.websecurityscanner.v1beta.Form + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.websecurityscanner.v1beta.Form} Form + */ + Form.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.websecurityscanner.v1beta.Form) + return object; + var message = new $root.google.cloud.websecurityscanner.v1beta.Form(); + if (object.actionUri != null) + message.actionUri = String(object.actionUri); + if (object.fields) { + if (!Array.isArray(object.fields)) + throw TypeError(".google.cloud.websecurityscanner.v1beta.Form.fields: array expected"); + message.fields = []; + for (var i = 0; i < object.fields.length; ++i) + message.fields[i] = String(object.fields[i]); + } + return message; + }; + + /** + * Creates a plain object from a Form message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.websecurityscanner.v1beta.Form + * @static + * @param {google.cloud.websecurityscanner.v1beta.Form} message Form + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Form.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.fields = []; + if (options.defaults) + object.actionUri = ""; + if (message.actionUri != null && message.hasOwnProperty("actionUri")) + object.actionUri = message.actionUri; + if (message.fields && message.fields.length) { + object.fields = []; + for (var j = 0; j < message.fields.length; ++j) + object.fields[j] = message.fields[j]; + } + return object; + }; + + /** + * Converts this Form to JSON. + * @function toJSON + * @memberof google.cloud.websecurityscanner.v1beta.Form + * @instance + * @returns {Object.} JSON object + */ + Form.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Form + * @function getTypeUrl + * @memberof google.cloud.websecurityscanner.v1beta.Form + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Form.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.websecurityscanner.v1beta.Form"; + }; + + return Form; + })(); + + v1beta.OutdatedLibrary = (function() { + + /** + * Properties of an OutdatedLibrary. + * @memberof google.cloud.websecurityscanner.v1beta + * @interface IOutdatedLibrary + * @property {string|null} [libraryName] OutdatedLibrary libraryName + * @property {string|null} [version] OutdatedLibrary version + * @property {Array.|null} [learnMoreUrls] OutdatedLibrary learnMoreUrls + */ + + /** + * Constructs a new OutdatedLibrary. + * @memberof google.cloud.websecurityscanner.v1beta + * @classdesc Represents an OutdatedLibrary. + * @implements IOutdatedLibrary + * @constructor + * @param {google.cloud.websecurityscanner.v1beta.IOutdatedLibrary=} [properties] Properties to set + */ + function OutdatedLibrary(properties) { + this.learnMoreUrls = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * OutdatedLibrary libraryName. + * @member {string} libraryName + * @memberof google.cloud.websecurityscanner.v1beta.OutdatedLibrary + * @instance + */ + OutdatedLibrary.prototype.libraryName = ""; + + /** + * OutdatedLibrary version. + * @member {string} version + * @memberof google.cloud.websecurityscanner.v1beta.OutdatedLibrary + * @instance + */ + OutdatedLibrary.prototype.version = ""; + + /** + * OutdatedLibrary learnMoreUrls. + * @member {Array.} learnMoreUrls + * @memberof google.cloud.websecurityscanner.v1beta.OutdatedLibrary + * @instance + */ + OutdatedLibrary.prototype.learnMoreUrls = $util.emptyArray; + + /** + * Creates a new OutdatedLibrary instance using the specified properties. + * @function create + * @memberof google.cloud.websecurityscanner.v1beta.OutdatedLibrary + * @static + * @param {google.cloud.websecurityscanner.v1beta.IOutdatedLibrary=} [properties] Properties to set + * @returns {google.cloud.websecurityscanner.v1beta.OutdatedLibrary} OutdatedLibrary instance + */ + OutdatedLibrary.create = function create(properties) { + return new OutdatedLibrary(properties); + }; + + /** + * Encodes the specified OutdatedLibrary message. Does not implicitly {@link google.cloud.websecurityscanner.v1beta.OutdatedLibrary.verify|verify} messages. + * @function encode + * @memberof google.cloud.websecurityscanner.v1beta.OutdatedLibrary + * @static + * @param {google.cloud.websecurityscanner.v1beta.IOutdatedLibrary} message OutdatedLibrary message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + OutdatedLibrary.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.libraryName != null && Object.hasOwnProperty.call(message, "libraryName")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.libraryName); + if (message.version != null && Object.hasOwnProperty.call(message, "version")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.version); + if (message.learnMoreUrls != null && message.learnMoreUrls.length) + for (var i = 0; i < message.learnMoreUrls.length; ++i) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.learnMoreUrls[i]); + return writer; + }; + + /** + * Encodes the specified OutdatedLibrary message, length delimited. Does not implicitly {@link google.cloud.websecurityscanner.v1beta.OutdatedLibrary.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.websecurityscanner.v1beta.OutdatedLibrary + * @static + * @param {google.cloud.websecurityscanner.v1beta.IOutdatedLibrary} message OutdatedLibrary message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + OutdatedLibrary.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an OutdatedLibrary message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.websecurityscanner.v1beta.OutdatedLibrary + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.websecurityscanner.v1beta.OutdatedLibrary} OutdatedLibrary + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + OutdatedLibrary.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.websecurityscanner.v1beta.OutdatedLibrary(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.libraryName = reader.string(); + break; + } + case 2: { + message.version = reader.string(); + break; + } + case 3: { + if (!(message.learnMoreUrls && message.learnMoreUrls.length)) + message.learnMoreUrls = []; + message.learnMoreUrls.push(reader.string()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an OutdatedLibrary message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.websecurityscanner.v1beta.OutdatedLibrary + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.websecurityscanner.v1beta.OutdatedLibrary} OutdatedLibrary + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + OutdatedLibrary.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an OutdatedLibrary message. + * @function verify + * @memberof google.cloud.websecurityscanner.v1beta.OutdatedLibrary + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + OutdatedLibrary.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.libraryName != null && message.hasOwnProperty("libraryName")) + if (!$util.isString(message.libraryName)) + return "libraryName: string expected"; + if (message.version != null && message.hasOwnProperty("version")) + if (!$util.isString(message.version)) + return "version: string expected"; + if (message.learnMoreUrls != null && message.hasOwnProperty("learnMoreUrls")) { + if (!Array.isArray(message.learnMoreUrls)) + return "learnMoreUrls: array expected"; + for (var i = 0; i < message.learnMoreUrls.length; ++i) + if (!$util.isString(message.learnMoreUrls[i])) + return "learnMoreUrls: string[] expected"; + } + return null; + }; + + /** + * Creates an OutdatedLibrary message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.websecurityscanner.v1beta.OutdatedLibrary + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.websecurityscanner.v1beta.OutdatedLibrary} OutdatedLibrary + */ + OutdatedLibrary.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.websecurityscanner.v1beta.OutdatedLibrary) + return object; + var message = new $root.google.cloud.websecurityscanner.v1beta.OutdatedLibrary(); + if (object.libraryName != null) + message.libraryName = String(object.libraryName); + if (object.version != null) + message.version = String(object.version); + if (object.learnMoreUrls) { + if (!Array.isArray(object.learnMoreUrls)) + throw TypeError(".google.cloud.websecurityscanner.v1beta.OutdatedLibrary.learnMoreUrls: array expected"); + message.learnMoreUrls = []; + for (var i = 0; i < object.learnMoreUrls.length; ++i) + message.learnMoreUrls[i] = String(object.learnMoreUrls[i]); + } + return message; + }; + + /** + * Creates a plain object from an OutdatedLibrary message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.websecurityscanner.v1beta.OutdatedLibrary + * @static + * @param {google.cloud.websecurityscanner.v1beta.OutdatedLibrary} message OutdatedLibrary + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + OutdatedLibrary.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.learnMoreUrls = []; + if (options.defaults) { + object.libraryName = ""; + object.version = ""; + } + if (message.libraryName != null && message.hasOwnProperty("libraryName")) + object.libraryName = message.libraryName; + if (message.version != null && message.hasOwnProperty("version")) + object.version = message.version; + if (message.learnMoreUrls && message.learnMoreUrls.length) { + object.learnMoreUrls = []; + for (var j = 0; j < message.learnMoreUrls.length; ++j) + object.learnMoreUrls[j] = message.learnMoreUrls[j]; + } + return object; + }; + + /** + * Converts this OutdatedLibrary to JSON. + * @function toJSON + * @memberof google.cloud.websecurityscanner.v1beta.OutdatedLibrary + * @instance + * @returns {Object.} JSON object + */ + OutdatedLibrary.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for OutdatedLibrary + * @function getTypeUrl + * @memberof google.cloud.websecurityscanner.v1beta.OutdatedLibrary + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + OutdatedLibrary.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.websecurityscanner.v1beta.OutdatedLibrary"; + }; + + return OutdatedLibrary; + })(); + + v1beta.ViolatingResource = (function() { + + /** + * Properties of a ViolatingResource. + * @memberof google.cloud.websecurityscanner.v1beta + * @interface IViolatingResource + * @property {string|null} [contentType] ViolatingResource contentType + * @property {string|null} [resourceUrl] ViolatingResource resourceUrl + */ + + /** + * Constructs a new ViolatingResource. + * @memberof google.cloud.websecurityscanner.v1beta + * @classdesc Represents a ViolatingResource. + * @implements IViolatingResource + * @constructor + * @param {google.cloud.websecurityscanner.v1beta.IViolatingResource=} [properties] Properties to set + */ + function ViolatingResource(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ViolatingResource contentType. + * @member {string} contentType + * @memberof google.cloud.websecurityscanner.v1beta.ViolatingResource + * @instance + */ + ViolatingResource.prototype.contentType = ""; + + /** + * ViolatingResource resourceUrl. + * @member {string} resourceUrl + * @memberof google.cloud.websecurityscanner.v1beta.ViolatingResource + * @instance + */ + ViolatingResource.prototype.resourceUrl = ""; + + /** + * Creates a new ViolatingResource instance using the specified properties. + * @function create + * @memberof google.cloud.websecurityscanner.v1beta.ViolatingResource + * @static + * @param {google.cloud.websecurityscanner.v1beta.IViolatingResource=} [properties] Properties to set + * @returns {google.cloud.websecurityscanner.v1beta.ViolatingResource} ViolatingResource instance + */ + ViolatingResource.create = function create(properties) { + return new ViolatingResource(properties); + }; + + /** + * Encodes the specified ViolatingResource message. Does not implicitly {@link google.cloud.websecurityscanner.v1beta.ViolatingResource.verify|verify} messages. + * @function encode + * @memberof google.cloud.websecurityscanner.v1beta.ViolatingResource + * @static + * @param {google.cloud.websecurityscanner.v1beta.IViolatingResource} message ViolatingResource message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ViolatingResource.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.contentType != null && Object.hasOwnProperty.call(message, "contentType")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.contentType); + if (message.resourceUrl != null && Object.hasOwnProperty.call(message, "resourceUrl")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.resourceUrl); + return writer; + }; + + /** + * Encodes the specified ViolatingResource message, length delimited. Does not implicitly {@link google.cloud.websecurityscanner.v1beta.ViolatingResource.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.websecurityscanner.v1beta.ViolatingResource + * @static + * @param {google.cloud.websecurityscanner.v1beta.IViolatingResource} message ViolatingResource message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ViolatingResource.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ViolatingResource message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.websecurityscanner.v1beta.ViolatingResource + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.websecurityscanner.v1beta.ViolatingResource} ViolatingResource + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ViolatingResource.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.websecurityscanner.v1beta.ViolatingResource(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.contentType = reader.string(); + break; + } + case 2: { + message.resourceUrl = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ViolatingResource message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.websecurityscanner.v1beta.ViolatingResource + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.websecurityscanner.v1beta.ViolatingResource} ViolatingResource + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ViolatingResource.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ViolatingResource message. + * @function verify + * @memberof google.cloud.websecurityscanner.v1beta.ViolatingResource + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ViolatingResource.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.contentType != null && message.hasOwnProperty("contentType")) + if (!$util.isString(message.contentType)) + return "contentType: string expected"; + if (message.resourceUrl != null && message.hasOwnProperty("resourceUrl")) + if (!$util.isString(message.resourceUrl)) + return "resourceUrl: string expected"; + return null; + }; + + /** + * Creates a ViolatingResource message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.websecurityscanner.v1beta.ViolatingResource + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.websecurityscanner.v1beta.ViolatingResource} ViolatingResource + */ + ViolatingResource.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.websecurityscanner.v1beta.ViolatingResource) + return object; + var message = new $root.google.cloud.websecurityscanner.v1beta.ViolatingResource(); + if (object.contentType != null) + message.contentType = String(object.contentType); + if (object.resourceUrl != null) + message.resourceUrl = String(object.resourceUrl); + return message; + }; + + /** + * Creates a plain object from a ViolatingResource message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.websecurityscanner.v1beta.ViolatingResource + * @static + * @param {google.cloud.websecurityscanner.v1beta.ViolatingResource} message ViolatingResource + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ViolatingResource.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.contentType = ""; + object.resourceUrl = ""; + } + if (message.contentType != null && message.hasOwnProperty("contentType")) + object.contentType = message.contentType; + if (message.resourceUrl != null && message.hasOwnProperty("resourceUrl")) + object.resourceUrl = message.resourceUrl; + return object; + }; + + /** + * Converts this ViolatingResource to JSON. + * @function toJSON + * @memberof google.cloud.websecurityscanner.v1beta.ViolatingResource + * @instance + * @returns {Object.} JSON object + */ + ViolatingResource.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ViolatingResource + * @function getTypeUrl + * @memberof google.cloud.websecurityscanner.v1beta.ViolatingResource + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ViolatingResource.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.websecurityscanner.v1beta.ViolatingResource"; + }; + + return ViolatingResource; + })(); + + v1beta.VulnerableParameters = (function() { + + /** + * Properties of a VulnerableParameters. + * @memberof google.cloud.websecurityscanner.v1beta + * @interface IVulnerableParameters + * @property {Array.|null} [parameterNames] VulnerableParameters parameterNames + */ + + /** + * Constructs a new VulnerableParameters. + * @memberof google.cloud.websecurityscanner.v1beta + * @classdesc Represents a VulnerableParameters. + * @implements IVulnerableParameters + * @constructor + * @param {google.cloud.websecurityscanner.v1beta.IVulnerableParameters=} [properties] Properties to set + */ + function VulnerableParameters(properties) { + this.parameterNames = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * VulnerableParameters parameterNames. + * @member {Array.} parameterNames + * @memberof google.cloud.websecurityscanner.v1beta.VulnerableParameters + * @instance + */ + VulnerableParameters.prototype.parameterNames = $util.emptyArray; + + /** + * Creates a new VulnerableParameters instance using the specified properties. + * @function create + * @memberof google.cloud.websecurityscanner.v1beta.VulnerableParameters + * @static + * @param {google.cloud.websecurityscanner.v1beta.IVulnerableParameters=} [properties] Properties to set + * @returns {google.cloud.websecurityscanner.v1beta.VulnerableParameters} VulnerableParameters instance + */ + VulnerableParameters.create = function create(properties) { + return new VulnerableParameters(properties); + }; + + /** + * Encodes the specified VulnerableParameters message. Does not implicitly {@link google.cloud.websecurityscanner.v1beta.VulnerableParameters.verify|verify} messages. + * @function encode + * @memberof google.cloud.websecurityscanner.v1beta.VulnerableParameters + * @static + * @param {google.cloud.websecurityscanner.v1beta.IVulnerableParameters} message VulnerableParameters message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + VulnerableParameters.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.parameterNames != null && message.parameterNames.length) + for (var i = 0; i < message.parameterNames.length; ++i) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.parameterNames[i]); + return writer; + }; + + /** + * Encodes the specified VulnerableParameters message, length delimited. Does not implicitly {@link google.cloud.websecurityscanner.v1beta.VulnerableParameters.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.websecurityscanner.v1beta.VulnerableParameters + * @static + * @param {google.cloud.websecurityscanner.v1beta.IVulnerableParameters} message VulnerableParameters message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + VulnerableParameters.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a VulnerableParameters message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.websecurityscanner.v1beta.VulnerableParameters + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.websecurityscanner.v1beta.VulnerableParameters} VulnerableParameters + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + VulnerableParameters.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.websecurityscanner.v1beta.VulnerableParameters(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.parameterNames && message.parameterNames.length)) + message.parameterNames = []; + message.parameterNames.push(reader.string()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a VulnerableParameters message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.websecurityscanner.v1beta.VulnerableParameters + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.websecurityscanner.v1beta.VulnerableParameters} VulnerableParameters + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + VulnerableParameters.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a VulnerableParameters message. + * @function verify + * @memberof google.cloud.websecurityscanner.v1beta.VulnerableParameters + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + VulnerableParameters.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.parameterNames != null && message.hasOwnProperty("parameterNames")) { + if (!Array.isArray(message.parameterNames)) + return "parameterNames: array expected"; + for (var i = 0; i < message.parameterNames.length; ++i) + if (!$util.isString(message.parameterNames[i])) + return "parameterNames: string[] expected"; + } + return null; + }; + + /** + * Creates a VulnerableParameters message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.websecurityscanner.v1beta.VulnerableParameters + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.websecurityscanner.v1beta.VulnerableParameters} VulnerableParameters + */ + VulnerableParameters.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.websecurityscanner.v1beta.VulnerableParameters) + return object; + var message = new $root.google.cloud.websecurityscanner.v1beta.VulnerableParameters(); + if (object.parameterNames) { + if (!Array.isArray(object.parameterNames)) + throw TypeError(".google.cloud.websecurityscanner.v1beta.VulnerableParameters.parameterNames: array expected"); + message.parameterNames = []; + for (var i = 0; i < object.parameterNames.length; ++i) + message.parameterNames[i] = String(object.parameterNames[i]); + } + return message; + }; + + /** + * Creates a plain object from a VulnerableParameters message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.websecurityscanner.v1beta.VulnerableParameters + * @static + * @param {google.cloud.websecurityscanner.v1beta.VulnerableParameters} message VulnerableParameters + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + VulnerableParameters.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.parameterNames = []; + if (message.parameterNames && message.parameterNames.length) { + object.parameterNames = []; + for (var j = 0; j < message.parameterNames.length; ++j) + object.parameterNames[j] = message.parameterNames[j]; + } + return object; + }; + + /** + * Converts this VulnerableParameters to JSON. + * @function toJSON + * @memberof google.cloud.websecurityscanner.v1beta.VulnerableParameters + * @instance + * @returns {Object.} JSON object + */ + VulnerableParameters.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for VulnerableParameters + * @function getTypeUrl + * @memberof google.cloud.websecurityscanner.v1beta.VulnerableParameters + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + VulnerableParameters.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.websecurityscanner.v1beta.VulnerableParameters"; + }; + + return VulnerableParameters; + })(); + + v1beta.VulnerableHeaders = (function() { + + /** + * Properties of a VulnerableHeaders. + * @memberof google.cloud.websecurityscanner.v1beta + * @interface IVulnerableHeaders + * @property {Array.|null} [headers] VulnerableHeaders headers + * @property {Array.|null} [missingHeaders] VulnerableHeaders missingHeaders + */ + + /** + * Constructs a new VulnerableHeaders. + * @memberof google.cloud.websecurityscanner.v1beta + * @classdesc Represents a VulnerableHeaders. + * @implements IVulnerableHeaders + * @constructor + * @param {google.cloud.websecurityscanner.v1beta.IVulnerableHeaders=} [properties] Properties to set + */ + function VulnerableHeaders(properties) { + this.headers = []; + this.missingHeaders = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * VulnerableHeaders headers. + * @member {Array.} headers + * @memberof google.cloud.websecurityscanner.v1beta.VulnerableHeaders + * @instance + */ + VulnerableHeaders.prototype.headers = $util.emptyArray; + + /** + * VulnerableHeaders missingHeaders. + * @member {Array.} missingHeaders + * @memberof google.cloud.websecurityscanner.v1beta.VulnerableHeaders + * @instance + */ + VulnerableHeaders.prototype.missingHeaders = $util.emptyArray; + + /** + * Creates a new VulnerableHeaders instance using the specified properties. + * @function create + * @memberof google.cloud.websecurityscanner.v1beta.VulnerableHeaders + * @static + * @param {google.cloud.websecurityscanner.v1beta.IVulnerableHeaders=} [properties] Properties to set + * @returns {google.cloud.websecurityscanner.v1beta.VulnerableHeaders} VulnerableHeaders instance + */ + VulnerableHeaders.create = function create(properties) { + return new VulnerableHeaders(properties); + }; + + /** + * Encodes the specified VulnerableHeaders message. Does not implicitly {@link google.cloud.websecurityscanner.v1beta.VulnerableHeaders.verify|verify} messages. + * @function encode + * @memberof google.cloud.websecurityscanner.v1beta.VulnerableHeaders + * @static + * @param {google.cloud.websecurityscanner.v1beta.IVulnerableHeaders} message VulnerableHeaders message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + VulnerableHeaders.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.headers != null && message.headers.length) + for (var i = 0; i < message.headers.length; ++i) + $root.google.cloud.websecurityscanner.v1beta.VulnerableHeaders.Header.encode(message.headers[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.missingHeaders != null && message.missingHeaders.length) + for (var i = 0; i < message.missingHeaders.length; ++i) + $root.google.cloud.websecurityscanner.v1beta.VulnerableHeaders.Header.encode(message.missingHeaders[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified VulnerableHeaders message, length delimited. Does not implicitly {@link google.cloud.websecurityscanner.v1beta.VulnerableHeaders.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.websecurityscanner.v1beta.VulnerableHeaders + * @static + * @param {google.cloud.websecurityscanner.v1beta.IVulnerableHeaders} message VulnerableHeaders message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + VulnerableHeaders.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a VulnerableHeaders message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.websecurityscanner.v1beta.VulnerableHeaders + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.websecurityscanner.v1beta.VulnerableHeaders} VulnerableHeaders + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + VulnerableHeaders.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.websecurityscanner.v1beta.VulnerableHeaders(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.headers && message.headers.length)) + message.headers = []; + message.headers.push($root.google.cloud.websecurityscanner.v1beta.VulnerableHeaders.Header.decode(reader, reader.uint32())); + break; + } + case 2: { + if (!(message.missingHeaders && message.missingHeaders.length)) + message.missingHeaders = []; + message.missingHeaders.push($root.google.cloud.websecurityscanner.v1beta.VulnerableHeaders.Header.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a VulnerableHeaders message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.websecurityscanner.v1beta.VulnerableHeaders + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.websecurityscanner.v1beta.VulnerableHeaders} VulnerableHeaders + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + VulnerableHeaders.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a VulnerableHeaders message. + * @function verify + * @memberof google.cloud.websecurityscanner.v1beta.VulnerableHeaders + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + VulnerableHeaders.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.headers != null && message.hasOwnProperty("headers")) { + if (!Array.isArray(message.headers)) + return "headers: array expected"; + for (var i = 0; i < message.headers.length; ++i) { + var error = $root.google.cloud.websecurityscanner.v1beta.VulnerableHeaders.Header.verify(message.headers[i]); + if (error) + return "headers." + error; + } + } + if (message.missingHeaders != null && message.hasOwnProperty("missingHeaders")) { + if (!Array.isArray(message.missingHeaders)) + return "missingHeaders: array expected"; + for (var i = 0; i < message.missingHeaders.length; ++i) { + var error = $root.google.cloud.websecurityscanner.v1beta.VulnerableHeaders.Header.verify(message.missingHeaders[i]); + if (error) + return "missingHeaders." + error; + } + } + return null; + }; + + /** + * Creates a VulnerableHeaders message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.websecurityscanner.v1beta.VulnerableHeaders + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.websecurityscanner.v1beta.VulnerableHeaders} VulnerableHeaders + */ + VulnerableHeaders.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.websecurityscanner.v1beta.VulnerableHeaders) + return object; + var message = new $root.google.cloud.websecurityscanner.v1beta.VulnerableHeaders(); + if (object.headers) { + if (!Array.isArray(object.headers)) + throw TypeError(".google.cloud.websecurityscanner.v1beta.VulnerableHeaders.headers: array expected"); + message.headers = []; + for (var i = 0; i < object.headers.length; ++i) { + if (typeof object.headers[i] !== "object") + throw TypeError(".google.cloud.websecurityscanner.v1beta.VulnerableHeaders.headers: object expected"); + message.headers[i] = $root.google.cloud.websecurityscanner.v1beta.VulnerableHeaders.Header.fromObject(object.headers[i]); + } + } + if (object.missingHeaders) { + if (!Array.isArray(object.missingHeaders)) + throw TypeError(".google.cloud.websecurityscanner.v1beta.VulnerableHeaders.missingHeaders: array expected"); + message.missingHeaders = []; + for (var i = 0; i < object.missingHeaders.length; ++i) { + if (typeof object.missingHeaders[i] !== "object") + throw TypeError(".google.cloud.websecurityscanner.v1beta.VulnerableHeaders.missingHeaders: object expected"); + message.missingHeaders[i] = $root.google.cloud.websecurityscanner.v1beta.VulnerableHeaders.Header.fromObject(object.missingHeaders[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a VulnerableHeaders message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.websecurityscanner.v1beta.VulnerableHeaders + * @static + * @param {google.cloud.websecurityscanner.v1beta.VulnerableHeaders} message VulnerableHeaders + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + VulnerableHeaders.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.headers = []; + object.missingHeaders = []; + } + if (message.headers && message.headers.length) { + object.headers = []; + for (var j = 0; j < message.headers.length; ++j) + object.headers[j] = $root.google.cloud.websecurityscanner.v1beta.VulnerableHeaders.Header.toObject(message.headers[j], options); + } + if (message.missingHeaders && message.missingHeaders.length) { + object.missingHeaders = []; + for (var j = 0; j < message.missingHeaders.length; ++j) + object.missingHeaders[j] = $root.google.cloud.websecurityscanner.v1beta.VulnerableHeaders.Header.toObject(message.missingHeaders[j], options); + } + return object; + }; + + /** + * Converts this VulnerableHeaders to JSON. + * @function toJSON + * @memberof google.cloud.websecurityscanner.v1beta.VulnerableHeaders + * @instance + * @returns {Object.} JSON object + */ + VulnerableHeaders.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for VulnerableHeaders + * @function getTypeUrl + * @memberof google.cloud.websecurityscanner.v1beta.VulnerableHeaders + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + VulnerableHeaders.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.websecurityscanner.v1beta.VulnerableHeaders"; + }; + + VulnerableHeaders.Header = (function() { + + /** + * Properties of a Header. + * @memberof google.cloud.websecurityscanner.v1beta.VulnerableHeaders + * @interface IHeader + * @property {string|null} [name] Header name + * @property {string|null} [value] Header value + */ + + /** + * Constructs a new Header. + * @memberof google.cloud.websecurityscanner.v1beta.VulnerableHeaders + * @classdesc Represents a Header. + * @implements IHeader + * @constructor + * @param {google.cloud.websecurityscanner.v1beta.VulnerableHeaders.IHeader=} [properties] Properties to set + */ + function Header(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Header name. + * @member {string} name + * @memberof google.cloud.websecurityscanner.v1beta.VulnerableHeaders.Header + * @instance + */ + Header.prototype.name = ""; + + /** + * Header value. + * @member {string} value + * @memberof google.cloud.websecurityscanner.v1beta.VulnerableHeaders.Header + * @instance + */ + Header.prototype.value = ""; + + /** + * Creates a new Header instance using the specified properties. + * @function create + * @memberof google.cloud.websecurityscanner.v1beta.VulnerableHeaders.Header + * @static + * @param {google.cloud.websecurityscanner.v1beta.VulnerableHeaders.IHeader=} [properties] Properties to set + * @returns {google.cloud.websecurityscanner.v1beta.VulnerableHeaders.Header} Header instance + */ + Header.create = function create(properties) { + return new Header(properties); + }; + + /** + * Encodes the specified Header message. Does not implicitly {@link google.cloud.websecurityscanner.v1beta.VulnerableHeaders.Header.verify|verify} messages. + * @function encode + * @memberof google.cloud.websecurityscanner.v1beta.VulnerableHeaders.Header + * @static + * @param {google.cloud.websecurityscanner.v1beta.VulnerableHeaders.IHeader} message Header message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Header.encode = function encode(message, writer) { + if (!writer) + 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 Header message, length delimited. Does not implicitly {@link google.cloud.websecurityscanner.v1beta.VulnerableHeaders.Header.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.websecurityscanner.v1beta.VulnerableHeaders.Header + * @static + * @param {google.cloud.websecurityscanner.v1beta.VulnerableHeaders.IHeader} message Header message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Header.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Header message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.websecurityscanner.v1beta.VulnerableHeaders.Header + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.websecurityscanner.v1beta.VulnerableHeaders.Header} Header + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Header.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.websecurityscanner.v1beta.VulnerableHeaders.Header(); + 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 Header message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.websecurityscanner.v1beta.VulnerableHeaders.Header + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.websecurityscanner.v1beta.VulnerableHeaders.Header} Header + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Header.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Header message. + * @function verify + * @memberof google.cloud.websecurityscanner.v1beta.VulnerableHeaders.Header + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Header.verify = function verify(message) { + if (typeof message !== "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 Header message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.websecurityscanner.v1beta.VulnerableHeaders.Header + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.websecurityscanner.v1beta.VulnerableHeaders.Header} Header + */ + Header.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.websecurityscanner.v1beta.VulnerableHeaders.Header) + return object; + var message = new $root.google.cloud.websecurityscanner.v1beta.VulnerableHeaders.Header(); + 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 Header message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.websecurityscanner.v1beta.VulnerableHeaders.Header + * @static + * @param {google.cloud.websecurityscanner.v1beta.VulnerableHeaders.Header} message Header + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Header.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 Header to JSON. + * @function toJSON + * @memberof google.cloud.websecurityscanner.v1beta.VulnerableHeaders.Header + * @instance + * @returns {Object.} JSON object + */ + Header.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Header + * @function getTypeUrl + * @memberof google.cloud.websecurityscanner.v1beta.VulnerableHeaders.Header + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Header.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.websecurityscanner.v1beta.VulnerableHeaders.Header"; + }; + + return Header; + })(); + + return VulnerableHeaders; + })(); + + v1beta.Xss = (function() { + + /** + * Properties of a Xss. + * @memberof google.cloud.websecurityscanner.v1beta + * @interface IXss + * @property {Array.|null} [stackTraces] Xss stackTraces + * @property {string|null} [errorMessage] Xss errorMessage + */ + + /** + * Constructs a new Xss. + * @memberof google.cloud.websecurityscanner.v1beta + * @classdesc Represents a Xss. + * @implements IXss + * @constructor + * @param {google.cloud.websecurityscanner.v1beta.IXss=} [properties] Properties to set + */ + function Xss(properties) { + this.stackTraces = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Xss stackTraces. + * @member {Array.} stackTraces + * @memberof google.cloud.websecurityscanner.v1beta.Xss + * @instance + */ + Xss.prototype.stackTraces = $util.emptyArray; + + /** + * Xss errorMessage. + * @member {string} errorMessage + * @memberof google.cloud.websecurityscanner.v1beta.Xss + * @instance + */ + Xss.prototype.errorMessage = ""; + + /** + * Creates a new Xss instance using the specified properties. + * @function create + * @memberof google.cloud.websecurityscanner.v1beta.Xss + * @static + * @param {google.cloud.websecurityscanner.v1beta.IXss=} [properties] Properties to set + * @returns {google.cloud.websecurityscanner.v1beta.Xss} Xss instance + */ + Xss.create = function create(properties) { + return new Xss(properties); + }; + + /** + * Encodes the specified Xss message. Does not implicitly {@link google.cloud.websecurityscanner.v1beta.Xss.verify|verify} messages. + * @function encode + * @memberof google.cloud.websecurityscanner.v1beta.Xss + * @static + * @param {google.cloud.websecurityscanner.v1beta.IXss} message Xss message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Xss.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.stackTraces != null && message.stackTraces.length) + for (var i = 0; i < message.stackTraces.length; ++i) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.stackTraces[i]); + if (message.errorMessage != null && Object.hasOwnProperty.call(message, "errorMessage")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.errorMessage); + return writer; + }; + + /** + * Encodes the specified Xss message, length delimited. Does not implicitly {@link google.cloud.websecurityscanner.v1beta.Xss.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.websecurityscanner.v1beta.Xss + * @static + * @param {google.cloud.websecurityscanner.v1beta.IXss} message Xss message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Xss.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Xss message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.websecurityscanner.v1beta.Xss + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.websecurityscanner.v1beta.Xss} Xss + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Xss.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.websecurityscanner.v1beta.Xss(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.stackTraces && message.stackTraces.length)) + message.stackTraces = []; + message.stackTraces.push(reader.string()); + break; + } + case 2: { + message.errorMessage = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Xss message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.websecurityscanner.v1beta.Xss + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.websecurityscanner.v1beta.Xss} Xss + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Xss.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Xss message. + * @function verify + * @memberof google.cloud.websecurityscanner.v1beta.Xss + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Xss.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.stackTraces != null && message.hasOwnProperty("stackTraces")) { + if (!Array.isArray(message.stackTraces)) + return "stackTraces: array expected"; + for (var i = 0; i < message.stackTraces.length; ++i) + if (!$util.isString(message.stackTraces[i])) + return "stackTraces: string[] expected"; + } + if (message.errorMessage != null && message.hasOwnProperty("errorMessage")) + if (!$util.isString(message.errorMessage)) + return "errorMessage: string expected"; + return null; + }; + + /** + * Creates a Xss message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.websecurityscanner.v1beta.Xss + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.websecurityscanner.v1beta.Xss} Xss + */ + Xss.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.websecurityscanner.v1beta.Xss) + return object; + var message = new $root.google.cloud.websecurityscanner.v1beta.Xss(); + if (object.stackTraces) { + if (!Array.isArray(object.stackTraces)) + throw TypeError(".google.cloud.websecurityscanner.v1beta.Xss.stackTraces: array expected"); + message.stackTraces = []; + for (var i = 0; i < object.stackTraces.length; ++i) + message.stackTraces[i] = String(object.stackTraces[i]); + } + if (object.errorMessage != null) + message.errorMessage = String(object.errorMessage); + return message; + }; + + /** + * Creates a plain object from a Xss message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.websecurityscanner.v1beta.Xss + * @static + * @param {google.cloud.websecurityscanner.v1beta.Xss} message Xss + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Xss.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.stackTraces = []; + if (options.defaults) + object.errorMessage = ""; + if (message.stackTraces && message.stackTraces.length) { + object.stackTraces = []; + for (var j = 0; j < message.stackTraces.length; ++j) + object.stackTraces[j] = message.stackTraces[j]; + } + if (message.errorMessage != null && message.hasOwnProperty("errorMessage")) + object.errorMessage = message.errorMessage; + return object; + }; + + /** + * Converts this Xss to JSON. + * @function toJSON + * @memberof google.cloud.websecurityscanner.v1beta.Xss + * @instance + * @returns {Object.} JSON object + */ + Xss.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Xss + * @function getTypeUrl + * @memberof google.cloud.websecurityscanner.v1beta.Xss + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Xss.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.websecurityscanner.v1beta.Xss"; + }; + + return Xss; + })(); + + v1beta.FindingTypeStats = (function() { + + /** + * Properties of a FindingTypeStats. + * @memberof google.cloud.websecurityscanner.v1beta + * @interface IFindingTypeStats + * @property {string|null} [findingType] FindingTypeStats findingType + * @property {number|null} [findingCount] FindingTypeStats findingCount + */ + + /** + * Constructs a new FindingTypeStats. + * @memberof google.cloud.websecurityscanner.v1beta + * @classdesc Represents a FindingTypeStats. + * @implements IFindingTypeStats + * @constructor + * @param {google.cloud.websecurityscanner.v1beta.IFindingTypeStats=} [properties] Properties to set + */ + function FindingTypeStats(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * FindingTypeStats findingType. + * @member {string} findingType + * @memberof google.cloud.websecurityscanner.v1beta.FindingTypeStats + * @instance + */ + FindingTypeStats.prototype.findingType = ""; + + /** + * FindingTypeStats findingCount. + * @member {number} findingCount + * @memberof google.cloud.websecurityscanner.v1beta.FindingTypeStats + * @instance + */ + FindingTypeStats.prototype.findingCount = 0; + + /** + * Creates a new FindingTypeStats instance using the specified properties. + * @function create + * @memberof google.cloud.websecurityscanner.v1beta.FindingTypeStats + * @static + * @param {google.cloud.websecurityscanner.v1beta.IFindingTypeStats=} [properties] Properties to set + * @returns {google.cloud.websecurityscanner.v1beta.FindingTypeStats} FindingTypeStats instance + */ + FindingTypeStats.create = function create(properties) { + return new FindingTypeStats(properties); + }; + + /** + * Encodes the specified FindingTypeStats message. Does not implicitly {@link google.cloud.websecurityscanner.v1beta.FindingTypeStats.verify|verify} messages. + * @function encode + * @memberof google.cloud.websecurityscanner.v1beta.FindingTypeStats + * @static + * @param {google.cloud.websecurityscanner.v1beta.IFindingTypeStats} message FindingTypeStats message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FindingTypeStats.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.findingType != null && Object.hasOwnProperty.call(message, "findingType")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.findingType); + if (message.findingCount != null && Object.hasOwnProperty.call(message, "findingCount")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.findingCount); + return writer; + }; + + /** + * Encodes the specified FindingTypeStats message, length delimited. Does not implicitly {@link google.cloud.websecurityscanner.v1beta.FindingTypeStats.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.websecurityscanner.v1beta.FindingTypeStats + * @static + * @param {google.cloud.websecurityscanner.v1beta.IFindingTypeStats} message FindingTypeStats message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FindingTypeStats.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a FindingTypeStats message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.websecurityscanner.v1beta.FindingTypeStats + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.websecurityscanner.v1beta.FindingTypeStats} FindingTypeStats + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FindingTypeStats.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.websecurityscanner.v1beta.FindingTypeStats(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.findingType = reader.string(); + break; + } + case 2: { + message.findingCount = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a FindingTypeStats message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.websecurityscanner.v1beta.FindingTypeStats + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.websecurityscanner.v1beta.FindingTypeStats} FindingTypeStats + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FindingTypeStats.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a FindingTypeStats message. + * @function verify + * @memberof google.cloud.websecurityscanner.v1beta.FindingTypeStats + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + FindingTypeStats.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.findingType != null && message.hasOwnProperty("findingType")) + if (!$util.isString(message.findingType)) + return "findingType: string expected"; + if (message.findingCount != null && message.hasOwnProperty("findingCount")) + if (!$util.isInteger(message.findingCount)) + return "findingCount: integer expected"; + return null; + }; + + /** + * Creates a FindingTypeStats message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.websecurityscanner.v1beta.FindingTypeStats + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.websecurityscanner.v1beta.FindingTypeStats} FindingTypeStats + */ + FindingTypeStats.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.websecurityscanner.v1beta.FindingTypeStats) + return object; + var message = new $root.google.cloud.websecurityscanner.v1beta.FindingTypeStats(); + if (object.findingType != null) + message.findingType = String(object.findingType); + if (object.findingCount != null) + message.findingCount = object.findingCount | 0; + return message; + }; + + /** + * Creates a plain object from a FindingTypeStats message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.websecurityscanner.v1beta.FindingTypeStats + * @static + * @param {google.cloud.websecurityscanner.v1beta.FindingTypeStats} message FindingTypeStats + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + FindingTypeStats.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.findingType = ""; + object.findingCount = 0; + } + if (message.findingType != null && message.hasOwnProperty("findingType")) + object.findingType = message.findingType; + if (message.findingCount != null && message.hasOwnProperty("findingCount")) + object.findingCount = message.findingCount; + return object; + }; + + /** + * Converts this FindingTypeStats to JSON. + * @function toJSON + * @memberof google.cloud.websecurityscanner.v1beta.FindingTypeStats + * @instance + * @returns {Object.} JSON object + */ + FindingTypeStats.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for FindingTypeStats + * @function getTypeUrl + * @memberof google.cloud.websecurityscanner.v1beta.FindingTypeStats + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FindingTypeStats.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.websecurityscanner.v1beta.FindingTypeStats"; + }; + + return FindingTypeStats; + })(); + + v1beta.ScanConfig = (function() { + + /** + * Properties of a ScanConfig. + * @memberof google.cloud.websecurityscanner.v1beta + * @interface IScanConfig + * @property {string|null} [name] ScanConfig name + * @property {string|null} [displayName] ScanConfig displayName + * @property {number|null} [maxQps] ScanConfig maxQps + * @property {Array.|null} [startingUrls] ScanConfig startingUrls + * @property {google.cloud.websecurityscanner.v1beta.ScanConfig.IAuthentication|null} [authentication] ScanConfig authentication + * @property {google.cloud.websecurityscanner.v1beta.ScanConfig.UserAgent|null} [userAgent] ScanConfig userAgent + * @property {Array.|null} [blacklistPatterns] ScanConfig blacklistPatterns + * @property {google.cloud.websecurityscanner.v1beta.ScanConfig.ISchedule|null} [schedule] ScanConfig schedule + * @property {Array.|null} [targetPlatforms] ScanConfig targetPlatforms + * @property {google.cloud.websecurityscanner.v1beta.ScanConfig.ExportToSecurityCommandCenter|null} [exportToSecurityCommandCenter] ScanConfig exportToSecurityCommandCenter + * @property {google.cloud.websecurityscanner.v1beta.IScanRun|null} [latestRun] ScanConfig latestRun + * @property {google.cloud.websecurityscanner.v1beta.ScanConfig.RiskLevel|null} [riskLevel] ScanConfig riskLevel + */ + + /** + * Constructs a new ScanConfig. + * @memberof google.cloud.websecurityscanner.v1beta + * @classdesc Represents a ScanConfig. + * @implements IScanConfig + * @constructor + * @param {google.cloud.websecurityscanner.v1beta.IScanConfig=} [properties] Properties to set + */ + function ScanConfig(properties) { + this.startingUrls = []; + this.blacklistPatterns = []; + this.targetPlatforms = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ScanConfig name. + * @member {string} name + * @memberof google.cloud.websecurityscanner.v1beta.ScanConfig + * @instance + */ + ScanConfig.prototype.name = ""; + + /** + * ScanConfig displayName. + * @member {string} displayName + * @memberof google.cloud.websecurityscanner.v1beta.ScanConfig + * @instance + */ + ScanConfig.prototype.displayName = ""; + + /** + * ScanConfig maxQps. + * @member {number} maxQps + * @memberof google.cloud.websecurityscanner.v1beta.ScanConfig + * @instance + */ + ScanConfig.prototype.maxQps = 0; + + /** + * ScanConfig startingUrls. + * @member {Array.} startingUrls + * @memberof google.cloud.websecurityscanner.v1beta.ScanConfig + * @instance + */ + ScanConfig.prototype.startingUrls = $util.emptyArray; + + /** + * ScanConfig authentication. + * @member {google.cloud.websecurityscanner.v1beta.ScanConfig.IAuthentication|null|undefined} authentication + * @memberof google.cloud.websecurityscanner.v1beta.ScanConfig + * @instance + */ + ScanConfig.prototype.authentication = null; + + /** + * ScanConfig userAgent. + * @member {google.cloud.websecurityscanner.v1beta.ScanConfig.UserAgent} userAgent + * @memberof google.cloud.websecurityscanner.v1beta.ScanConfig + * @instance + */ + ScanConfig.prototype.userAgent = 0; + + /** + * ScanConfig blacklistPatterns. + * @member {Array.} blacklistPatterns + * @memberof google.cloud.websecurityscanner.v1beta.ScanConfig + * @instance + */ + ScanConfig.prototype.blacklistPatterns = $util.emptyArray; + + /** + * ScanConfig schedule. + * @member {google.cloud.websecurityscanner.v1beta.ScanConfig.ISchedule|null|undefined} schedule + * @memberof google.cloud.websecurityscanner.v1beta.ScanConfig + * @instance + */ + ScanConfig.prototype.schedule = null; + + /** + * ScanConfig targetPlatforms. + * @member {Array.} targetPlatforms + * @memberof google.cloud.websecurityscanner.v1beta.ScanConfig + * @instance + */ + ScanConfig.prototype.targetPlatforms = $util.emptyArray; + + /** + * ScanConfig exportToSecurityCommandCenter. + * @member {google.cloud.websecurityscanner.v1beta.ScanConfig.ExportToSecurityCommandCenter} exportToSecurityCommandCenter + * @memberof google.cloud.websecurityscanner.v1beta.ScanConfig + * @instance + */ + ScanConfig.prototype.exportToSecurityCommandCenter = 0; + + /** + * ScanConfig latestRun. + * @member {google.cloud.websecurityscanner.v1beta.IScanRun|null|undefined} latestRun + * @memberof google.cloud.websecurityscanner.v1beta.ScanConfig + * @instance + */ + ScanConfig.prototype.latestRun = null; + + /** + * ScanConfig riskLevel. + * @member {google.cloud.websecurityscanner.v1beta.ScanConfig.RiskLevel} riskLevel + * @memberof google.cloud.websecurityscanner.v1beta.ScanConfig + * @instance + */ + ScanConfig.prototype.riskLevel = 0; + + /** + * Creates a new ScanConfig instance using the specified properties. + * @function create + * @memberof google.cloud.websecurityscanner.v1beta.ScanConfig + * @static + * @param {google.cloud.websecurityscanner.v1beta.IScanConfig=} [properties] Properties to set + * @returns {google.cloud.websecurityscanner.v1beta.ScanConfig} ScanConfig instance + */ + ScanConfig.create = function create(properties) { + return new ScanConfig(properties); + }; + + /** + * Encodes the specified ScanConfig message. Does not implicitly {@link google.cloud.websecurityscanner.v1beta.ScanConfig.verify|verify} messages. + * @function encode + * @memberof google.cloud.websecurityscanner.v1beta.ScanConfig + * @static + * @param {google.cloud.websecurityscanner.v1beta.IScanConfig} message ScanConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ScanConfig.encode = function encode(message, writer) { + if (!writer) + 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.maxQps != null && Object.hasOwnProperty.call(message, "maxQps")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.maxQps); + if (message.startingUrls != null && message.startingUrls.length) + for (var i = 0; i < message.startingUrls.length; ++i) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.startingUrls[i]); + if (message.authentication != null && Object.hasOwnProperty.call(message, "authentication")) + $root.google.cloud.websecurityscanner.v1beta.ScanConfig.Authentication.encode(message.authentication, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.userAgent != null && Object.hasOwnProperty.call(message, "userAgent")) + writer.uint32(/* id 6, wireType 0 =*/48).int32(message.userAgent); + if (message.blacklistPatterns != null && message.blacklistPatterns.length) + for (var i = 0; i < message.blacklistPatterns.length; ++i) + writer.uint32(/* id 7, wireType 2 =*/58).string(message.blacklistPatterns[i]); + if (message.schedule != null && Object.hasOwnProperty.call(message, "schedule")) + $root.google.cloud.websecurityscanner.v1beta.ScanConfig.Schedule.encode(message.schedule, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); + if (message.targetPlatforms != null && message.targetPlatforms.length) { + writer.uint32(/* id 9, wireType 2 =*/74).fork(); + for (var i = 0; i < message.targetPlatforms.length; ++i) + writer.int32(message.targetPlatforms[i]); + writer.ldelim(); + } + if (message.exportToSecurityCommandCenter != null && Object.hasOwnProperty.call(message, "exportToSecurityCommandCenter")) + writer.uint32(/* id 10, wireType 0 =*/80).int32(message.exportToSecurityCommandCenter); + if (message.latestRun != null && Object.hasOwnProperty.call(message, "latestRun")) + $root.google.cloud.websecurityscanner.v1beta.ScanRun.encode(message.latestRun, writer.uint32(/* id 11, wireType 2 =*/90).fork()).ldelim(); + if (message.riskLevel != null && Object.hasOwnProperty.call(message, "riskLevel")) + writer.uint32(/* id 12, wireType 0 =*/96).int32(message.riskLevel); + return writer; + }; + + /** + * Encodes the specified ScanConfig message, length delimited. Does not implicitly {@link google.cloud.websecurityscanner.v1beta.ScanConfig.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.websecurityscanner.v1beta.ScanConfig + * @static + * @param {google.cloud.websecurityscanner.v1beta.IScanConfig} message ScanConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ScanConfig.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ScanConfig message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.websecurityscanner.v1beta.ScanConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.websecurityscanner.v1beta.ScanConfig} ScanConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ScanConfig.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.websecurityscanner.v1beta.ScanConfig(); + 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.maxQps = reader.int32(); + break; + } + case 4: { + if (!(message.startingUrls && message.startingUrls.length)) + message.startingUrls = []; + message.startingUrls.push(reader.string()); + break; + } + case 5: { + message.authentication = $root.google.cloud.websecurityscanner.v1beta.ScanConfig.Authentication.decode(reader, reader.uint32()); + break; + } + case 6: { + message.userAgent = reader.int32(); + break; + } + case 7: { + if (!(message.blacklistPatterns && message.blacklistPatterns.length)) + message.blacklistPatterns = []; + message.blacklistPatterns.push(reader.string()); + break; + } + case 8: { + message.schedule = $root.google.cloud.websecurityscanner.v1beta.ScanConfig.Schedule.decode(reader, reader.uint32()); + break; + } + case 9: { + if (!(message.targetPlatforms && message.targetPlatforms.length)) + message.targetPlatforms = []; + if ((tag & 7) === 2) { + var end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) + message.targetPlatforms.push(reader.int32()); + } else + message.targetPlatforms.push(reader.int32()); + break; + } + case 10: { + message.exportToSecurityCommandCenter = reader.int32(); + break; + } + case 11: { + message.latestRun = $root.google.cloud.websecurityscanner.v1beta.ScanRun.decode(reader, reader.uint32()); + break; + } + case 12: { + message.riskLevel = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ScanConfig message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.websecurityscanner.v1beta.ScanConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.websecurityscanner.v1beta.ScanConfig} ScanConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ScanConfig.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ScanConfig message. + * @function verify + * @memberof google.cloud.websecurityscanner.v1beta.ScanConfig + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ScanConfig.verify = function verify(message) { + if (typeof message !== "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.maxQps != null && message.hasOwnProperty("maxQps")) + if (!$util.isInteger(message.maxQps)) + return "maxQps: integer expected"; + if (message.startingUrls != null && message.hasOwnProperty("startingUrls")) { + if (!Array.isArray(message.startingUrls)) + return "startingUrls: array expected"; + for (var i = 0; i < message.startingUrls.length; ++i) + if (!$util.isString(message.startingUrls[i])) + return "startingUrls: string[] expected"; + } + if (message.authentication != null && message.hasOwnProperty("authentication")) { + var error = $root.google.cloud.websecurityscanner.v1beta.ScanConfig.Authentication.verify(message.authentication); + if (error) + return "authentication." + error; + } + if (message.userAgent != null && message.hasOwnProperty("userAgent")) + switch (message.userAgent) { + default: + return "userAgent: enum value expected"; + case 0: + case 1: + case 2: + case 3: + break; + } + if (message.blacklistPatterns != null && message.hasOwnProperty("blacklistPatterns")) { + if (!Array.isArray(message.blacklistPatterns)) + return "blacklistPatterns: array expected"; + for (var i = 0; i < message.blacklistPatterns.length; ++i) + if (!$util.isString(message.blacklistPatterns[i])) + return "blacklistPatterns: string[] expected"; + } + if (message.schedule != null && message.hasOwnProperty("schedule")) { + var error = $root.google.cloud.websecurityscanner.v1beta.ScanConfig.Schedule.verify(message.schedule); + if (error) + return "schedule." + error; + } + if (message.targetPlatforms != null && message.hasOwnProperty("targetPlatforms")) { + if (!Array.isArray(message.targetPlatforms)) + return "targetPlatforms: array expected"; + for (var i = 0; i < message.targetPlatforms.length; ++i) + switch (message.targetPlatforms[i]) { + default: + return "targetPlatforms: enum value[] expected"; + case 0: + case 1: + case 2: + break; + } + } + if (message.exportToSecurityCommandCenter != null && message.hasOwnProperty("exportToSecurityCommandCenter")) + switch (message.exportToSecurityCommandCenter) { + default: + return "exportToSecurityCommandCenter: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.latestRun != null && message.hasOwnProperty("latestRun")) { + var error = $root.google.cloud.websecurityscanner.v1beta.ScanRun.verify(message.latestRun); + if (error) + return "latestRun." + error; + } + if (message.riskLevel != null && message.hasOwnProperty("riskLevel")) + switch (message.riskLevel) { + default: + return "riskLevel: enum value expected"; + case 0: + case 1: + case 2: + break; + } + return null; + }; + + /** + * Creates a ScanConfig message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.websecurityscanner.v1beta.ScanConfig + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.websecurityscanner.v1beta.ScanConfig} ScanConfig + */ + ScanConfig.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.websecurityscanner.v1beta.ScanConfig) + return object; + var message = new $root.google.cloud.websecurityscanner.v1beta.ScanConfig(); + if (object.name != null) + message.name = String(object.name); + if (object.displayName != null) + message.displayName = String(object.displayName); + if (object.maxQps != null) + message.maxQps = object.maxQps | 0; + if (object.startingUrls) { + if (!Array.isArray(object.startingUrls)) + throw TypeError(".google.cloud.websecurityscanner.v1beta.ScanConfig.startingUrls: array expected"); + message.startingUrls = []; + for (var i = 0; i < object.startingUrls.length; ++i) + message.startingUrls[i] = String(object.startingUrls[i]); + } + if (object.authentication != null) { + if (typeof object.authentication !== "object") + throw TypeError(".google.cloud.websecurityscanner.v1beta.ScanConfig.authentication: object expected"); + message.authentication = $root.google.cloud.websecurityscanner.v1beta.ScanConfig.Authentication.fromObject(object.authentication); + } + switch (object.userAgent) { + default: + if (typeof object.userAgent === "number") { + message.userAgent = object.userAgent; + break; + } + break; + case "USER_AGENT_UNSPECIFIED": + case 0: + message.userAgent = 0; + break; + case "CHROME_LINUX": + case 1: + message.userAgent = 1; + break; + case "CHROME_ANDROID": + case 2: + message.userAgent = 2; + break; + case "SAFARI_IPHONE": + case 3: + message.userAgent = 3; + break; + } + if (object.blacklistPatterns) { + if (!Array.isArray(object.blacklistPatterns)) + throw TypeError(".google.cloud.websecurityscanner.v1beta.ScanConfig.blacklistPatterns: array expected"); + message.blacklistPatterns = []; + for (var i = 0; i < object.blacklistPatterns.length; ++i) + message.blacklistPatterns[i] = String(object.blacklistPatterns[i]); + } + if (object.schedule != null) { + if (typeof object.schedule !== "object") + throw TypeError(".google.cloud.websecurityscanner.v1beta.ScanConfig.schedule: object expected"); + message.schedule = $root.google.cloud.websecurityscanner.v1beta.ScanConfig.Schedule.fromObject(object.schedule); + } + if (object.targetPlatforms) { + if (!Array.isArray(object.targetPlatforms)) + throw TypeError(".google.cloud.websecurityscanner.v1beta.ScanConfig.targetPlatforms: array expected"); + message.targetPlatforms = []; + for (var i = 0; i < object.targetPlatforms.length; ++i) + switch (object.targetPlatforms[i]) { + default: + if (typeof object.targetPlatforms[i] === "number") { + message.targetPlatforms[i] = object.targetPlatforms[i]; + break; + } + case "TARGET_PLATFORM_UNSPECIFIED": + case 0: + message.targetPlatforms[i] = 0; + break; + case "APP_ENGINE": + case 1: + message.targetPlatforms[i] = 1; + break; + case "COMPUTE": + case 2: + message.targetPlatforms[i] = 2; + break; + } + } + switch (object.exportToSecurityCommandCenter) { + default: + if (typeof object.exportToSecurityCommandCenter === "number") { + message.exportToSecurityCommandCenter = object.exportToSecurityCommandCenter; + break; + } + break; + case "EXPORT_TO_SECURITY_COMMAND_CENTER_UNSPECIFIED": + case 0: + message.exportToSecurityCommandCenter = 0; + break; + case "ENABLED": + case 1: + message.exportToSecurityCommandCenter = 1; + break; + case "DISABLED": + case 2: + message.exportToSecurityCommandCenter = 2; + break; + } + if (object.latestRun != null) { + if (typeof object.latestRun !== "object") + throw TypeError(".google.cloud.websecurityscanner.v1beta.ScanConfig.latestRun: object expected"); + message.latestRun = $root.google.cloud.websecurityscanner.v1beta.ScanRun.fromObject(object.latestRun); + } + switch (object.riskLevel) { + default: + if (typeof object.riskLevel === "number") { + message.riskLevel = object.riskLevel; + break; + } + break; + case "RISK_LEVEL_UNSPECIFIED": + case 0: + message.riskLevel = 0; + break; + case "NORMAL": + case 1: + message.riskLevel = 1; + break; + case "LOW": + case 2: + message.riskLevel = 2; + break; + } + return message; + }; + + /** + * Creates a plain object from a ScanConfig message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.websecurityscanner.v1beta.ScanConfig + * @static + * @param {google.cloud.websecurityscanner.v1beta.ScanConfig} message ScanConfig + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ScanConfig.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.startingUrls = []; + object.blacklistPatterns = []; + object.targetPlatforms = []; + } + if (options.defaults) { + object.name = ""; + object.displayName = ""; + object.maxQps = 0; + object.authentication = null; + object.userAgent = options.enums === String ? "USER_AGENT_UNSPECIFIED" : 0; + object.schedule = null; + object.exportToSecurityCommandCenter = options.enums === String ? "EXPORT_TO_SECURITY_COMMAND_CENTER_UNSPECIFIED" : 0; + object.latestRun = null; + object.riskLevel = options.enums === String ? "RISK_LEVEL_UNSPECIFIED" : 0; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.displayName != null && message.hasOwnProperty("displayName")) + object.displayName = message.displayName; + if (message.maxQps != null && message.hasOwnProperty("maxQps")) + object.maxQps = message.maxQps; + if (message.startingUrls && message.startingUrls.length) { + object.startingUrls = []; + for (var j = 0; j < message.startingUrls.length; ++j) + object.startingUrls[j] = message.startingUrls[j]; + } + if (message.authentication != null && message.hasOwnProperty("authentication")) + object.authentication = $root.google.cloud.websecurityscanner.v1beta.ScanConfig.Authentication.toObject(message.authentication, options); + if (message.userAgent != null && message.hasOwnProperty("userAgent")) + object.userAgent = options.enums === String ? $root.google.cloud.websecurityscanner.v1beta.ScanConfig.UserAgent[message.userAgent] === undefined ? message.userAgent : $root.google.cloud.websecurityscanner.v1beta.ScanConfig.UserAgent[message.userAgent] : message.userAgent; + if (message.blacklistPatterns && message.blacklistPatterns.length) { + object.blacklistPatterns = []; + for (var j = 0; j < message.blacklistPatterns.length; ++j) + object.blacklistPatterns[j] = message.blacklistPatterns[j]; + } + if (message.schedule != null && message.hasOwnProperty("schedule")) + object.schedule = $root.google.cloud.websecurityscanner.v1beta.ScanConfig.Schedule.toObject(message.schedule, options); + if (message.targetPlatforms && message.targetPlatforms.length) { + object.targetPlatforms = []; + for (var j = 0; j < message.targetPlatforms.length; ++j) + object.targetPlatforms[j] = options.enums === String ? $root.google.cloud.websecurityscanner.v1beta.ScanConfig.TargetPlatform[message.targetPlatforms[j]] === undefined ? message.targetPlatforms[j] : $root.google.cloud.websecurityscanner.v1beta.ScanConfig.TargetPlatform[message.targetPlatforms[j]] : message.targetPlatforms[j]; + } + if (message.exportToSecurityCommandCenter != null && message.hasOwnProperty("exportToSecurityCommandCenter")) + object.exportToSecurityCommandCenter = options.enums === String ? $root.google.cloud.websecurityscanner.v1beta.ScanConfig.ExportToSecurityCommandCenter[message.exportToSecurityCommandCenter] === undefined ? message.exportToSecurityCommandCenter : $root.google.cloud.websecurityscanner.v1beta.ScanConfig.ExportToSecurityCommandCenter[message.exportToSecurityCommandCenter] : message.exportToSecurityCommandCenter; + if (message.latestRun != null && message.hasOwnProperty("latestRun")) + object.latestRun = $root.google.cloud.websecurityscanner.v1beta.ScanRun.toObject(message.latestRun, options); + if (message.riskLevel != null && message.hasOwnProperty("riskLevel")) + object.riskLevel = options.enums === String ? $root.google.cloud.websecurityscanner.v1beta.ScanConfig.RiskLevel[message.riskLevel] === undefined ? message.riskLevel : $root.google.cloud.websecurityscanner.v1beta.ScanConfig.RiskLevel[message.riskLevel] : message.riskLevel; + return object; + }; + + /** + * Converts this ScanConfig to JSON. + * @function toJSON + * @memberof google.cloud.websecurityscanner.v1beta.ScanConfig + * @instance + * @returns {Object.} JSON object + */ + ScanConfig.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ScanConfig + * @function getTypeUrl + * @memberof google.cloud.websecurityscanner.v1beta.ScanConfig + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ScanConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.websecurityscanner.v1beta.ScanConfig"; + }; + + ScanConfig.Authentication = (function() { + + /** + * Properties of an Authentication. + * @memberof google.cloud.websecurityscanner.v1beta.ScanConfig + * @interface IAuthentication + * @property {google.cloud.websecurityscanner.v1beta.ScanConfig.Authentication.IGoogleAccount|null} [googleAccount] Authentication googleAccount + * @property {google.cloud.websecurityscanner.v1beta.ScanConfig.Authentication.ICustomAccount|null} [customAccount] Authentication customAccount + */ + + /** + * Constructs a new Authentication. + * @memberof google.cloud.websecurityscanner.v1beta.ScanConfig + * @classdesc Represents an Authentication. + * @implements IAuthentication + * @constructor + * @param {google.cloud.websecurityscanner.v1beta.ScanConfig.IAuthentication=} [properties] Properties to set + */ + function Authentication(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Authentication googleAccount. + * @member {google.cloud.websecurityscanner.v1beta.ScanConfig.Authentication.IGoogleAccount|null|undefined} googleAccount + * @memberof google.cloud.websecurityscanner.v1beta.ScanConfig.Authentication + * @instance + */ + Authentication.prototype.googleAccount = null; + + /** + * Authentication customAccount. + * @member {google.cloud.websecurityscanner.v1beta.ScanConfig.Authentication.ICustomAccount|null|undefined} customAccount + * @memberof google.cloud.websecurityscanner.v1beta.ScanConfig.Authentication + * @instance + */ + Authentication.prototype.customAccount = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * Authentication authentication. + * @member {"googleAccount"|"customAccount"|undefined} authentication + * @memberof google.cloud.websecurityscanner.v1beta.ScanConfig.Authentication + * @instance + */ + Object.defineProperty(Authentication.prototype, "authentication", { + get: $util.oneOfGetter($oneOfFields = ["googleAccount", "customAccount"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new Authentication instance using the specified properties. + * @function create + * @memberof google.cloud.websecurityscanner.v1beta.ScanConfig.Authentication + * @static + * @param {google.cloud.websecurityscanner.v1beta.ScanConfig.IAuthentication=} [properties] Properties to set + * @returns {google.cloud.websecurityscanner.v1beta.ScanConfig.Authentication} Authentication instance + */ + Authentication.create = function create(properties) { + return new Authentication(properties); + }; + + /** + * Encodes the specified Authentication message. Does not implicitly {@link google.cloud.websecurityscanner.v1beta.ScanConfig.Authentication.verify|verify} messages. + * @function encode + * @memberof google.cloud.websecurityscanner.v1beta.ScanConfig.Authentication + * @static + * @param {google.cloud.websecurityscanner.v1beta.ScanConfig.IAuthentication} message Authentication message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Authentication.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.googleAccount != null && Object.hasOwnProperty.call(message, "googleAccount")) + $root.google.cloud.websecurityscanner.v1beta.ScanConfig.Authentication.GoogleAccount.encode(message.googleAccount, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.customAccount != null && Object.hasOwnProperty.call(message, "customAccount")) + $root.google.cloud.websecurityscanner.v1beta.ScanConfig.Authentication.CustomAccount.encode(message.customAccount, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified Authentication message, length delimited. Does not implicitly {@link google.cloud.websecurityscanner.v1beta.ScanConfig.Authentication.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.websecurityscanner.v1beta.ScanConfig.Authentication + * @static + * @param {google.cloud.websecurityscanner.v1beta.ScanConfig.IAuthentication} message Authentication message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Authentication.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an Authentication message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.websecurityscanner.v1beta.ScanConfig.Authentication + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.websecurityscanner.v1beta.ScanConfig.Authentication} Authentication + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Authentication.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.websecurityscanner.v1beta.ScanConfig.Authentication(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.googleAccount = $root.google.cloud.websecurityscanner.v1beta.ScanConfig.Authentication.GoogleAccount.decode(reader, reader.uint32()); + break; + } + case 2: { + message.customAccount = $root.google.cloud.websecurityscanner.v1beta.ScanConfig.Authentication.CustomAccount.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an Authentication message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.websecurityscanner.v1beta.ScanConfig.Authentication + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.websecurityscanner.v1beta.ScanConfig.Authentication} Authentication + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Authentication.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an Authentication message. + * @function verify + * @memberof google.cloud.websecurityscanner.v1beta.ScanConfig.Authentication + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Authentication.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.googleAccount != null && message.hasOwnProperty("googleAccount")) { + properties.authentication = 1; + { + var error = $root.google.cloud.websecurityscanner.v1beta.ScanConfig.Authentication.GoogleAccount.verify(message.googleAccount); + if (error) + return "googleAccount." + error; + } + } + if (message.customAccount != null && message.hasOwnProperty("customAccount")) { + if (properties.authentication === 1) + return "authentication: multiple values"; + properties.authentication = 1; + { + var error = $root.google.cloud.websecurityscanner.v1beta.ScanConfig.Authentication.CustomAccount.verify(message.customAccount); + if (error) + return "customAccount." + error; + } + } + return null; + }; + + /** + * Creates an Authentication message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.websecurityscanner.v1beta.ScanConfig.Authentication + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.websecurityscanner.v1beta.ScanConfig.Authentication} Authentication + */ + Authentication.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.websecurityscanner.v1beta.ScanConfig.Authentication) + return object; + var message = new $root.google.cloud.websecurityscanner.v1beta.ScanConfig.Authentication(); + if (object.googleAccount != null) { + if (typeof object.googleAccount !== "object") + throw TypeError(".google.cloud.websecurityscanner.v1beta.ScanConfig.Authentication.googleAccount: object expected"); + message.googleAccount = $root.google.cloud.websecurityscanner.v1beta.ScanConfig.Authentication.GoogleAccount.fromObject(object.googleAccount); + } + if (object.customAccount != null) { + if (typeof object.customAccount !== "object") + throw TypeError(".google.cloud.websecurityscanner.v1beta.ScanConfig.Authentication.customAccount: object expected"); + message.customAccount = $root.google.cloud.websecurityscanner.v1beta.ScanConfig.Authentication.CustomAccount.fromObject(object.customAccount); + } + return message; + }; + + /** + * Creates a plain object from an Authentication message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.websecurityscanner.v1beta.ScanConfig.Authentication + * @static + * @param {google.cloud.websecurityscanner.v1beta.ScanConfig.Authentication} message Authentication + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Authentication.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.googleAccount != null && message.hasOwnProperty("googleAccount")) { + object.googleAccount = $root.google.cloud.websecurityscanner.v1beta.ScanConfig.Authentication.GoogleAccount.toObject(message.googleAccount, options); + if (options.oneofs) + object.authentication = "googleAccount"; + } + if (message.customAccount != null && message.hasOwnProperty("customAccount")) { + object.customAccount = $root.google.cloud.websecurityscanner.v1beta.ScanConfig.Authentication.CustomAccount.toObject(message.customAccount, options); + if (options.oneofs) + object.authentication = "customAccount"; + } + return object; + }; + + /** + * Converts this Authentication to JSON. + * @function toJSON + * @memberof google.cloud.websecurityscanner.v1beta.ScanConfig.Authentication + * @instance + * @returns {Object.} JSON object + */ + Authentication.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Authentication + * @function getTypeUrl + * @memberof google.cloud.websecurityscanner.v1beta.ScanConfig.Authentication + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Authentication.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.websecurityscanner.v1beta.ScanConfig.Authentication"; + }; + + Authentication.GoogleAccount = (function() { + + /** + * Properties of a GoogleAccount. + * @memberof google.cloud.websecurityscanner.v1beta.ScanConfig.Authentication + * @interface IGoogleAccount + * @property {string|null} [username] GoogleAccount username + * @property {string|null} [password] GoogleAccount password + */ + + /** + * Constructs a new GoogleAccount. + * @memberof google.cloud.websecurityscanner.v1beta.ScanConfig.Authentication + * @classdesc Represents a GoogleAccount. + * @implements IGoogleAccount + * @constructor + * @param {google.cloud.websecurityscanner.v1beta.ScanConfig.Authentication.IGoogleAccount=} [properties] Properties to set + */ + function GoogleAccount(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GoogleAccount username. + * @member {string} username + * @memberof google.cloud.websecurityscanner.v1beta.ScanConfig.Authentication.GoogleAccount + * @instance + */ + GoogleAccount.prototype.username = ""; + + /** + * GoogleAccount password. + * @member {string} password + * @memberof google.cloud.websecurityscanner.v1beta.ScanConfig.Authentication.GoogleAccount + * @instance + */ + GoogleAccount.prototype.password = ""; + + /** + * Creates a new GoogleAccount instance using the specified properties. + * @function create + * @memberof google.cloud.websecurityscanner.v1beta.ScanConfig.Authentication.GoogleAccount + * @static + * @param {google.cloud.websecurityscanner.v1beta.ScanConfig.Authentication.IGoogleAccount=} [properties] Properties to set + * @returns {google.cloud.websecurityscanner.v1beta.ScanConfig.Authentication.GoogleAccount} GoogleAccount instance + */ + GoogleAccount.create = function create(properties) { + return new GoogleAccount(properties); + }; + + /** + * Encodes the specified GoogleAccount message. Does not implicitly {@link google.cloud.websecurityscanner.v1beta.ScanConfig.Authentication.GoogleAccount.verify|verify} messages. + * @function encode + * @memberof google.cloud.websecurityscanner.v1beta.ScanConfig.Authentication.GoogleAccount + * @static + * @param {google.cloud.websecurityscanner.v1beta.ScanConfig.Authentication.IGoogleAccount} message GoogleAccount message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GoogleAccount.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.username != null && Object.hasOwnProperty.call(message, "username")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.username); + if (message.password != null && Object.hasOwnProperty.call(message, "password")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.password); + return writer; + }; + + /** + * Encodes the specified GoogleAccount message, length delimited. Does not implicitly {@link google.cloud.websecurityscanner.v1beta.ScanConfig.Authentication.GoogleAccount.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.websecurityscanner.v1beta.ScanConfig.Authentication.GoogleAccount + * @static + * @param {google.cloud.websecurityscanner.v1beta.ScanConfig.Authentication.IGoogleAccount} message GoogleAccount message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GoogleAccount.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GoogleAccount message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.websecurityscanner.v1beta.ScanConfig.Authentication.GoogleAccount + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.websecurityscanner.v1beta.ScanConfig.Authentication.GoogleAccount} GoogleAccount + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GoogleAccount.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.websecurityscanner.v1beta.ScanConfig.Authentication.GoogleAccount(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.username = reader.string(); + break; + } + case 2: { + message.password = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GoogleAccount message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.websecurityscanner.v1beta.ScanConfig.Authentication.GoogleAccount + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.websecurityscanner.v1beta.ScanConfig.Authentication.GoogleAccount} GoogleAccount + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GoogleAccount.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GoogleAccount message. + * @function verify + * @memberof google.cloud.websecurityscanner.v1beta.ScanConfig.Authentication.GoogleAccount + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GoogleAccount.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.username != null && message.hasOwnProperty("username")) + if (!$util.isString(message.username)) + return "username: string expected"; + if (message.password != null && message.hasOwnProperty("password")) + if (!$util.isString(message.password)) + return "password: string expected"; + return null; + }; + + /** + * Creates a GoogleAccount message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.websecurityscanner.v1beta.ScanConfig.Authentication.GoogleAccount + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.websecurityscanner.v1beta.ScanConfig.Authentication.GoogleAccount} GoogleAccount + */ + GoogleAccount.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.websecurityscanner.v1beta.ScanConfig.Authentication.GoogleAccount) + return object; + var message = new $root.google.cloud.websecurityscanner.v1beta.ScanConfig.Authentication.GoogleAccount(); + if (object.username != null) + message.username = String(object.username); + if (object.password != null) + message.password = String(object.password); + return message; + }; + + /** + * Creates a plain object from a GoogleAccount message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.websecurityscanner.v1beta.ScanConfig.Authentication.GoogleAccount + * @static + * @param {google.cloud.websecurityscanner.v1beta.ScanConfig.Authentication.GoogleAccount} message GoogleAccount + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GoogleAccount.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.username = ""; + object.password = ""; + } + if (message.username != null && message.hasOwnProperty("username")) + object.username = message.username; + if (message.password != null && message.hasOwnProperty("password")) + object.password = message.password; + return object; + }; + + /** + * Converts this GoogleAccount to JSON. + * @function toJSON + * @memberof google.cloud.websecurityscanner.v1beta.ScanConfig.Authentication.GoogleAccount + * @instance + * @returns {Object.} JSON object + */ + GoogleAccount.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GoogleAccount + * @function getTypeUrl + * @memberof google.cloud.websecurityscanner.v1beta.ScanConfig.Authentication.GoogleAccount + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GoogleAccount.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.websecurityscanner.v1beta.ScanConfig.Authentication.GoogleAccount"; + }; + + return GoogleAccount; + })(); + + Authentication.CustomAccount = (function() { + + /** + * Properties of a CustomAccount. + * @memberof google.cloud.websecurityscanner.v1beta.ScanConfig.Authentication + * @interface ICustomAccount + * @property {string|null} [username] CustomAccount username + * @property {string|null} [password] CustomAccount password + * @property {string|null} [loginUrl] CustomAccount loginUrl + */ + + /** + * Constructs a new CustomAccount. + * @memberof google.cloud.websecurityscanner.v1beta.ScanConfig.Authentication + * @classdesc Represents a CustomAccount. + * @implements ICustomAccount + * @constructor + * @param {google.cloud.websecurityscanner.v1beta.ScanConfig.Authentication.ICustomAccount=} [properties] Properties to set + */ + function CustomAccount(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * CustomAccount username. + * @member {string} username + * @memberof google.cloud.websecurityscanner.v1beta.ScanConfig.Authentication.CustomAccount + * @instance + */ + CustomAccount.prototype.username = ""; + + /** + * CustomAccount password. + * @member {string} password + * @memberof google.cloud.websecurityscanner.v1beta.ScanConfig.Authentication.CustomAccount + * @instance + */ + CustomAccount.prototype.password = ""; + + /** + * CustomAccount loginUrl. + * @member {string} loginUrl + * @memberof google.cloud.websecurityscanner.v1beta.ScanConfig.Authentication.CustomAccount + * @instance + */ + CustomAccount.prototype.loginUrl = ""; + + /** + * Creates a new CustomAccount instance using the specified properties. + * @function create + * @memberof google.cloud.websecurityscanner.v1beta.ScanConfig.Authentication.CustomAccount + * @static + * @param {google.cloud.websecurityscanner.v1beta.ScanConfig.Authentication.ICustomAccount=} [properties] Properties to set + * @returns {google.cloud.websecurityscanner.v1beta.ScanConfig.Authentication.CustomAccount} CustomAccount instance + */ + CustomAccount.create = function create(properties) { + return new CustomAccount(properties); + }; + + /** + * Encodes the specified CustomAccount message. Does not implicitly {@link google.cloud.websecurityscanner.v1beta.ScanConfig.Authentication.CustomAccount.verify|verify} messages. + * @function encode + * @memberof google.cloud.websecurityscanner.v1beta.ScanConfig.Authentication.CustomAccount + * @static + * @param {google.cloud.websecurityscanner.v1beta.ScanConfig.Authentication.ICustomAccount} message CustomAccount message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CustomAccount.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.username != null && Object.hasOwnProperty.call(message, "username")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.username); + if (message.password != null && Object.hasOwnProperty.call(message, "password")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.password); + if (message.loginUrl != null && Object.hasOwnProperty.call(message, "loginUrl")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.loginUrl); + return writer; + }; + + /** + * Encodes the specified CustomAccount message, length delimited. Does not implicitly {@link google.cloud.websecurityscanner.v1beta.ScanConfig.Authentication.CustomAccount.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.websecurityscanner.v1beta.ScanConfig.Authentication.CustomAccount + * @static + * @param {google.cloud.websecurityscanner.v1beta.ScanConfig.Authentication.ICustomAccount} message CustomAccount message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CustomAccount.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CustomAccount message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.websecurityscanner.v1beta.ScanConfig.Authentication.CustomAccount + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.websecurityscanner.v1beta.ScanConfig.Authentication.CustomAccount} CustomAccount + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CustomAccount.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.websecurityscanner.v1beta.ScanConfig.Authentication.CustomAccount(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.username = reader.string(); + break; + } + case 2: { + message.password = reader.string(); + break; + } + case 3: { + message.loginUrl = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CustomAccount message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.websecurityscanner.v1beta.ScanConfig.Authentication.CustomAccount + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.websecurityscanner.v1beta.ScanConfig.Authentication.CustomAccount} CustomAccount + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CustomAccount.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CustomAccount message. + * @function verify + * @memberof google.cloud.websecurityscanner.v1beta.ScanConfig.Authentication.CustomAccount + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CustomAccount.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.username != null && message.hasOwnProperty("username")) + if (!$util.isString(message.username)) + return "username: string expected"; + if (message.password != null && message.hasOwnProperty("password")) + if (!$util.isString(message.password)) + return "password: string expected"; + if (message.loginUrl != null && message.hasOwnProperty("loginUrl")) + if (!$util.isString(message.loginUrl)) + return "loginUrl: string expected"; + return null; + }; + + /** + * Creates a CustomAccount message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.websecurityscanner.v1beta.ScanConfig.Authentication.CustomAccount + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.websecurityscanner.v1beta.ScanConfig.Authentication.CustomAccount} CustomAccount + */ + CustomAccount.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.websecurityscanner.v1beta.ScanConfig.Authentication.CustomAccount) + return object; + var message = new $root.google.cloud.websecurityscanner.v1beta.ScanConfig.Authentication.CustomAccount(); + if (object.username != null) + message.username = String(object.username); + if (object.password != null) + message.password = String(object.password); + if (object.loginUrl != null) + message.loginUrl = String(object.loginUrl); + return message; + }; + + /** + * Creates a plain object from a CustomAccount message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.websecurityscanner.v1beta.ScanConfig.Authentication.CustomAccount + * @static + * @param {google.cloud.websecurityscanner.v1beta.ScanConfig.Authentication.CustomAccount} message CustomAccount + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CustomAccount.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.username = ""; + object.password = ""; + object.loginUrl = ""; + } + if (message.username != null && message.hasOwnProperty("username")) + object.username = message.username; + if (message.password != null && message.hasOwnProperty("password")) + object.password = message.password; + if (message.loginUrl != null && message.hasOwnProperty("loginUrl")) + object.loginUrl = message.loginUrl; + return object; + }; + + /** + * Converts this CustomAccount to JSON. + * @function toJSON + * @memberof google.cloud.websecurityscanner.v1beta.ScanConfig.Authentication.CustomAccount + * @instance + * @returns {Object.} JSON object + */ + CustomAccount.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CustomAccount + * @function getTypeUrl + * @memberof google.cloud.websecurityscanner.v1beta.ScanConfig.Authentication.CustomAccount + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CustomAccount.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.websecurityscanner.v1beta.ScanConfig.Authentication.CustomAccount"; + }; + + return CustomAccount; + })(); + + return Authentication; + })(); + + ScanConfig.Schedule = (function() { + + /** + * Properties of a Schedule. + * @memberof google.cloud.websecurityscanner.v1beta.ScanConfig + * @interface ISchedule + * @property {google.protobuf.ITimestamp|null} [scheduleTime] Schedule scheduleTime + * @property {number|null} [intervalDurationDays] Schedule intervalDurationDays + */ + + /** + * Constructs a new Schedule. + * @memberof google.cloud.websecurityscanner.v1beta.ScanConfig + * @classdesc Represents a Schedule. + * @implements ISchedule + * @constructor + * @param {google.cloud.websecurityscanner.v1beta.ScanConfig.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]]; + } + + /** + * Schedule scheduleTime. + * @member {google.protobuf.ITimestamp|null|undefined} scheduleTime + * @memberof google.cloud.websecurityscanner.v1beta.ScanConfig.Schedule + * @instance + */ + Schedule.prototype.scheduleTime = null; + + /** + * Schedule intervalDurationDays. + * @member {number} intervalDurationDays + * @memberof google.cloud.websecurityscanner.v1beta.ScanConfig.Schedule + * @instance + */ + Schedule.prototype.intervalDurationDays = 0; + + /** + * Creates a new Schedule instance using the specified properties. + * @function create + * @memberof google.cloud.websecurityscanner.v1beta.ScanConfig.Schedule + * @static + * @param {google.cloud.websecurityscanner.v1beta.ScanConfig.ISchedule=} [properties] Properties to set + * @returns {google.cloud.websecurityscanner.v1beta.ScanConfig.Schedule} Schedule instance + */ + Schedule.create = function create(properties) { + return new Schedule(properties); + }; + + /** + * Encodes the specified Schedule message. Does not implicitly {@link google.cloud.websecurityscanner.v1beta.ScanConfig.Schedule.verify|verify} messages. + * @function encode + * @memberof google.cloud.websecurityscanner.v1beta.ScanConfig.Schedule + * @static + * @param {google.cloud.websecurityscanner.v1beta.ScanConfig.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.scheduleTime != null && Object.hasOwnProperty.call(message, "scheduleTime")) + $root.google.protobuf.Timestamp.encode(message.scheduleTime, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.intervalDurationDays != null && Object.hasOwnProperty.call(message, "intervalDurationDays")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.intervalDurationDays); + return writer; + }; + + /** + * Encodes the specified Schedule message, length delimited. Does not implicitly {@link google.cloud.websecurityscanner.v1beta.ScanConfig.Schedule.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.websecurityscanner.v1beta.ScanConfig.Schedule + * @static + * @param {google.cloud.websecurityscanner.v1beta.ScanConfig.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(); + }; + + /** + * Decodes a Schedule message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.websecurityscanner.v1beta.ScanConfig.Schedule + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.websecurityscanner.v1beta.ScanConfig.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.websecurityscanner.v1beta.ScanConfig.Schedule(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.scheduleTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 2: { + message.intervalDurationDays = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Schedule message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.websecurityscanner.v1beta.ScanConfig.Schedule + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.websecurityscanner.v1beta.ScanConfig.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()); + }; + + /** + * Verifies a Schedule message. + * @function verify + * @memberof google.cloud.websecurityscanner.v1beta.ScanConfig.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"; + if (message.scheduleTime != null && message.hasOwnProperty("scheduleTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.scheduleTime); + if (error) + return "scheduleTime." + error; + } + if (message.intervalDurationDays != null && message.hasOwnProperty("intervalDurationDays")) + if (!$util.isInteger(message.intervalDurationDays)) + return "intervalDurationDays: integer expected"; + return null; + }; + + /** + * Creates a Schedule message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.websecurityscanner.v1beta.ScanConfig.Schedule + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.websecurityscanner.v1beta.ScanConfig.Schedule} Schedule + */ + Schedule.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.websecurityscanner.v1beta.ScanConfig.Schedule) + return object; + var message = new $root.google.cloud.websecurityscanner.v1beta.ScanConfig.Schedule(); + if (object.scheduleTime != null) { + if (typeof object.scheduleTime !== "object") + throw TypeError(".google.cloud.websecurityscanner.v1beta.ScanConfig.Schedule.scheduleTime: object expected"); + message.scheduleTime = $root.google.protobuf.Timestamp.fromObject(object.scheduleTime); + } + if (object.intervalDurationDays != null) + message.intervalDurationDays = object.intervalDurationDays | 0; + return message; + }; + + /** + * Creates a plain object from a Schedule message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.websecurityscanner.v1beta.ScanConfig.Schedule + * @static + * @param {google.cloud.websecurityscanner.v1beta.ScanConfig.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.scheduleTime = null; + object.intervalDurationDays = 0; + } + if (message.scheduleTime != null && message.hasOwnProperty("scheduleTime")) + object.scheduleTime = $root.google.protobuf.Timestamp.toObject(message.scheduleTime, options); + if (message.intervalDurationDays != null && message.hasOwnProperty("intervalDurationDays")) + object.intervalDurationDays = message.intervalDurationDays; + return object; + }; + + /** + * Converts this Schedule to JSON. + * @function toJSON + * @memberof google.cloud.websecurityscanner.v1beta.ScanConfig.Schedule + * @instance + * @returns {Object.} JSON object + */ + Schedule.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Schedule + * @function getTypeUrl + * @memberof google.cloud.websecurityscanner.v1beta.ScanConfig.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.websecurityscanner.v1beta.ScanConfig.Schedule"; + }; + + return Schedule; + })(); + + /** + * UserAgent enum. + * @name google.cloud.websecurityscanner.v1beta.ScanConfig.UserAgent + * @enum {number} + * @property {number} USER_AGENT_UNSPECIFIED=0 USER_AGENT_UNSPECIFIED value + * @property {number} CHROME_LINUX=1 CHROME_LINUX value + * @property {number} CHROME_ANDROID=2 CHROME_ANDROID value + * @property {number} SAFARI_IPHONE=3 SAFARI_IPHONE value + */ + ScanConfig.UserAgent = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "USER_AGENT_UNSPECIFIED"] = 0; + values[valuesById[1] = "CHROME_LINUX"] = 1; + values[valuesById[2] = "CHROME_ANDROID"] = 2; + values[valuesById[3] = "SAFARI_IPHONE"] = 3; + return values; + })(); + + /** + * TargetPlatform enum. + * @name google.cloud.websecurityscanner.v1beta.ScanConfig.TargetPlatform + * @enum {number} + * @property {number} TARGET_PLATFORM_UNSPECIFIED=0 TARGET_PLATFORM_UNSPECIFIED value + * @property {number} APP_ENGINE=1 APP_ENGINE value + * @property {number} COMPUTE=2 COMPUTE value + */ + ScanConfig.TargetPlatform = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "TARGET_PLATFORM_UNSPECIFIED"] = 0; + values[valuesById[1] = "APP_ENGINE"] = 1; + values[valuesById[2] = "COMPUTE"] = 2; + return values; + })(); + + /** + * RiskLevel enum. + * @name google.cloud.websecurityscanner.v1beta.ScanConfig.RiskLevel + * @enum {number} + * @property {number} RISK_LEVEL_UNSPECIFIED=0 RISK_LEVEL_UNSPECIFIED value + * @property {number} NORMAL=1 NORMAL value + * @property {number} LOW=2 LOW value + */ + ScanConfig.RiskLevel = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "RISK_LEVEL_UNSPECIFIED"] = 0; + values[valuesById[1] = "NORMAL"] = 1; + values[valuesById[2] = "LOW"] = 2; + return values; + })(); + + /** + * ExportToSecurityCommandCenter enum. + * @name google.cloud.websecurityscanner.v1beta.ScanConfig.ExportToSecurityCommandCenter + * @enum {number} + * @property {number} EXPORT_TO_SECURITY_COMMAND_CENTER_UNSPECIFIED=0 EXPORT_TO_SECURITY_COMMAND_CENTER_UNSPECIFIED value + * @property {number} ENABLED=1 ENABLED value + * @property {number} DISABLED=2 DISABLED value + */ + ScanConfig.ExportToSecurityCommandCenter = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "EXPORT_TO_SECURITY_COMMAND_CENTER_UNSPECIFIED"] = 0; + values[valuesById[1] = "ENABLED"] = 1; + values[valuesById[2] = "DISABLED"] = 2; + return values; + })(); + + return ScanConfig; + })(); + + v1beta.ScanRun = (function() { + + /** + * Properties of a ScanRun. + * @memberof google.cloud.websecurityscanner.v1beta + * @interface IScanRun + * @property {string|null} [name] ScanRun name + * @property {google.cloud.websecurityscanner.v1beta.ScanRun.ExecutionState|null} [executionState] ScanRun executionState + * @property {google.cloud.websecurityscanner.v1beta.ScanRun.ResultState|null} [resultState] ScanRun resultState + * @property {google.protobuf.ITimestamp|null} [startTime] ScanRun startTime + * @property {google.protobuf.ITimestamp|null} [endTime] ScanRun endTime + * @property {number|Long|null} [urlsCrawledCount] ScanRun urlsCrawledCount + * @property {number|Long|null} [urlsTestedCount] ScanRun urlsTestedCount + * @property {boolean|null} [hasVulnerabilities] ScanRun hasVulnerabilities + * @property {number|null} [progressPercent] ScanRun progressPercent + * @property {google.cloud.websecurityscanner.v1beta.IScanRunErrorTrace|null} [errorTrace] ScanRun errorTrace + * @property {Array.|null} [warningTraces] ScanRun warningTraces + */ + + /** + * Constructs a new ScanRun. + * @memberof google.cloud.websecurityscanner.v1beta + * @classdesc Represents a ScanRun. + * @implements IScanRun + * @constructor + * @param {google.cloud.websecurityscanner.v1beta.IScanRun=} [properties] Properties to set + */ + function ScanRun(properties) { + this.warningTraces = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ScanRun name. + * @member {string} name + * @memberof google.cloud.websecurityscanner.v1beta.ScanRun + * @instance + */ + ScanRun.prototype.name = ""; + + /** + * ScanRun executionState. + * @member {google.cloud.websecurityscanner.v1beta.ScanRun.ExecutionState} executionState + * @memberof google.cloud.websecurityscanner.v1beta.ScanRun + * @instance + */ + ScanRun.prototype.executionState = 0; + + /** + * ScanRun resultState. + * @member {google.cloud.websecurityscanner.v1beta.ScanRun.ResultState} resultState + * @memberof google.cloud.websecurityscanner.v1beta.ScanRun + * @instance + */ + ScanRun.prototype.resultState = 0; + + /** + * ScanRun startTime. + * @member {google.protobuf.ITimestamp|null|undefined} startTime + * @memberof google.cloud.websecurityscanner.v1beta.ScanRun + * @instance + */ + ScanRun.prototype.startTime = null; + + /** + * ScanRun endTime. + * @member {google.protobuf.ITimestamp|null|undefined} endTime + * @memberof google.cloud.websecurityscanner.v1beta.ScanRun + * @instance + */ + ScanRun.prototype.endTime = null; + + /** + * ScanRun urlsCrawledCount. + * @member {number|Long} urlsCrawledCount + * @memberof google.cloud.websecurityscanner.v1beta.ScanRun + * @instance + */ + ScanRun.prototype.urlsCrawledCount = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * ScanRun urlsTestedCount. + * @member {number|Long} urlsTestedCount + * @memberof google.cloud.websecurityscanner.v1beta.ScanRun + * @instance + */ + ScanRun.prototype.urlsTestedCount = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * ScanRun hasVulnerabilities. + * @member {boolean} hasVulnerabilities + * @memberof google.cloud.websecurityscanner.v1beta.ScanRun + * @instance + */ + ScanRun.prototype.hasVulnerabilities = false; + + /** + * ScanRun progressPercent. + * @member {number} progressPercent + * @memberof google.cloud.websecurityscanner.v1beta.ScanRun + * @instance + */ + ScanRun.prototype.progressPercent = 0; + + /** + * ScanRun errorTrace. + * @member {google.cloud.websecurityscanner.v1beta.IScanRunErrorTrace|null|undefined} errorTrace + * @memberof google.cloud.websecurityscanner.v1beta.ScanRun + * @instance + */ + ScanRun.prototype.errorTrace = null; + + /** + * ScanRun warningTraces. + * @member {Array.} warningTraces + * @memberof google.cloud.websecurityscanner.v1beta.ScanRun + * @instance + */ + ScanRun.prototype.warningTraces = $util.emptyArray; + + /** + * Creates a new ScanRun instance using the specified properties. + * @function create + * @memberof google.cloud.websecurityscanner.v1beta.ScanRun + * @static + * @param {google.cloud.websecurityscanner.v1beta.IScanRun=} [properties] Properties to set + * @returns {google.cloud.websecurityscanner.v1beta.ScanRun} ScanRun instance + */ + ScanRun.create = function create(properties) { + return new ScanRun(properties); + }; + + /** + * Encodes the specified ScanRun message. Does not implicitly {@link google.cloud.websecurityscanner.v1beta.ScanRun.verify|verify} messages. + * @function encode + * @memberof google.cloud.websecurityscanner.v1beta.ScanRun + * @static + * @param {google.cloud.websecurityscanner.v1beta.IScanRun} message ScanRun message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ScanRun.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.executionState != null && Object.hasOwnProperty.call(message, "executionState")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.executionState); + if (message.resultState != null && Object.hasOwnProperty.call(message, "resultState")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.resultState); + if (message.startTime != null && Object.hasOwnProperty.call(message, "startTime")) + $root.google.protobuf.Timestamp.encode(message.startTime, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.endTime != null && Object.hasOwnProperty.call(message, "endTime")) + $root.google.protobuf.Timestamp.encode(message.endTime, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.urlsCrawledCount != null && Object.hasOwnProperty.call(message, "urlsCrawledCount")) + writer.uint32(/* id 6, wireType 0 =*/48).int64(message.urlsCrawledCount); + if (message.urlsTestedCount != null && Object.hasOwnProperty.call(message, "urlsTestedCount")) + writer.uint32(/* id 7, wireType 0 =*/56).int64(message.urlsTestedCount); + if (message.hasVulnerabilities != null && Object.hasOwnProperty.call(message, "hasVulnerabilities")) + writer.uint32(/* id 8, wireType 0 =*/64).bool(message.hasVulnerabilities); + if (message.progressPercent != null && Object.hasOwnProperty.call(message, "progressPercent")) + writer.uint32(/* id 9, wireType 0 =*/72).int32(message.progressPercent); + if (message.errorTrace != null && Object.hasOwnProperty.call(message, "errorTrace")) + $root.google.cloud.websecurityscanner.v1beta.ScanRunErrorTrace.encode(message.errorTrace, writer.uint32(/* id 10, wireType 2 =*/82).fork()).ldelim(); + if (message.warningTraces != null && message.warningTraces.length) + for (var i = 0; i < message.warningTraces.length; ++i) + $root.google.cloud.websecurityscanner.v1beta.ScanRunWarningTrace.encode(message.warningTraces[i], writer.uint32(/* id 11, wireType 2 =*/90).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified ScanRun message, length delimited. Does not implicitly {@link google.cloud.websecurityscanner.v1beta.ScanRun.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.websecurityscanner.v1beta.ScanRun + * @static + * @param {google.cloud.websecurityscanner.v1beta.IScanRun} message ScanRun message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ScanRun.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ScanRun message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.websecurityscanner.v1beta.ScanRun + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.websecurityscanner.v1beta.ScanRun} ScanRun + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ScanRun.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.websecurityscanner.v1beta.ScanRun(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.executionState = reader.int32(); + break; + } + case 3: { + message.resultState = reader.int32(); + break; + } + case 4: { + message.startTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 5: { + message.endTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 6: { + message.urlsCrawledCount = reader.int64(); + break; + } + case 7: { + message.urlsTestedCount = reader.int64(); + break; + } + case 8: { + message.hasVulnerabilities = reader.bool(); + break; + } + case 9: { + message.progressPercent = reader.int32(); + break; + } + case 10: { + message.errorTrace = $root.google.cloud.websecurityscanner.v1beta.ScanRunErrorTrace.decode(reader, reader.uint32()); + break; + } + case 11: { + if (!(message.warningTraces && message.warningTraces.length)) + message.warningTraces = []; + message.warningTraces.push($root.google.cloud.websecurityscanner.v1beta.ScanRunWarningTrace.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ScanRun message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.websecurityscanner.v1beta.ScanRun + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.websecurityscanner.v1beta.ScanRun} ScanRun + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ScanRun.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ScanRun message. + * @function verify + * @memberof google.cloud.websecurityscanner.v1beta.ScanRun + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ScanRun.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.executionState != null && message.hasOwnProperty("executionState")) + switch (message.executionState) { + default: + return "executionState: enum value expected"; + case 0: + case 1: + case 2: + case 3: + break; + } + if (message.resultState != null && message.hasOwnProperty("resultState")) + switch (message.resultState) { + default: + return "resultState: enum value expected"; + case 0: + case 1: + case 2: + case 3: + break; + } + 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.urlsCrawledCount != null && message.hasOwnProperty("urlsCrawledCount")) + if (!$util.isInteger(message.urlsCrawledCount) && !(message.urlsCrawledCount && $util.isInteger(message.urlsCrawledCount.low) && $util.isInteger(message.urlsCrawledCount.high))) + return "urlsCrawledCount: integer|Long expected"; + if (message.urlsTestedCount != null && message.hasOwnProperty("urlsTestedCount")) + if (!$util.isInteger(message.urlsTestedCount) && !(message.urlsTestedCount && $util.isInteger(message.urlsTestedCount.low) && $util.isInteger(message.urlsTestedCount.high))) + return "urlsTestedCount: integer|Long expected"; + if (message.hasVulnerabilities != null && message.hasOwnProperty("hasVulnerabilities")) + if (typeof message.hasVulnerabilities !== "boolean") + return "hasVulnerabilities: boolean expected"; + if (message.progressPercent != null && message.hasOwnProperty("progressPercent")) + if (!$util.isInteger(message.progressPercent)) + return "progressPercent: integer expected"; + if (message.errorTrace != null && message.hasOwnProperty("errorTrace")) { + var error = $root.google.cloud.websecurityscanner.v1beta.ScanRunErrorTrace.verify(message.errorTrace); + if (error) + return "errorTrace." + error; + } + if (message.warningTraces != null && message.hasOwnProperty("warningTraces")) { + if (!Array.isArray(message.warningTraces)) + return "warningTraces: array expected"; + for (var i = 0; i < message.warningTraces.length; ++i) { + var error = $root.google.cloud.websecurityscanner.v1beta.ScanRunWarningTrace.verify(message.warningTraces[i]); + if (error) + return "warningTraces." + error; + } + } + return null; + }; + + /** + * Creates a ScanRun message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.websecurityscanner.v1beta.ScanRun + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.websecurityscanner.v1beta.ScanRun} ScanRun + */ + ScanRun.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.websecurityscanner.v1beta.ScanRun) + return object; + var message = new $root.google.cloud.websecurityscanner.v1beta.ScanRun(); + if (object.name != null) + message.name = String(object.name); + switch (object.executionState) { + default: + if (typeof object.executionState === "number") { + message.executionState = object.executionState; + break; + } + break; + case "EXECUTION_STATE_UNSPECIFIED": + case 0: + message.executionState = 0; + break; + case "QUEUED": + case 1: + message.executionState = 1; + break; + case "SCANNING": + case 2: + message.executionState = 2; + break; + case "FINISHED": + case 3: + message.executionState = 3; + break; + } + switch (object.resultState) { + default: + if (typeof object.resultState === "number") { + message.resultState = object.resultState; + break; + } + break; + case "RESULT_STATE_UNSPECIFIED": + case 0: + message.resultState = 0; + break; + case "SUCCESS": + case 1: + message.resultState = 1; + break; + case "ERROR": + case 2: + message.resultState = 2; + break; + case "KILLED": + case 3: + message.resultState = 3; + break; + } + if (object.startTime != null) { + if (typeof object.startTime !== "object") + throw TypeError(".google.cloud.websecurityscanner.v1beta.ScanRun.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.websecurityscanner.v1beta.ScanRun.endTime: object expected"); + message.endTime = $root.google.protobuf.Timestamp.fromObject(object.endTime); + } + if (object.urlsCrawledCount != null) + if ($util.Long) + (message.urlsCrawledCount = $util.Long.fromValue(object.urlsCrawledCount)).unsigned = false; + else if (typeof object.urlsCrawledCount === "string") + message.urlsCrawledCount = parseInt(object.urlsCrawledCount, 10); + else if (typeof object.urlsCrawledCount === "number") + message.urlsCrawledCount = object.urlsCrawledCount; + else if (typeof object.urlsCrawledCount === "object") + message.urlsCrawledCount = new $util.LongBits(object.urlsCrawledCount.low >>> 0, object.urlsCrawledCount.high >>> 0).toNumber(); + if (object.urlsTestedCount != null) + if ($util.Long) + (message.urlsTestedCount = $util.Long.fromValue(object.urlsTestedCount)).unsigned = false; + else if (typeof object.urlsTestedCount === "string") + message.urlsTestedCount = parseInt(object.urlsTestedCount, 10); + else if (typeof object.urlsTestedCount === "number") + message.urlsTestedCount = object.urlsTestedCount; + else if (typeof object.urlsTestedCount === "object") + message.urlsTestedCount = new $util.LongBits(object.urlsTestedCount.low >>> 0, object.urlsTestedCount.high >>> 0).toNumber(); + if (object.hasVulnerabilities != null) + message.hasVulnerabilities = Boolean(object.hasVulnerabilities); + if (object.progressPercent != null) + message.progressPercent = object.progressPercent | 0; + if (object.errorTrace != null) { + if (typeof object.errorTrace !== "object") + throw TypeError(".google.cloud.websecurityscanner.v1beta.ScanRun.errorTrace: object expected"); + message.errorTrace = $root.google.cloud.websecurityscanner.v1beta.ScanRunErrorTrace.fromObject(object.errorTrace); + } + if (object.warningTraces) { + if (!Array.isArray(object.warningTraces)) + throw TypeError(".google.cloud.websecurityscanner.v1beta.ScanRun.warningTraces: array expected"); + message.warningTraces = []; + for (var i = 0; i < object.warningTraces.length; ++i) { + if (typeof object.warningTraces[i] !== "object") + throw TypeError(".google.cloud.websecurityscanner.v1beta.ScanRun.warningTraces: object expected"); + message.warningTraces[i] = $root.google.cloud.websecurityscanner.v1beta.ScanRunWarningTrace.fromObject(object.warningTraces[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a ScanRun message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.websecurityscanner.v1beta.ScanRun + * @static + * @param {google.cloud.websecurityscanner.v1beta.ScanRun} message ScanRun + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ScanRun.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.warningTraces = []; + if (options.defaults) { + object.name = ""; + object.executionState = options.enums === String ? "EXECUTION_STATE_UNSPECIFIED" : 0; + object.resultState = options.enums === String ? "RESULT_STATE_UNSPECIFIED" : 0; + object.startTime = null; + object.endTime = null; + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.urlsCrawledCount = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.urlsCrawledCount = options.longs === String ? "0" : 0; + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.urlsTestedCount = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.urlsTestedCount = options.longs === String ? "0" : 0; + object.hasVulnerabilities = false; + object.progressPercent = 0; + object.errorTrace = null; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.executionState != null && message.hasOwnProperty("executionState")) + object.executionState = options.enums === String ? $root.google.cloud.websecurityscanner.v1beta.ScanRun.ExecutionState[message.executionState] === undefined ? message.executionState : $root.google.cloud.websecurityscanner.v1beta.ScanRun.ExecutionState[message.executionState] : message.executionState; + if (message.resultState != null && message.hasOwnProperty("resultState")) + object.resultState = options.enums === String ? $root.google.cloud.websecurityscanner.v1beta.ScanRun.ResultState[message.resultState] === undefined ? message.resultState : $root.google.cloud.websecurityscanner.v1beta.ScanRun.ResultState[message.resultState] : message.resultState; + 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.urlsCrawledCount != null && message.hasOwnProperty("urlsCrawledCount")) + if (typeof message.urlsCrawledCount === "number") + object.urlsCrawledCount = options.longs === String ? String(message.urlsCrawledCount) : message.urlsCrawledCount; + else + object.urlsCrawledCount = options.longs === String ? $util.Long.prototype.toString.call(message.urlsCrawledCount) : options.longs === Number ? new $util.LongBits(message.urlsCrawledCount.low >>> 0, message.urlsCrawledCount.high >>> 0).toNumber() : message.urlsCrawledCount; + if (message.urlsTestedCount != null && message.hasOwnProperty("urlsTestedCount")) + if (typeof message.urlsTestedCount === "number") + object.urlsTestedCount = options.longs === String ? String(message.urlsTestedCount) : message.urlsTestedCount; + else + object.urlsTestedCount = options.longs === String ? $util.Long.prototype.toString.call(message.urlsTestedCount) : options.longs === Number ? new $util.LongBits(message.urlsTestedCount.low >>> 0, message.urlsTestedCount.high >>> 0).toNumber() : message.urlsTestedCount; + if (message.hasVulnerabilities != null && message.hasOwnProperty("hasVulnerabilities")) + object.hasVulnerabilities = message.hasVulnerabilities; + if (message.progressPercent != null && message.hasOwnProperty("progressPercent")) + object.progressPercent = message.progressPercent; + if (message.errorTrace != null && message.hasOwnProperty("errorTrace")) + object.errorTrace = $root.google.cloud.websecurityscanner.v1beta.ScanRunErrorTrace.toObject(message.errorTrace, options); + if (message.warningTraces && message.warningTraces.length) { + object.warningTraces = []; + for (var j = 0; j < message.warningTraces.length; ++j) + object.warningTraces[j] = $root.google.cloud.websecurityscanner.v1beta.ScanRunWarningTrace.toObject(message.warningTraces[j], options); + } + return object; + }; + + /** + * Converts this ScanRun to JSON. + * @function toJSON + * @memberof google.cloud.websecurityscanner.v1beta.ScanRun + * @instance + * @returns {Object.} JSON object + */ + ScanRun.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ScanRun + * @function getTypeUrl + * @memberof google.cloud.websecurityscanner.v1beta.ScanRun + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ScanRun.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.websecurityscanner.v1beta.ScanRun"; + }; + + /** + * ExecutionState enum. + * @name google.cloud.websecurityscanner.v1beta.ScanRun.ExecutionState + * @enum {number} + * @property {number} EXECUTION_STATE_UNSPECIFIED=0 EXECUTION_STATE_UNSPECIFIED value + * @property {number} QUEUED=1 QUEUED value + * @property {number} SCANNING=2 SCANNING value + * @property {number} FINISHED=3 FINISHED value + */ + ScanRun.ExecutionState = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "EXECUTION_STATE_UNSPECIFIED"] = 0; + values[valuesById[1] = "QUEUED"] = 1; + values[valuesById[2] = "SCANNING"] = 2; + values[valuesById[3] = "FINISHED"] = 3; + return values; + })(); + + /** + * ResultState enum. + * @name google.cloud.websecurityscanner.v1beta.ScanRun.ResultState + * @enum {number} + * @property {number} RESULT_STATE_UNSPECIFIED=0 RESULT_STATE_UNSPECIFIED value + * @property {number} SUCCESS=1 SUCCESS value + * @property {number} ERROR=2 ERROR value + * @property {number} KILLED=3 KILLED value + */ + ScanRun.ResultState = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "RESULT_STATE_UNSPECIFIED"] = 0; + values[valuesById[1] = "SUCCESS"] = 1; + values[valuesById[2] = "ERROR"] = 2; + values[valuesById[3] = "KILLED"] = 3; + return values; + })(); + + return ScanRun; + })(); + + v1beta.ScanRunErrorTrace = (function() { + + /** + * Properties of a ScanRunErrorTrace. + * @memberof google.cloud.websecurityscanner.v1beta + * @interface IScanRunErrorTrace + * @property {google.cloud.websecurityscanner.v1beta.ScanRunErrorTrace.Code|null} [code] ScanRunErrorTrace code + * @property {google.cloud.websecurityscanner.v1beta.IScanConfigError|null} [scanConfigError] ScanRunErrorTrace scanConfigError + * @property {number|null} [mostCommonHttpErrorCode] ScanRunErrorTrace mostCommonHttpErrorCode + */ + + /** + * Constructs a new ScanRunErrorTrace. + * @memberof google.cloud.websecurityscanner.v1beta + * @classdesc Represents a ScanRunErrorTrace. + * @implements IScanRunErrorTrace + * @constructor + * @param {google.cloud.websecurityscanner.v1beta.IScanRunErrorTrace=} [properties] Properties to set + */ + function ScanRunErrorTrace(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ScanRunErrorTrace code. + * @member {google.cloud.websecurityscanner.v1beta.ScanRunErrorTrace.Code} code + * @memberof google.cloud.websecurityscanner.v1beta.ScanRunErrorTrace + * @instance + */ + ScanRunErrorTrace.prototype.code = 0; + + /** + * ScanRunErrorTrace scanConfigError. + * @member {google.cloud.websecurityscanner.v1beta.IScanConfigError|null|undefined} scanConfigError + * @memberof google.cloud.websecurityscanner.v1beta.ScanRunErrorTrace + * @instance + */ + ScanRunErrorTrace.prototype.scanConfigError = null; + + /** + * ScanRunErrorTrace mostCommonHttpErrorCode. + * @member {number} mostCommonHttpErrorCode + * @memberof google.cloud.websecurityscanner.v1beta.ScanRunErrorTrace + * @instance + */ + ScanRunErrorTrace.prototype.mostCommonHttpErrorCode = 0; + + /** + * Creates a new ScanRunErrorTrace instance using the specified properties. + * @function create + * @memberof google.cloud.websecurityscanner.v1beta.ScanRunErrorTrace + * @static + * @param {google.cloud.websecurityscanner.v1beta.IScanRunErrorTrace=} [properties] Properties to set + * @returns {google.cloud.websecurityscanner.v1beta.ScanRunErrorTrace} ScanRunErrorTrace instance + */ + ScanRunErrorTrace.create = function create(properties) { + return new ScanRunErrorTrace(properties); + }; + + /** + * Encodes the specified ScanRunErrorTrace message. Does not implicitly {@link google.cloud.websecurityscanner.v1beta.ScanRunErrorTrace.verify|verify} messages. + * @function encode + * @memberof google.cloud.websecurityscanner.v1beta.ScanRunErrorTrace + * @static + * @param {google.cloud.websecurityscanner.v1beta.IScanRunErrorTrace} message ScanRunErrorTrace message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ScanRunErrorTrace.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.scanConfigError != null && Object.hasOwnProperty.call(message, "scanConfigError")) + $root.google.cloud.websecurityscanner.v1beta.ScanConfigError.encode(message.scanConfigError, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.mostCommonHttpErrorCode != null && Object.hasOwnProperty.call(message, "mostCommonHttpErrorCode")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.mostCommonHttpErrorCode); + return writer; + }; + + /** + * Encodes the specified ScanRunErrorTrace message, length delimited. Does not implicitly {@link google.cloud.websecurityscanner.v1beta.ScanRunErrorTrace.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.websecurityscanner.v1beta.ScanRunErrorTrace + * @static + * @param {google.cloud.websecurityscanner.v1beta.IScanRunErrorTrace} message ScanRunErrorTrace message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ScanRunErrorTrace.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ScanRunErrorTrace message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.websecurityscanner.v1beta.ScanRunErrorTrace + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.websecurityscanner.v1beta.ScanRunErrorTrace} ScanRunErrorTrace + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ScanRunErrorTrace.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.websecurityscanner.v1beta.ScanRunErrorTrace(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.code = reader.int32(); + break; + } + case 2: { + message.scanConfigError = $root.google.cloud.websecurityscanner.v1beta.ScanConfigError.decode(reader, reader.uint32()); + break; + } + case 3: { + message.mostCommonHttpErrorCode = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ScanRunErrorTrace message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.websecurityscanner.v1beta.ScanRunErrorTrace + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.websecurityscanner.v1beta.ScanRunErrorTrace} ScanRunErrorTrace + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ScanRunErrorTrace.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ScanRunErrorTrace message. + * @function verify + * @memberof google.cloud.websecurityscanner.v1beta.ScanRunErrorTrace + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ScanRunErrorTrace.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.code != null && message.hasOwnProperty("code")) + switch (message.code) { + default: + return "code: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + case 5: + case 6: + break; + } + if (message.scanConfigError != null && message.hasOwnProperty("scanConfigError")) { + var error = $root.google.cloud.websecurityscanner.v1beta.ScanConfigError.verify(message.scanConfigError); + if (error) + return "scanConfigError." + error; + } + if (message.mostCommonHttpErrorCode != null && message.hasOwnProperty("mostCommonHttpErrorCode")) + if (!$util.isInteger(message.mostCommonHttpErrorCode)) + return "mostCommonHttpErrorCode: integer expected"; + return null; + }; + + /** + * Creates a ScanRunErrorTrace message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.websecurityscanner.v1beta.ScanRunErrorTrace + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.websecurityscanner.v1beta.ScanRunErrorTrace} ScanRunErrorTrace + */ + ScanRunErrorTrace.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.websecurityscanner.v1beta.ScanRunErrorTrace) + return object; + var message = new $root.google.cloud.websecurityscanner.v1beta.ScanRunErrorTrace(); + switch (object.code) { + default: + if (typeof object.code === "number") { + message.code = object.code; + break; + } + break; + case "CODE_UNSPECIFIED": + case 0: + message.code = 0; + break; + case "INTERNAL_ERROR": + case 1: + message.code = 1; + break; + case "SCAN_CONFIG_ISSUE": + case 2: + message.code = 2; + break; + case "AUTHENTICATION_CONFIG_ISSUE": + case 3: + message.code = 3; + break; + case "TIMED_OUT_WHILE_SCANNING": + case 4: + message.code = 4; + break; + case "TOO_MANY_REDIRECTS": + case 5: + message.code = 5; + break; + case "TOO_MANY_HTTP_ERRORS": + case 6: + message.code = 6; + break; + } + if (object.scanConfigError != null) { + if (typeof object.scanConfigError !== "object") + throw TypeError(".google.cloud.websecurityscanner.v1beta.ScanRunErrorTrace.scanConfigError: object expected"); + message.scanConfigError = $root.google.cloud.websecurityscanner.v1beta.ScanConfigError.fromObject(object.scanConfigError); + } + if (object.mostCommonHttpErrorCode != null) + message.mostCommonHttpErrorCode = object.mostCommonHttpErrorCode | 0; + return message; + }; + + /** + * Creates a plain object from a ScanRunErrorTrace message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.websecurityscanner.v1beta.ScanRunErrorTrace + * @static + * @param {google.cloud.websecurityscanner.v1beta.ScanRunErrorTrace} message ScanRunErrorTrace + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ScanRunErrorTrace.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.code = options.enums === String ? "CODE_UNSPECIFIED" : 0; + object.scanConfigError = null; + object.mostCommonHttpErrorCode = 0; + } + if (message.code != null && message.hasOwnProperty("code")) + object.code = options.enums === String ? $root.google.cloud.websecurityscanner.v1beta.ScanRunErrorTrace.Code[message.code] === undefined ? message.code : $root.google.cloud.websecurityscanner.v1beta.ScanRunErrorTrace.Code[message.code] : message.code; + if (message.scanConfigError != null && message.hasOwnProperty("scanConfigError")) + object.scanConfigError = $root.google.cloud.websecurityscanner.v1beta.ScanConfigError.toObject(message.scanConfigError, options); + if (message.mostCommonHttpErrorCode != null && message.hasOwnProperty("mostCommonHttpErrorCode")) + object.mostCommonHttpErrorCode = message.mostCommonHttpErrorCode; + return object; + }; + + /** + * Converts this ScanRunErrorTrace to JSON. + * @function toJSON + * @memberof google.cloud.websecurityscanner.v1beta.ScanRunErrorTrace + * @instance + * @returns {Object.} JSON object + */ + ScanRunErrorTrace.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ScanRunErrorTrace + * @function getTypeUrl + * @memberof google.cloud.websecurityscanner.v1beta.ScanRunErrorTrace + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ScanRunErrorTrace.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.websecurityscanner.v1beta.ScanRunErrorTrace"; + }; + + /** + * Code enum. + * @name google.cloud.websecurityscanner.v1beta.ScanRunErrorTrace.Code + * @enum {number} + * @property {number} CODE_UNSPECIFIED=0 CODE_UNSPECIFIED value + * @property {number} INTERNAL_ERROR=1 INTERNAL_ERROR value + * @property {number} SCAN_CONFIG_ISSUE=2 SCAN_CONFIG_ISSUE value + * @property {number} AUTHENTICATION_CONFIG_ISSUE=3 AUTHENTICATION_CONFIG_ISSUE value + * @property {number} TIMED_OUT_WHILE_SCANNING=4 TIMED_OUT_WHILE_SCANNING value + * @property {number} TOO_MANY_REDIRECTS=5 TOO_MANY_REDIRECTS value + * @property {number} TOO_MANY_HTTP_ERRORS=6 TOO_MANY_HTTP_ERRORS value + */ + ScanRunErrorTrace.Code = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "CODE_UNSPECIFIED"] = 0; + values[valuesById[1] = "INTERNAL_ERROR"] = 1; + values[valuesById[2] = "SCAN_CONFIG_ISSUE"] = 2; + values[valuesById[3] = "AUTHENTICATION_CONFIG_ISSUE"] = 3; + values[valuesById[4] = "TIMED_OUT_WHILE_SCANNING"] = 4; + values[valuesById[5] = "TOO_MANY_REDIRECTS"] = 5; + values[valuesById[6] = "TOO_MANY_HTTP_ERRORS"] = 6; + return values; + })(); + + return ScanRunErrorTrace; + })(); + + v1beta.ScanConfigError = (function() { + + /** + * Properties of a ScanConfigError. + * @memberof google.cloud.websecurityscanner.v1beta + * @interface IScanConfigError + * @property {google.cloud.websecurityscanner.v1beta.ScanConfigError.Code|null} [code] ScanConfigError code + * @property {string|null} [fieldName] ScanConfigError fieldName + */ + + /** + * Constructs a new ScanConfigError. + * @memberof google.cloud.websecurityscanner.v1beta + * @classdesc Represents a ScanConfigError. + * @implements IScanConfigError + * @constructor + * @param {google.cloud.websecurityscanner.v1beta.IScanConfigError=} [properties] Properties to set + */ + function ScanConfigError(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ScanConfigError code. + * @member {google.cloud.websecurityscanner.v1beta.ScanConfigError.Code} code + * @memberof google.cloud.websecurityscanner.v1beta.ScanConfigError + * @instance + */ + ScanConfigError.prototype.code = 0; + + /** + * ScanConfigError fieldName. + * @member {string} fieldName + * @memberof google.cloud.websecurityscanner.v1beta.ScanConfigError + * @instance + */ + ScanConfigError.prototype.fieldName = ""; + + /** + * Creates a new ScanConfigError instance using the specified properties. + * @function create + * @memberof google.cloud.websecurityscanner.v1beta.ScanConfigError + * @static + * @param {google.cloud.websecurityscanner.v1beta.IScanConfigError=} [properties] Properties to set + * @returns {google.cloud.websecurityscanner.v1beta.ScanConfigError} ScanConfigError instance + */ + ScanConfigError.create = function create(properties) { + return new ScanConfigError(properties); + }; + + /** + * Encodes the specified ScanConfigError message. Does not implicitly {@link google.cloud.websecurityscanner.v1beta.ScanConfigError.verify|verify} messages. + * @function encode + * @memberof google.cloud.websecurityscanner.v1beta.ScanConfigError + * @static + * @param {google.cloud.websecurityscanner.v1beta.IScanConfigError} message ScanConfigError message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ScanConfigError.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.fieldName != null && Object.hasOwnProperty.call(message, "fieldName")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.fieldName); + return writer; + }; + + /** + * Encodes the specified ScanConfigError message, length delimited. Does not implicitly {@link google.cloud.websecurityscanner.v1beta.ScanConfigError.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.websecurityscanner.v1beta.ScanConfigError + * @static + * @param {google.cloud.websecurityscanner.v1beta.IScanConfigError} message ScanConfigError message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ScanConfigError.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ScanConfigError message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.websecurityscanner.v1beta.ScanConfigError + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.websecurityscanner.v1beta.ScanConfigError} ScanConfigError + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ScanConfigError.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.websecurityscanner.v1beta.ScanConfigError(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.code = reader.int32(); + break; + } + case 2: { + message.fieldName = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ScanConfigError message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.websecurityscanner.v1beta.ScanConfigError + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.websecurityscanner.v1beta.ScanConfigError} ScanConfigError + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ScanConfigError.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ScanConfigError message. + * @function verify + * @memberof google.cloud.websecurityscanner.v1beta.ScanConfigError + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ScanConfigError.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.code != null && message.hasOwnProperty("code")) + switch (message.code) { + default: + return "code: enum value expected"; + case 0: + case 0: + case 1: + case 2: + case 3: + case 4: + case 6: + case 7: + case 8: + case 9: + case 10: + case 11: + case 12: + case 13: + case 14: + case 15: + case 16: + case 18: + case 19: + case 20: + case 21: + case 43: + case 22: + case 23: + case 24: + case 25: + case 26: + case 27: + case 28: + case 29: + case 30: + case 31: + case 32: + case 33: + case 35: + case 36: + case 37: + case 38: + case 39: + case 40: + case 41: + case 42: + break; + } + if (message.fieldName != null && message.hasOwnProperty("fieldName")) + if (!$util.isString(message.fieldName)) + return "fieldName: string expected"; + return null; + }; + + /** + * Creates a ScanConfigError message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.websecurityscanner.v1beta.ScanConfigError + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.websecurityscanner.v1beta.ScanConfigError} ScanConfigError + */ + ScanConfigError.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.websecurityscanner.v1beta.ScanConfigError) + return object; + var message = new $root.google.cloud.websecurityscanner.v1beta.ScanConfigError(); + switch (object.code) { + default: + if (typeof object.code === "number") { + message.code = object.code; + break; + } + break; + case "CODE_UNSPECIFIED": + case 0: + message.code = 0; + break; + case "OK": + case 0: + message.code = 0; + break; + case "INTERNAL_ERROR": + case 1: + message.code = 1; + break; + case "APPENGINE_API_BACKEND_ERROR": + case 2: + message.code = 2; + break; + case "APPENGINE_API_NOT_ACCESSIBLE": + case 3: + message.code = 3; + break; + case "APPENGINE_DEFAULT_HOST_MISSING": + case 4: + message.code = 4; + break; + case "CANNOT_USE_GOOGLE_COM_ACCOUNT": + case 6: + message.code = 6; + break; + case "CANNOT_USE_OWNER_ACCOUNT": + case 7: + message.code = 7; + break; + case "COMPUTE_API_BACKEND_ERROR": + case 8: + message.code = 8; + break; + case "COMPUTE_API_NOT_ACCESSIBLE": + case 9: + message.code = 9; + break; + case "CUSTOM_LOGIN_URL_DOES_NOT_BELONG_TO_CURRENT_PROJECT": + case 10: + message.code = 10; + break; + case "CUSTOM_LOGIN_URL_MALFORMED": + case 11: + message.code = 11; + break; + case "CUSTOM_LOGIN_URL_MAPPED_TO_NON_ROUTABLE_ADDRESS": + case 12: + message.code = 12; + break; + case "CUSTOM_LOGIN_URL_MAPPED_TO_UNRESERVED_ADDRESS": + case 13: + message.code = 13; + break; + case "CUSTOM_LOGIN_URL_HAS_NON_ROUTABLE_IP_ADDRESS": + case 14: + message.code = 14; + break; + case "CUSTOM_LOGIN_URL_HAS_UNRESERVED_IP_ADDRESS": + case 15: + message.code = 15; + break; + case "DUPLICATE_SCAN_NAME": + case 16: + message.code = 16; + break; + case "INVALID_FIELD_VALUE": + case 18: + message.code = 18; + break; + case "FAILED_TO_AUTHENTICATE_TO_TARGET": + case 19: + message.code = 19; + break; + case "FINDING_TYPE_UNSPECIFIED": + case 20: + message.code = 20; + break; + case "FORBIDDEN_TO_SCAN_COMPUTE": + case 21: + message.code = 21; + break; + case "FORBIDDEN_UPDATE_TO_MANAGED_SCAN": + case 43: + message.code = 43; + break; + case "MALFORMED_FILTER": + case 22: + message.code = 22; + break; + case "MALFORMED_RESOURCE_NAME": + case 23: + message.code = 23; + break; + case "PROJECT_INACTIVE": + case 24: + message.code = 24; + break; + case "REQUIRED_FIELD": + case 25: + message.code = 25; + break; + case "RESOURCE_NAME_INCONSISTENT": + case 26: + message.code = 26; + break; + case "SCAN_ALREADY_RUNNING": + case 27: + message.code = 27; + break; + case "SCAN_NOT_RUNNING": + case 28: + message.code = 28; + break; + case "SEED_URL_DOES_NOT_BELONG_TO_CURRENT_PROJECT": + case 29: + message.code = 29; + break; + case "SEED_URL_MALFORMED": + case 30: + message.code = 30; + break; + case "SEED_URL_MAPPED_TO_NON_ROUTABLE_ADDRESS": + case 31: + message.code = 31; + break; + case "SEED_URL_MAPPED_TO_UNRESERVED_ADDRESS": + case 32: + message.code = 32; + break; + case "SEED_URL_HAS_NON_ROUTABLE_IP_ADDRESS": + case 33: + message.code = 33; + break; + case "SEED_URL_HAS_UNRESERVED_IP_ADDRESS": + case 35: + message.code = 35; + break; + case "SERVICE_ACCOUNT_NOT_CONFIGURED": + case 36: + message.code = 36; + break; + case "TOO_MANY_SCANS": + case 37: + message.code = 37; + break; + case "UNABLE_TO_RESOLVE_PROJECT_INFO": + case 38: + message.code = 38; + break; + case "UNSUPPORTED_BLACKLIST_PATTERN_FORMAT": + case 39: + message.code = 39; + break; + case "UNSUPPORTED_FILTER": + case 40: + message.code = 40; + break; + case "UNSUPPORTED_FINDING_TYPE": + case 41: + message.code = 41; + break; + case "UNSUPPORTED_URL_SCHEME": + case 42: + message.code = 42; + break; + } + if (object.fieldName != null) + message.fieldName = String(object.fieldName); + return message; + }; + + /** + * Creates a plain object from a ScanConfigError message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.websecurityscanner.v1beta.ScanConfigError + * @static + * @param {google.cloud.websecurityscanner.v1beta.ScanConfigError} message ScanConfigError + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ScanConfigError.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.code = options.enums === String ? "CODE_UNSPECIFIED" : 0; + object.fieldName = ""; + } + if (message.code != null && message.hasOwnProperty("code")) + object.code = options.enums === String ? $root.google.cloud.websecurityscanner.v1beta.ScanConfigError.Code[message.code] === undefined ? message.code : $root.google.cloud.websecurityscanner.v1beta.ScanConfigError.Code[message.code] : message.code; + if (message.fieldName != null && message.hasOwnProperty("fieldName")) + object.fieldName = message.fieldName; + return object; + }; + + /** + * Converts this ScanConfigError to JSON. + * @function toJSON + * @memberof google.cloud.websecurityscanner.v1beta.ScanConfigError + * @instance + * @returns {Object.} JSON object + */ + ScanConfigError.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ScanConfigError + * @function getTypeUrl + * @memberof google.cloud.websecurityscanner.v1beta.ScanConfigError + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ScanConfigError.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.websecurityscanner.v1beta.ScanConfigError"; + }; + + /** + * Code enum. + * @name google.cloud.websecurityscanner.v1beta.ScanConfigError.Code + * @enum {number} + * @property {number} CODE_UNSPECIFIED=0 CODE_UNSPECIFIED value + * @property {number} OK=0 OK value + * @property {number} INTERNAL_ERROR=1 INTERNAL_ERROR value + * @property {number} APPENGINE_API_BACKEND_ERROR=2 APPENGINE_API_BACKEND_ERROR value + * @property {number} APPENGINE_API_NOT_ACCESSIBLE=3 APPENGINE_API_NOT_ACCESSIBLE value + * @property {number} APPENGINE_DEFAULT_HOST_MISSING=4 APPENGINE_DEFAULT_HOST_MISSING value + * @property {number} CANNOT_USE_GOOGLE_COM_ACCOUNT=6 CANNOT_USE_GOOGLE_COM_ACCOUNT value + * @property {number} CANNOT_USE_OWNER_ACCOUNT=7 CANNOT_USE_OWNER_ACCOUNT value + * @property {number} COMPUTE_API_BACKEND_ERROR=8 COMPUTE_API_BACKEND_ERROR value + * @property {number} COMPUTE_API_NOT_ACCESSIBLE=9 COMPUTE_API_NOT_ACCESSIBLE value + * @property {number} CUSTOM_LOGIN_URL_DOES_NOT_BELONG_TO_CURRENT_PROJECT=10 CUSTOM_LOGIN_URL_DOES_NOT_BELONG_TO_CURRENT_PROJECT value + * @property {number} CUSTOM_LOGIN_URL_MALFORMED=11 CUSTOM_LOGIN_URL_MALFORMED value + * @property {number} CUSTOM_LOGIN_URL_MAPPED_TO_NON_ROUTABLE_ADDRESS=12 CUSTOM_LOGIN_URL_MAPPED_TO_NON_ROUTABLE_ADDRESS value + * @property {number} CUSTOM_LOGIN_URL_MAPPED_TO_UNRESERVED_ADDRESS=13 CUSTOM_LOGIN_URL_MAPPED_TO_UNRESERVED_ADDRESS value + * @property {number} CUSTOM_LOGIN_URL_HAS_NON_ROUTABLE_IP_ADDRESS=14 CUSTOM_LOGIN_URL_HAS_NON_ROUTABLE_IP_ADDRESS value + * @property {number} CUSTOM_LOGIN_URL_HAS_UNRESERVED_IP_ADDRESS=15 CUSTOM_LOGIN_URL_HAS_UNRESERVED_IP_ADDRESS value + * @property {number} DUPLICATE_SCAN_NAME=16 DUPLICATE_SCAN_NAME value + * @property {number} INVALID_FIELD_VALUE=18 INVALID_FIELD_VALUE value + * @property {number} FAILED_TO_AUTHENTICATE_TO_TARGET=19 FAILED_TO_AUTHENTICATE_TO_TARGET value + * @property {number} FINDING_TYPE_UNSPECIFIED=20 FINDING_TYPE_UNSPECIFIED value + * @property {number} FORBIDDEN_TO_SCAN_COMPUTE=21 FORBIDDEN_TO_SCAN_COMPUTE value + * @property {number} FORBIDDEN_UPDATE_TO_MANAGED_SCAN=43 FORBIDDEN_UPDATE_TO_MANAGED_SCAN value + * @property {number} MALFORMED_FILTER=22 MALFORMED_FILTER value + * @property {number} MALFORMED_RESOURCE_NAME=23 MALFORMED_RESOURCE_NAME value + * @property {number} PROJECT_INACTIVE=24 PROJECT_INACTIVE value + * @property {number} REQUIRED_FIELD=25 REQUIRED_FIELD value + * @property {number} RESOURCE_NAME_INCONSISTENT=26 RESOURCE_NAME_INCONSISTENT value + * @property {number} SCAN_ALREADY_RUNNING=27 SCAN_ALREADY_RUNNING value + * @property {number} SCAN_NOT_RUNNING=28 SCAN_NOT_RUNNING value + * @property {number} SEED_URL_DOES_NOT_BELONG_TO_CURRENT_PROJECT=29 SEED_URL_DOES_NOT_BELONG_TO_CURRENT_PROJECT value + * @property {number} SEED_URL_MALFORMED=30 SEED_URL_MALFORMED value + * @property {number} SEED_URL_MAPPED_TO_NON_ROUTABLE_ADDRESS=31 SEED_URL_MAPPED_TO_NON_ROUTABLE_ADDRESS value + * @property {number} SEED_URL_MAPPED_TO_UNRESERVED_ADDRESS=32 SEED_URL_MAPPED_TO_UNRESERVED_ADDRESS value + * @property {number} SEED_URL_HAS_NON_ROUTABLE_IP_ADDRESS=33 SEED_URL_HAS_NON_ROUTABLE_IP_ADDRESS value + * @property {number} SEED_URL_HAS_UNRESERVED_IP_ADDRESS=35 SEED_URL_HAS_UNRESERVED_IP_ADDRESS value + * @property {number} SERVICE_ACCOUNT_NOT_CONFIGURED=36 SERVICE_ACCOUNT_NOT_CONFIGURED value + * @property {number} TOO_MANY_SCANS=37 TOO_MANY_SCANS value + * @property {number} UNABLE_TO_RESOLVE_PROJECT_INFO=38 UNABLE_TO_RESOLVE_PROJECT_INFO value + * @property {number} UNSUPPORTED_BLACKLIST_PATTERN_FORMAT=39 UNSUPPORTED_BLACKLIST_PATTERN_FORMAT value + * @property {number} UNSUPPORTED_FILTER=40 UNSUPPORTED_FILTER value + * @property {number} UNSUPPORTED_FINDING_TYPE=41 UNSUPPORTED_FINDING_TYPE value + * @property {number} UNSUPPORTED_URL_SCHEME=42 UNSUPPORTED_URL_SCHEME value + */ + ScanConfigError.Code = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "CODE_UNSPECIFIED"] = 0; + values["OK"] = 0; + values[valuesById[1] = "INTERNAL_ERROR"] = 1; + values[valuesById[2] = "APPENGINE_API_BACKEND_ERROR"] = 2; + values[valuesById[3] = "APPENGINE_API_NOT_ACCESSIBLE"] = 3; + values[valuesById[4] = "APPENGINE_DEFAULT_HOST_MISSING"] = 4; + values[valuesById[6] = "CANNOT_USE_GOOGLE_COM_ACCOUNT"] = 6; + values[valuesById[7] = "CANNOT_USE_OWNER_ACCOUNT"] = 7; + values[valuesById[8] = "COMPUTE_API_BACKEND_ERROR"] = 8; + values[valuesById[9] = "COMPUTE_API_NOT_ACCESSIBLE"] = 9; + values[valuesById[10] = "CUSTOM_LOGIN_URL_DOES_NOT_BELONG_TO_CURRENT_PROJECT"] = 10; + values[valuesById[11] = "CUSTOM_LOGIN_URL_MALFORMED"] = 11; + values[valuesById[12] = "CUSTOM_LOGIN_URL_MAPPED_TO_NON_ROUTABLE_ADDRESS"] = 12; + values[valuesById[13] = "CUSTOM_LOGIN_URL_MAPPED_TO_UNRESERVED_ADDRESS"] = 13; + values[valuesById[14] = "CUSTOM_LOGIN_URL_HAS_NON_ROUTABLE_IP_ADDRESS"] = 14; + values[valuesById[15] = "CUSTOM_LOGIN_URL_HAS_UNRESERVED_IP_ADDRESS"] = 15; + values[valuesById[16] = "DUPLICATE_SCAN_NAME"] = 16; + values[valuesById[18] = "INVALID_FIELD_VALUE"] = 18; + values[valuesById[19] = "FAILED_TO_AUTHENTICATE_TO_TARGET"] = 19; + values[valuesById[20] = "FINDING_TYPE_UNSPECIFIED"] = 20; + values[valuesById[21] = "FORBIDDEN_TO_SCAN_COMPUTE"] = 21; + values[valuesById[43] = "FORBIDDEN_UPDATE_TO_MANAGED_SCAN"] = 43; + values[valuesById[22] = "MALFORMED_FILTER"] = 22; + values[valuesById[23] = "MALFORMED_RESOURCE_NAME"] = 23; + values[valuesById[24] = "PROJECT_INACTIVE"] = 24; + values[valuesById[25] = "REQUIRED_FIELD"] = 25; + values[valuesById[26] = "RESOURCE_NAME_INCONSISTENT"] = 26; + values[valuesById[27] = "SCAN_ALREADY_RUNNING"] = 27; + values[valuesById[28] = "SCAN_NOT_RUNNING"] = 28; + values[valuesById[29] = "SEED_URL_DOES_NOT_BELONG_TO_CURRENT_PROJECT"] = 29; + values[valuesById[30] = "SEED_URL_MALFORMED"] = 30; + values[valuesById[31] = "SEED_URL_MAPPED_TO_NON_ROUTABLE_ADDRESS"] = 31; + values[valuesById[32] = "SEED_URL_MAPPED_TO_UNRESERVED_ADDRESS"] = 32; + values[valuesById[33] = "SEED_URL_HAS_NON_ROUTABLE_IP_ADDRESS"] = 33; + values[valuesById[35] = "SEED_URL_HAS_UNRESERVED_IP_ADDRESS"] = 35; + values[valuesById[36] = "SERVICE_ACCOUNT_NOT_CONFIGURED"] = 36; + values[valuesById[37] = "TOO_MANY_SCANS"] = 37; + values[valuesById[38] = "UNABLE_TO_RESOLVE_PROJECT_INFO"] = 38; + values[valuesById[39] = "UNSUPPORTED_BLACKLIST_PATTERN_FORMAT"] = 39; + values[valuesById[40] = "UNSUPPORTED_FILTER"] = 40; + values[valuesById[41] = "UNSUPPORTED_FINDING_TYPE"] = 41; + values[valuesById[42] = "UNSUPPORTED_URL_SCHEME"] = 42; + return values; + })(); + + return ScanConfigError; + })(); + + v1beta.ScanRunWarningTrace = (function() { + + /** + * Properties of a ScanRunWarningTrace. + * @memberof google.cloud.websecurityscanner.v1beta + * @interface IScanRunWarningTrace + * @property {google.cloud.websecurityscanner.v1beta.ScanRunWarningTrace.Code|null} [code] ScanRunWarningTrace code + */ + + /** + * Constructs a new ScanRunWarningTrace. + * @memberof google.cloud.websecurityscanner.v1beta + * @classdesc Represents a ScanRunWarningTrace. + * @implements IScanRunWarningTrace + * @constructor + * @param {google.cloud.websecurityscanner.v1beta.IScanRunWarningTrace=} [properties] Properties to set + */ + function ScanRunWarningTrace(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ScanRunWarningTrace code. + * @member {google.cloud.websecurityscanner.v1beta.ScanRunWarningTrace.Code} code + * @memberof google.cloud.websecurityscanner.v1beta.ScanRunWarningTrace + * @instance + */ + ScanRunWarningTrace.prototype.code = 0; + + /** + * Creates a new ScanRunWarningTrace instance using the specified properties. + * @function create + * @memberof google.cloud.websecurityscanner.v1beta.ScanRunWarningTrace + * @static + * @param {google.cloud.websecurityscanner.v1beta.IScanRunWarningTrace=} [properties] Properties to set + * @returns {google.cloud.websecurityscanner.v1beta.ScanRunWarningTrace} ScanRunWarningTrace instance + */ + ScanRunWarningTrace.create = function create(properties) { + return new ScanRunWarningTrace(properties); + }; + + /** + * Encodes the specified ScanRunWarningTrace message. Does not implicitly {@link google.cloud.websecurityscanner.v1beta.ScanRunWarningTrace.verify|verify} messages. + * @function encode + * @memberof google.cloud.websecurityscanner.v1beta.ScanRunWarningTrace + * @static + * @param {google.cloud.websecurityscanner.v1beta.IScanRunWarningTrace} message ScanRunWarningTrace message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ScanRunWarningTrace.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); + return writer; + }; + + /** + * Encodes the specified ScanRunWarningTrace message, length delimited. Does not implicitly {@link google.cloud.websecurityscanner.v1beta.ScanRunWarningTrace.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.websecurityscanner.v1beta.ScanRunWarningTrace + * @static + * @param {google.cloud.websecurityscanner.v1beta.IScanRunWarningTrace} message ScanRunWarningTrace message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ScanRunWarningTrace.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ScanRunWarningTrace message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.websecurityscanner.v1beta.ScanRunWarningTrace + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.websecurityscanner.v1beta.ScanRunWarningTrace} ScanRunWarningTrace + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ScanRunWarningTrace.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.websecurityscanner.v1beta.ScanRunWarningTrace(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.code = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ScanRunWarningTrace message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.websecurityscanner.v1beta.ScanRunWarningTrace + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.websecurityscanner.v1beta.ScanRunWarningTrace} ScanRunWarningTrace + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ScanRunWarningTrace.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ScanRunWarningTrace message. + * @function verify + * @memberof google.cloud.websecurityscanner.v1beta.ScanRunWarningTrace + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ScanRunWarningTrace.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.code != null && message.hasOwnProperty("code")) + switch (message.code) { + default: + return "code: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + break; + } + return null; + }; + + /** + * Creates a ScanRunWarningTrace message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.websecurityscanner.v1beta.ScanRunWarningTrace + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.websecurityscanner.v1beta.ScanRunWarningTrace} ScanRunWarningTrace + */ + ScanRunWarningTrace.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.websecurityscanner.v1beta.ScanRunWarningTrace) + return object; + var message = new $root.google.cloud.websecurityscanner.v1beta.ScanRunWarningTrace(); + switch (object.code) { + default: + if (typeof object.code === "number") { + message.code = object.code; + break; + } + break; + case "CODE_UNSPECIFIED": + case 0: + message.code = 0; + break; + case "INSUFFICIENT_CRAWL_RESULTS": + case 1: + message.code = 1; + break; + case "TOO_MANY_CRAWL_RESULTS": + case 2: + message.code = 2; + break; + case "TOO_MANY_FUZZ_TASKS": + case 3: + message.code = 3; + break; + case "BLOCKED_BY_IAP": + case 4: + message.code = 4; + break; + } + return message; + }; + + /** + * Creates a plain object from a ScanRunWarningTrace message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.websecurityscanner.v1beta.ScanRunWarningTrace + * @static + * @param {google.cloud.websecurityscanner.v1beta.ScanRunWarningTrace} message ScanRunWarningTrace + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ScanRunWarningTrace.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.code = options.enums === String ? "CODE_UNSPECIFIED" : 0; + if (message.code != null && message.hasOwnProperty("code")) + object.code = options.enums === String ? $root.google.cloud.websecurityscanner.v1beta.ScanRunWarningTrace.Code[message.code] === undefined ? message.code : $root.google.cloud.websecurityscanner.v1beta.ScanRunWarningTrace.Code[message.code] : message.code; + return object; + }; + + /** + * Converts this ScanRunWarningTrace to JSON. + * @function toJSON + * @memberof google.cloud.websecurityscanner.v1beta.ScanRunWarningTrace + * @instance + * @returns {Object.} JSON object + */ + ScanRunWarningTrace.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ScanRunWarningTrace + * @function getTypeUrl + * @memberof google.cloud.websecurityscanner.v1beta.ScanRunWarningTrace + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ScanRunWarningTrace.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.websecurityscanner.v1beta.ScanRunWarningTrace"; + }; + + /** + * Code enum. + * @name google.cloud.websecurityscanner.v1beta.ScanRunWarningTrace.Code + * @enum {number} + * @property {number} CODE_UNSPECIFIED=0 CODE_UNSPECIFIED value + * @property {number} INSUFFICIENT_CRAWL_RESULTS=1 INSUFFICIENT_CRAWL_RESULTS value + * @property {number} TOO_MANY_CRAWL_RESULTS=2 TOO_MANY_CRAWL_RESULTS value + * @property {number} TOO_MANY_FUZZ_TASKS=3 TOO_MANY_FUZZ_TASKS value + * @property {number} BLOCKED_BY_IAP=4 BLOCKED_BY_IAP value + */ + ScanRunWarningTrace.Code = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "CODE_UNSPECIFIED"] = 0; + values[valuesById[1] = "INSUFFICIENT_CRAWL_RESULTS"] = 1; + values[valuesById[2] = "TOO_MANY_CRAWL_RESULTS"] = 2; + values[valuesById[3] = "TOO_MANY_FUZZ_TASKS"] = 3; + values[valuesById[4] = "BLOCKED_BY_IAP"] = 4; + return values; + })(); + + return ScanRunWarningTrace; + })(); + + v1beta.WebSecurityScanner = (function() { + + /** + * Constructs a new WebSecurityScanner service. + * @memberof google.cloud.websecurityscanner.v1beta + * @classdesc Represents a WebSecurityScanner + * @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 WebSecurityScanner(rpcImpl, requestDelimited, responseDelimited) { + $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited); + } + + (WebSecurityScanner.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = WebSecurityScanner; + + /** + * Creates new WebSecurityScanner service using the specified rpc implementation. + * @function create + * @memberof google.cloud.websecurityscanner.v1beta.WebSecurityScanner + * @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 {WebSecurityScanner} RPC service. Useful where requests and/or responses are streamed. + */ + WebSecurityScanner.create = function create(rpcImpl, requestDelimited, responseDelimited) { + return new this(rpcImpl, requestDelimited, responseDelimited); + }; + + /** + * Callback as used by {@link google.cloud.websecurityscanner.v1beta.WebSecurityScanner|createScanConfig}. + * @memberof google.cloud.websecurityscanner.v1beta.WebSecurityScanner + * @typedef CreateScanConfigCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.websecurityscanner.v1beta.ScanConfig} [response] ScanConfig + */ + + /** + * Calls CreateScanConfig. + * @function createScanConfig + * @memberof google.cloud.websecurityscanner.v1beta.WebSecurityScanner + * @instance + * @param {google.cloud.websecurityscanner.v1beta.ICreateScanConfigRequest} request CreateScanConfigRequest message or plain object + * @param {google.cloud.websecurityscanner.v1beta.WebSecurityScanner.CreateScanConfigCallback} callback Node-style callback called with the error, if any, and ScanConfig + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(WebSecurityScanner.prototype.createScanConfig = function createScanConfig(request, callback) { + return this.rpcCall(createScanConfig, $root.google.cloud.websecurityscanner.v1beta.CreateScanConfigRequest, $root.google.cloud.websecurityscanner.v1beta.ScanConfig, request, callback); + }, "name", { value: "CreateScanConfig" }); + + /** + * Calls CreateScanConfig. + * @function createScanConfig + * @memberof google.cloud.websecurityscanner.v1beta.WebSecurityScanner + * @instance + * @param {google.cloud.websecurityscanner.v1beta.ICreateScanConfigRequest} request CreateScanConfigRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.websecurityscanner.v1beta.WebSecurityScanner|deleteScanConfig}. + * @memberof google.cloud.websecurityscanner.v1beta.WebSecurityScanner + * @typedef DeleteScanConfigCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.protobuf.Empty} [response] Empty + */ + + /** + * Calls DeleteScanConfig. + * @function deleteScanConfig + * @memberof google.cloud.websecurityscanner.v1beta.WebSecurityScanner + * @instance + * @param {google.cloud.websecurityscanner.v1beta.IDeleteScanConfigRequest} request DeleteScanConfigRequest message or plain object + * @param {google.cloud.websecurityscanner.v1beta.WebSecurityScanner.DeleteScanConfigCallback} callback Node-style callback called with the error, if any, and Empty + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(WebSecurityScanner.prototype.deleteScanConfig = function deleteScanConfig(request, callback) { + return this.rpcCall(deleteScanConfig, $root.google.cloud.websecurityscanner.v1beta.DeleteScanConfigRequest, $root.google.protobuf.Empty, request, callback); + }, "name", { value: "DeleteScanConfig" }); + + /** + * Calls DeleteScanConfig. + * @function deleteScanConfig + * @memberof google.cloud.websecurityscanner.v1beta.WebSecurityScanner + * @instance + * @param {google.cloud.websecurityscanner.v1beta.IDeleteScanConfigRequest} request DeleteScanConfigRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.websecurityscanner.v1beta.WebSecurityScanner|getScanConfig}. + * @memberof google.cloud.websecurityscanner.v1beta.WebSecurityScanner + * @typedef GetScanConfigCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.websecurityscanner.v1beta.ScanConfig} [response] ScanConfig + */ + + /** + * Calls GetScanConfig. + * @function getScanConfig + * @memberof google.cloud.websecurityscanner.v1beta.WebSecurityScanner + * @instance + * @param {google.cloud.websecurityscanner.v1beta.IGetScanConfigRequest} request GetScanConfigRequest message or plain object + * @param {google.cloud.websecurityscanner.v1beta.WebSecurityScanner.GetScanConfigCallback} callback Node-style callback called with the error, if any, and ScanConfig + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(WebSecurityScanner.prototype.getScanConfig = function getScanConfig(request, callback) { + return this.rpcCall(getScanConfig, $root.google.cloud.websecurityscanner.v1beta.GetScanConfigRequest, $root.google.cloud.websecurityscanner.v1beta.ScanConfig, request, callback); + }, "name", { value: "GetScanConfig" }); + + /** + * Calls GetScanConfig. + * @function getScanConfig + * @memberof google.cloud.websecurityscanner.v1beta.WebSecurityScanner + * @instance + * @param {google.cloud.websecurityscanner.v1beta.IGetScanConfigRequest} request GetScanConfigRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.websecurityscanner.v1beta.WebSecurityScanner|listScanConfigs}. + * @memberof google.cloud.websecurityscanner.v1beta.WebSecurityScanner + * @typedef ListScanConfigsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.websecurityscanner.v1beta.ListScanConfigsResponse} [response] ListScanConfigsResponse + */ + + /** + * Calls ListScanConfigs. + * @function listScanConfigs + * @memberof google.cloud.websecurityscanner.v1beta.WebSecurityScanner + * @instance + * @param {google.cloud.websecurityscanner.v1beta.IListScanConfigsRequest} request ListScanConfigsRequest message or plain object + * @param {google.cloud.websecurityscanner.v1beta.WebSecurityScanner.ListScanConfigsCallback} callback Node-style callback called with the error, if any, and ListScanConfigsResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(WebSecurityScanner.prototype.listScanConfigs = function listScanConfigs(request, callback) { + return this.rpcCall(listScanConfigs, $root.google.cloud.websecurityscanner.v1beta.ListScanConfigsRequest, $root.google.cloud.websecurityscanner.v1beta.ListScanConfigsResponse, request, callback); + }, "name", { value: "ListScanConfigs" }); + + /** + * Calls ListScanConfigs. + * @function listScanConfigs + * @memberof google.cloud.websecurityscanner.v1beta.WebSecurityScanner + * @instance + * @param {google.cloud.websecurityscanner.v1beta.IListScanConfigsRequest} request ListScanConfigsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.websecurityscanner.v1beta.WebSecurityScanner|updateScanConfig}. + * @memberof google.cloud.websecurityscanner.v1beta.WebSecurityScanner + * @typedef UpdateScanConfigCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.websecurityscanner.v1beta.ScanConfig} [response] ScanConfig + */ + + /** + * Calls UpdateScanConfig. + * @function updateScanConfig + * @memberof google.cloud.websecurityscanner.v1beta.WebSecurityScanner + * @instance + * @param {google.cloud.websecurityscanner.v1beta.IUpdateScanConfigRequest} request UpdateScanConfigRequest message or plain object + * @param {google.cloud.websecurityscanner.v1beta.WebSecurityScanner.UpdateScanConfigCallback} callback Node-style callback called with the error, if any, and ScanConfig + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(WebSecurityScanner.prototype.updateScanConfig = function updateScanConfig(request, callback) { + return this.rpcCall(updateScanConfig, $root.google.cloud.websecurityscanner.v1beta.UpdateScanConfigRequest, $root.google.cloud.websecurityscanner.v1beta.ScanConfig, request, callback); + }, "name", { value: "UpdateScanConfig" }); + + /** + * Calls UpdateScanConfig. + * @function updateScanConfig + * @memberof google.cloud.websecurityscanner.v1beta.WebSecurityScanner + * @instance + * @param {google.cloud.websecurityscanner.v1beta.IUpdateScanConfigRequest} request UpdateScanConfigRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.websecurityscanner.v1beta.WebSecurityScanner|startScanRun}. + * @memberof google.cloud.websecurityscanner.v1beta.WebSecurityScanner + * @typedef StartScanRunCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.websecurityscanner.v1beta.ScanRun} [response] ScanRun + */ + + /** + * Calls StartScanRun. + * @function startScanRun + * @memberof google.cloud.websecurityscanner.v1beta.WebSecurityScanner + * @instance + * @param {google.cloud.websecurityscanner.v1beta.IStartScanRunRequest} request StartScanRunRequest message or plain object + * @param {google.cloud.websecurityscanner.v1beta.WebSecurityScanner.StartScanRunCallback} callback Node-style callback called with the error, if any, and ScanRun + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(WebSecurityScanner.prototype.startScanRun = function startScanRun(request, callback) { + return this.rpcCall(startScanRun, $root.google.cloud.websecurityscanner.v1beta.StartScanRunRequest, $root.google.cloud.websecurityscanner.v1beta.ScanRun, request, callback); + }, "name", { value: "StartScanRun" }); + + /** + * Calls StartScanRun. + * @function startScanRun + * @memberof google.cloud.websecurityscanner.v1beta.WebSecurityScanner + * @instance + * @param {google.cloud.websecurityscanner.v1beta.IStartScanRunRequest} request StartScanRunRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.websecurityscanner.v1beta.WebSecurityScanner|getScanRun}. + * @memberof google.cloud.websecurityscanner.v1beta.WebSecurityScanner + * @typedef GetScanRunCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.websecurityscanner.v1beta.ScanRun} [response] ScanRun + */ + + /** + * Calls GetScanRun. + * @function getScanRun + * @memberof google.cloud.websecurityscanner.v1beta.WebSecurityScanner + * @instance + * @param {google.cloud.websecurityscanner.v1beta.IGetScanRunRequest} request GetScanRunRequest message or plain object + * @param {google.cloud.websecurityscanner.v1beta.WebSecurityScanner.GetScanRunCallback} callback Node-style callback called with the error, if any, and ScanRun + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(WebSecurityScanner.prototype.getScanRun = function getScanRun(request, callback) { + return this.rpcCall(getScanRun, $root.google.cloud.websecurityscanner.v1beta.GetScanRunRequest, $root.google.cloud.websecurityscanner.v1beta.ScanRun, request, callback); + }, "name", { value: "GetScanRun" }); + + /** + * Calls GetScanRun. + * @function getScanRun + * @memberof google.cloud.websecurityscanner.v1beta.WebSecurityScanner + * @instance + * @param {google.cloud.websecurityscanner.v1beta.IGetScanRunRequest} request GetScanRunRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.websecurityscanner.v1beta.WebSecurityScanner|listScanRuns}. + * @memberof google.cloud.websecurityscanner.v1beta.WebSecurityScanner + * @typedef ListScanRunsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.websecurityscanner.v1beta.ListScanRunsResponse} [response] ListScanRunsResponse + */ + + /** + * Calls ListScanRuns. + * @function listScanRuns + * @memberof google.cloud.websecurityscanner.v1beta.WebSecurityScanner + * @instance + * @param {google.cloud.websecurityscanner.v1beta.IListScanRunsRequest} request ListScanRunsRequest message or plain object + * @param {google.cloud.websecurityscanner.v1beta.WebSecurityScanner.ListScanRunsCallback} callback Node-style callback called with the error, if any, and ListScanRunsResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(WebSecurityScanner.prototype.listScanRuns = function listScanRuns(request, callback) { + return this.rpcCall(listScanRuns, $root.google.cloud.websecurityscanner.v1beta.ListScanRunsRequest, $root.google.cloud.websecurityscanner.v1beta.ListScanRunsResponse, request, callback); + }, "name", { value: "ListScanRuns" }); + + /** + * Calls ListScanRuns. + * @function listScanRuns + * @memberof google.cloud.websecurityscanner.v1beta.WebSecurityScanner + * @instance + * @param {google.cloud.websecurityscanner.v1beta.IListScanRunsRequest} request ListScanRunsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.websecurityscanner.v1beta.WebSecurityScanner|stopScanRun}. + * @memberof google.cloud.websecurityscanner.v1beta.WebSecurityScanner + * @typedef StopScanRunCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.websecurityscanner.v1beta.ScanRun} [response] ScanRun + */ + + /** + * Calls StopScanRun. + * @function stopScanRun + * @memberof google.cloud.websecurityscanner.v1beta.WebSecurityScanner + * @instance + * @param {google.cloud.websecurityscanner.v1beta.IStopScanRunRequest} request StopScanRunRequest message or plain object + * @param {google.cloud.websecurityscanner.v1beta.WebSecurityScanner.StopScanRunCallback} callback Node-style callback called with the error, if any, and ScanRun + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(WebSecurityScanner.prototype.stopScanRun = function stopScanRun(request, callback) { + return this.rpcCall(stopScanRun, $root.google.cloud.websecurityscanner.v1beta.StopScanRunRequest, $root.google.cloud.websecurityscanner.v1beta.ScanRun, request, callback); + }, "name", { value: "StopScanRun" }); + + /** + * Calls StopScanRun. + * @function stopScanRun + * @memberof google.cloud.websecurityscanner.v1beta.WebSecurityScanner + * @instance + * @param {google.cloud.websecurityscanner.v1beta.IStopScanRunRequest} request StopScanRunRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.websecurityscanner.v1beta.WebSecurityScanner|listCrawledUrls}. + * @memberof google.cloud.websecurityscanner.v1beta.WebSecurityScanner + * @typedef ListCrawledUrlsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.websecurityscanner.v1beta.ListCrawledUrlsResponse} [response] ListCrawledUrlsResponse + */ + + /** + * Calls ListCrawledUrls. + * @function listCrawledUrls + * @memberof google.cloud.websecurityscanner.v1beta.WebSecurityScanner + * @instance + * @param {google.cloud.websecurityscanner.v1beta.IListCrawledUrlsRequest} request ListCrawledUrlsRequest message or plain object + * @param {google.cloud.websecurityscanner.v1beta.WebSecurityScanner.ListCrawledUrlsCallback} callback Node-style callback called with the error, if any, and ListCrawledUrlsResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(WebSecurityScanner.prototype.listCrawledUrls = function listCrawledUrls(request, callback) { + return this.rpcCall(listCrawledUrls, $root.google.cloud.websecurityscanner.v1beta.ListCrawledUrlsRequest, $root.google.cloud.websecurityscanner.v1beta.ListCrawledUrlsResponse, request, callback); + }, "name", { value: "ListCrawledUrls" }); + + /** + * Calls ListCrawledUrls. + * @function listCrawledUrls + * @memberof google.cloud.websecurityscanner.v1beta.WebSecurityScanner + * @instance + * @param {google.cloud.websecurityscanner.v1beta.IListCrawledUrlsRequest} request ListCrawledUrlsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.websecurityscanner.v1beta.WebSecurityScanner|getFinding}. + * @memberof google.cloud.websecurityscanner.v1beta.WebSecurityScanner + * @typedef GetFindingCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.websecurityscanner.v1beta.Finding} [response] Finding + */ + + /** + * Calls GetFinding. + * @function getFinding + * @memberof google.cloud.websecurityscanner.v1beta.WebSecurityScanner + * @instance + * @param {google.cloud.websecurityscanner.v1beta.IGetFindingRequest} request GetFindingRequest message or plain object + * @param {google.cloud.websecurityscanner.v1beta.WebSecurityScanner.GetFindingCallback} callback Node-style callback called with the error, if any, and Finding + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(WebSecurityScanner.prototype.getFinding = function getFinding(request, callback) { + return this.rpcCall(getFinding, $root.google.cloud.websecurityscanner.v1beta.GetFindingRequest, $root.google.cloud.websecurityscanner.v1beta.Finding, request, callback); + }, "name", { value: "GetFinding" }); + + /** + * Calls GetFinding. + * @function getFinding + * @memberof google.cloud.websecurityscanner.v1beta.WebSecurityScanner + * @instance + * @param {google.cloud.websecurityscanner.v1beta.IGetFindingRequest} request GetFindingRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.websecurityscanner.v1beta.WebSecurityScanner|listFindings}. + * @memberof google.cloud.websecurityscanner.v1beta.WebSecurityScanner + * @typedef ListFindingsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.websecurityscanner.v1beta.ListFindingsResponse} [response] ListFindingsResponse + */ + + /** + * Calls ListFindings. + * @function listFindings + * @memberof google.cloud.websecurityscanner.v1beta.WebSecurityScanner + * @instance + * @param {google.cloud.websecurityscanner.v1beta.IListFindingsRequest} request ListFindingsRequest message or plain object + * @param {google.cloud.websecurityscanner.v1beta.WebSecurityScanner.ListFindingsCallback} callback Node-style callback called with the error, if any, and ListFindingsResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(WebSecurityScanner.prototype.listFindings = function listFindings(request, callback) { + return this.rpcCall(listFindings, $root.google.cloud.websecurityscanner.v1beta.ListFindingsRequest, $root.google.cloud.websecurityscanner.v1beta.ListFindingsResponse, request, callback); + }, "name", { value: "ListFindings" }); + + /** + * Calls ListFindings. + * @function listFindings + * @memberof google.cloud.websecurityscanner.v1beta.WebSecurityScanner + * @instance + * @param {google.cloud.websecurityscanner.v1beta.IListFindingsRequest} request ListFindingsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.websecurityscanner.v1beta.WebSecurityScanner|listFindingTypeStats}. + * @memberof google.cloud.websecurityscanner.v1beta.WebSecurityScanner + * @typedef ListFindingTypeStatsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.websecurityscanner.v1beta.ListFindingTypeStatsResponse} [response] ListFindingTypeStatsResponse + */ + + /** + * Calls ListFindingTypeStats. + * @function listFindingTypeStats + * @memberof google.cloud.websecurityscanner.v1beta.WebSecurityScanner + * @instance + * @param {google.cloud.websecurityscanner.v1beta.IListFindingTypeStatsRequest} request ListFindingTypeStatsRequest message or plain object + * @param {google.cloud.websecurityscanner.v1beta.WebSecurityScanner.ListFindingTypeStatsCallback} callback Node-style callback called with the error, if any, and ListFindingTypeStatsResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(WebSecurityScanner.prototype.listFindingTypeStats = function listFindingTypeStats(request, callback) { + return this.rpcCall(listFindingTypeStats, $root.google.cloud.websecurityscanner.v1beta.ListFindingTypeStatsRequest, $root.google.cloud.websecurityscanner.v1beta.ListFindingTypeStatsResponse, request, callback); + }, "name", { value: "ListFindingTypeStats" }); + + /** + * Calls ListFindingTypeStats. + * @function listFindingTypeStats + * @memberof google.cloud.websecurityscanner.v1beta.WebSecurityScanner + * @instance + * @param {google.cloud.websecurityscanner.v1beta.IListFindingTypeStatsRequest} request ListFindingTypeStatsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + return WebSecurityScanner; + })(); + + v1beta.CreateScanConfigRequest = (function() { + + /** + * Properties of a CreateScanConfigRequest. + * @memberof google.cloud.websecurityscanner.v1beta + * @interface ICreateScanConfigRequest + * @property {string|null} [parent] CreateScanConfigRequest parent + * @property {google.cloud.websecurityscanner.v1beta.IScanConfig|null} [scanConfig] CreateScanConfigRequest scanConfig + */ + + /** + * Constructs a new CreateScanConfigRequest. + * @memberof google.cloud.websecurityscanner.v1beta + * @classdesc Represents a CreateScanConfigRequest. + * @implements ICreateScanConfigRequest + * @constructor + * @param {google.cloud.websecurityscanner.v1beta.ICreateScanConfigRequest=} [properties] Properties to set + */ + function CreateScanConfigRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * CreateScanConfigRequest parent. + * @member {string} parent + * @memberof google.cloud.websecurityscanner.v1beta.CreateScanConfigRequest + * @instance + */ + CreateScanConfigRequest.prototype.parent = ""; + + /** + * CreateScanConfigRequest scanConfig. + * @member {google.cloud.websecurityscanner.v1beta.IScanConfig|null|undefined} scanConfig + * @memberof google.cloud.websecurityscanner.v1beta.CreateScanConfigRequest + * @instance + */ + CreateScanConfigRequest.prototype.scanConfig = null; + + /** + * Creates a new CreateScanConfigRequest instance using the specified properties. + * @function create + * @memberof google.cloud.websecurityscanner.v1beta.CreateScanConfigRequest + * @static + * @param {google.cloud.websecurityscanner.v1beta.ICreateScanConfigRequest=} [properties] Properties to set + * @returns {google.cloud.websecurityscanner.v1beta.CreateScanConfigRequest} CreateScanConfigRequest instance + */ + CreateScanConfigRequest.create = function create(properties) { + return new CreateScanConfigRequest(properties); + }; + + /** + * Encodes the specified CreateScanConfigRequest message. Does not implicitly {@link google.cloud.websecurityscanner.v1beta.CreateScanConfigRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.websecurityscanner.v1beta.CreateScanConfigRequest + * @static + * @param {google.cloud.websecurityscanner.v1beta.ICreateScanConfigRequest} message CreateScanConfigRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateScanConfigRequest.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.scanConfig != null && Object.hasOwnProperty.call(message, "scanConfig")) + $root.google.cloud.websecurityscanner.v1beta.ScanConfig.encode(message.scanConfig, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified CreateScanConfigRequest message, length delimited. Does not implicitly {@link google.cloud.websecurityscanner.v1beta.CreateScanConfigRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.websecurityscanner.v1beta.CreateScanConfigRequest + * @static + * @param {google.cloud.websecurityscanner.v1beta.ICreateScanConfigRequest} message CreateScanConfigRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateScanConfigRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CreateScanConfigRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.websecurityscanner.v1beta.CreateScanConfigRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.websecurityscanner.v1beta.CreateScanConfigRequest} CreateScanConfigRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateScanConfigRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.websecurityscanner.v1beta.CreateScanConfigRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + message.scanConfig = $root.google.cloud.websecurityscanner.v1beta.ScanConfig.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CreateScanConfigRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.websecurityscanner.v1beta.CreateScanConfigRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.websecurityscanner.v1beta.CreateScanConfigRequest} CreateScanConfigRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateScanConfigRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CreateScanConfigRequest message. + * @function verify + * @memberof google.cloud.websecurityscanner.v1beta.CreateScanConfigRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CreateScanConfigRequest.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.scanConfig != null && message.hasOwnProperty("scanConfig")) { + var error = $root.google.cloud.websecurityscanner.v1beta.ScanConfig.verify(message.scanConfig); + if (error) + return "scanConfig." + error; + } + return null; + }; + + /** + * Creates a CreateScanConfigRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.websecurityscanner.v1beta.CreateScanConfigRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.websecurityscanner.v1beta.CreateScanConfigRequest} CreateScanConfigRequest + */ + CreateScanConfigRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.websecurityscanner.v1beta.CreateScanConfigRequest) + return object; + var message = new $root.google.cloud.websecurityscanner.v1beta.CreateScanConfigRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.scanConfig != null) { + if (typeof object.scanConfig !== "object") + throw TypeError(".google.cloud.websecurityscanner.v1beta.CreateScanConfigRequest.scanConfig: object expected"); + message.scanConfig = $root.google.cloud.websecurityscanner.v1beta.ScanConfig.fromObject(object.scanConfig); + } + return message; + }; + + /** + * Creates a plain object from a CreateScanConfigRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.websecurityscanner.v1beta.CreateScanConfigRequest + * @static + * @param {google.cloud.websecurityscanner.v1beta.CreateScanConfigRequest} message CreateScanConfigRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CreateScanConfigRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.scanConfig = null; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.scanConfig != null && message.hasOwnProperty("scanConfig")) + object.scanConfig = $root.google.cloud.websecurityscanner.v1beta.ScanConfig.toObject(message.scanConfig, options); + return object; + }; + + /** + * Converts this CreateScanConfigRequest to JSON. + * @function toJSON + * @memberof google.cloud.websecurityscanner.v1beta.CreateScanConfigRequest + * @instance + * @returns {Object.} JSON object + */ + CreateScanConfigRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CreateScanConfigRequest + * @function getTypeUrl + * @memberof google.cloud.websecurityscanner.v1beta.CreateScanConfigRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CreateScanConfigRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.websecurityscanner.v1beta.CreateScanConfigRequest"; + }; + + return CreateScanConfigRequest; + })(); + + v1beta.DeleteScanConfigRequest = (function() { + + /** + * Properties of a DeleteScanConfigRequest. + * @memberof google.cloud.websecurityscanner.v1beta + * @interface IDeleteScanConfigRequest + * @property {string|null} [name] DeleteScanConfigRequest name + */ + + /** + * Constructs a new DeleteScanConfigRequest. + * @memberof google.cloud.websecurityscanner.v1beta + * @classdesc Represents a DeleteScanConfigRequest. + * @implements IDeleteScanConfigRequest + * @constructor + * @param {google.cloud.websecurityscanner.v1beta.IDeleteScanConfigRequest=} [properties] Properties to set + */ + function DeleteScanConfigRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * DeleteScanConfigRequest name. + * @member {string} name + * @memberof google.cloud.websecurityscanner.v1beta.DeleteScanConfigRequest + * @instance + */ + DeleteScanConfigRequest.prototype.name = ""; + + /** + * Creates a new DeleteScanConfigRequest instance using the specified properties. + * @function create + * @memberof google.cloud.websecurityscanner.v1beta.DeleteScanConfigRequest + * @static + * @param {google.cloud.websecurityscanner.v1beta.IDeleteScanConfigRequest=} [properties] Properties to set + * @returns {google.cloud.websecurityscanner.v1beta.DeleteScanConfigRequest} DeleteScanConfigRequest instance + */ + DeleteScanConfigRequest.create = function create(properties) { + return new DeleteScanConfigRequest(properties); + }; + + /** + * Encodes the specified DeleteScanConfigRequest message. Does not implicitly {@link google.cloud.websecurityscanner.v1beta.DeleteScanConfigRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.websecurityscanner.v1beta.DeleteScanConfigRequest + * @static + * @param {google.cloud.websecurityscanner.v1beta.IDeleteScanConfigRequest} message DeleteScanConfigRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteScanConfigRequest.encode = function encode(message, writer) { + 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 DeleteScanConfigRequest message, length delimited. Does not implicitly {@link google.cloud.websecurityscanner.v1beta.DeleteScanConfigRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.websecurityscanner.v1beta.DeleteScanConfigRequest + * @static + * @param {google.cloud.websecurityscanner.v1beta.IDeleteScanConfigRequest} message DeleteScanConfigRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteScanConfigRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DeleteScanConfigRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.websecurityscanner.v1beta.DeleteScanConfigRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.websecurityscanner.v1beta.DeleteScanConfigRequest} DeleteScanConfigRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteScanConfigRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.websecurityscanner.v1beta.DeleteScanConfigRequest(); + 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 DeleteScanConfigRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.websecurityscanner.v1beta.DeleteScanConfigRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.websecurityscanner.v1beta.DeleteScanConfigRequest} DeleteScanConfigRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteScanConfigRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DeleteScanConfigRequest message. + * @function verify + * @memberof google.cloud.websecurityscanner.v1beta.DeleteScanConfigRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DeleteScanConfigRequest.verify = function verify(message) { + if (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 DeleteScanConfigRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.websecurityscanner.v1beta.DeleteScanConfigRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.websecurityscanner.v1beta.DeleteScanConfigRequest} DeleteScanConfigRequest + */ + DeleteScanConfigRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.websecurityscanner.v1beta.DeleteScanConfigRequest) + return object; + var message = new $root.google.cloud.websecurityscanner.v1beta.DeleteScanConfigRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a DeleteScanConfigRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.websecurityscanner.v1beta.DeleteScanConfigRequest + * @static + * @param {google.cloud.websecurityscanner.v1beta.DeleteScanConfigRequest} message DeleteScanConfigRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DeleteScanConfigRequest.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 DeleteScanConfigRequest to JSON. + * @function toJSON + * @memberof google.cloud.websecurityscanner.v1beta.DeleteScanConfigRequest + * @instance + * @returns {Object.} JSON object + */ + DeleteScanConfigRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DeleteScanConfigRequest + * @function getTypeUrl + * @memberof google.cloud.websecurityscanner.v1beta.DeleteScanConfigRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DeleteScanConfigRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.websecurityscanner.v1beta.DeleteScanConfigRequest"; + }; + + return DeleteScanConfigRequest; + })(); + + v1beta.GetScanConfigRequest = (function() { + + /** + * Properties of a GetScanConfigRequest. + * @memberof google.cloud.websecurityscanner.v1beta + * @interface IGetScanConfigRequest + * @property {string|null} [name] GetScanConfigRequest name + */ + + /** + * Constructs a new GetScanConfigRequest. + * @memberof google.cloud.websecurityscanner.v1beta + * @classdesc Represents a GetScanConfigRequest. + * @implements IGetScanConfigRequest + * @constructor + * @param {google.cloud.websecurityscanner.v1beta.IGetScanConfigRequest=} [properties] Properties to set + */ + function GetScanConfigRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetScanConfigRequest name. + * @member {string} name + * @memberof google.cloud.websecurityscanner.v1beta.GetScanConfigRequest + * @instance + */ + GetScanConfigRequest.prototype.name = ""; + + /** + * Creates a new GetScanConfigRequest instance using the specified properties. + * @function create + * @memberof google.cloud.websecurityscanner.v1beta.GetScanConfigRequest + * @static + * @param {google.cloud.websecurityscanner.v1beta.IGetScanConfigRequest=} [properties] Properties to set + * @returns {google.cloud.websecurityscanner.v1beta.GetScanConfigRequest} GetScanConfigRequest instance + */ + GetScanConfigRequest.create = function create(properties) { + return new GetScanConfigRequest(properties); + }; + + /** + * Encodes the specified GetScanConfigRequest message. Does not implicitly {@link google.cloud.websecurityscanner.v1beta.GetScanConfigRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.websecurityscanner.v1beta.GetScanConfigRequest + * @static + * @param {google.cloud.websecurityscanner.v1beta.IGetScanConfigRequest} message GetScanConfigRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetScanConfigRequest.encode = function encode(message, writer) { + 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 GetScanConfigRequest message, length delimited. Does not implicitly {@link google.cloud.websecurityscanner.v1beta.GetScanConfigRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.websecurityscanner.v1beta.GetScanConfigRequest + * @static + * @param {google.cloud.websecurityscanner.v1beta.IGetScanConfigRequest} message GetScanConfigRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetScanConfigRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetScanConfigRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.websecurityscanner.v1beta.GetScanConfigRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.websecurityscanner.v1beta.GetScanConfigRequest} GetScanConfigRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetScanConfigRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.websecurityscanner.v1beta.GetScanConfigRequest(); + 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 GetScanConfigRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.websecurityscanner.v1beta.GetScanConfigRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.websecurityscanner.v1beta.GetScanConfigRequest} GetScanConfigRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetScanConfigRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetScanConfigRequest message. + * @function verify + * @memberof google.cloud.websecurityscanner.v1beta.GetScanConfigRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetScanConfigRequest.verify = function verify(message) { + if (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 GetScanConfigRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.websecurityscanner.v1beta.GetScanConfigRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.websecurityscanner.v1beta.GetScanConfigRequest} GetScanConfigRequest + */ + GetScanConfigRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.websecurityscanner.v1beta.GetScanConfigRequest) + return object; + var message = new $root.google.cloud.websecurityscanner.v1beta.GetScanConfigRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a GetScanConfigRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.websecurityscanner.v1beta.GetScanConfigRequest + * @static + * @param {google.cloud.websecurityscanner.v1beta.GetScanConfigRequest} message GetScanConfigRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetScanConfigRequest.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 GetScanConfigRequest to JSON. + * @function toJSON + * @memberof google.cloud.websecurityscanner.v1beta.GetScanConfigRequest + * @instance + * @returns {Object.} JSON object + */ + GetScanConfigRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GetScanConfigRequest + * @function getTypeUrl + * @memberof google.cloud.websecurityscanner.v1beta.GetScanConfigRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GetScanConfigRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.websecurityscanner.v1beta.GetScanConfigRequest"; + }; + + return GetScanConfigRequest; + })(); + + v1beta.ListScanConfigsRequest = (function() { + + /** + * Properties of a ListScanConfigsRequest. + * @memberof google.cloud.websecurityscanner.v1beta + * @interface IListScanConfigsRequest + * @property {string|null} [parent] ListScanConfigsRequest parent + * @property {string|null} [pageToken] ListScanConfigsRequest pageToken + * @property {number|null} [pageSize] ListScanConfigsRequest pageSize + */ + + /** + * Constructs a new ListScanConfigsRequest. + * @memberof google.cloud.websecurityscanner.v1beta + * @classdesc Represents a ListScanConfigsRequest. + * @implements IListScanConfigsRequest + * @constructor + * @param {google.cloud.websecurityscanner.v1beta.IListScanConfigsRequest=} [properties] Properties to set + */ + function ListScanConfigsRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListScanConfigsRequest parent. + * @member {string} parent + * @memberof google.cloud.websecurityscanner.v1beta.ListScanConfigsRequest + * @instance + */ + ListScanConfigsRequest.prototype.parent = ""; + + /** + * ListScanConfigsRequest pageToken. + * @member {string} pageToken + * @memberof google.cloud.websecurityscanner.v1beta.ListScanConfigsRequest + * @instance + */ + ListScanConfigsRequest.prototype.pageToken = ""; + + /** + * ListScanConfigsRequest pageSize. + * @member {number} pageSize + * @memberof google.cloud.websecurityscanner.v1beta.ListScanConfigsRequest + * @instance + */ + ListScanConfigsRequest.prototype.pageSize = 0; + + /** + * Creates a new ListScanConfigsRequest instance using the specified properties. + * @function create + * @memberof google.cloud.websecurityscanner.v1beta.ListScanConfigsRequest + * @static + * @param {google.cloud.websecurityscanner.v1beta.IListScanConfigsRequest=} [properties] Properties to set + * @returns {google.cloud.websecurityscanner.v1beta.ListScanConfigsRequest} ListScanConfigsRequest instance + */ + ListScanConfigsRequest.create = function create(properties) { + return new ListScanConfigsRequest(properties); + }; + + /** + * Encodes the specified ListScanConfigsRequest message. Does not implicitly {@link google.cloud.websecurityscanner.v1beta.ListScanConfigsRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.websecurityscanner.v1beta.ListScanConfigsRequest + * @static + * @param {google.cloud.websecurityscanner.v1beta.IListScanConfigsRequest} message ListScanConfigsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListScanConfigsRequest.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.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.pageToken); + if (message.pageSize != null && Object.hasOwnProperty.call(message, "pageSize")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.pageSize); + return writer; + }; + + /** + * Encodes the specified ListScanConfigsRequest message, length delimited. Does not implicitly {@link google.cloud.websecurityscanner.v1beta.ListScanConfigsRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.websecurityscanner.v1beta.ListScanConfigsRequest + * @static + * @param {google.cloud.websecurityscanner.v1beta.IListScanConfigsRequest} message ListScanConfigsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListScanConfigsRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListScanConfigsRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.websecurityscanner.v1beta.ListScanConfigsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.websecurityscanner.v1beta.ListScanConfigsRequest} ListScanConfigsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListScanConfigsRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.websecurityscanner.v1beta.ListScanConfigsRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + message.pageToken = reader.string(); + break; + } + case 3: { + message.pageSize = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListScanConfigsRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.websecurityscanner.v1beta.ListScanConfigsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.websecurityscanner.v1beta.ListScanConfigsRequest} ListScanConfigsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListScanConfigsRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListScanConfigsRequest message. + * @function verify + * @memberof google.cloud.websecurityscanner.v1beta.ListScanConfigsRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListScanConfigsRequest.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.pageToken != null && message.hasOwnProperty("pageToken")) + if (!$util.isString(message.pageToken)) + return "pageToken: string expected"; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + if (!$util.isInteger(message.pageSize)) + return "pageSize: integer expected"; + return null; + }; + + /** + * Creates a ListScanConfigsRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.websecurityscanner.v1beta.ListScanConfigsRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.websecurityscanner.v1beta.ListScanConfigsRequest} ListScanConfigsRequest + */ + ListScanConfigsRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.websecurityscanner.v1beta.ListScanConfigsRequest) + return object; + var message = new $root.google.cloud.websecurityscanner.v1beta.ListScanConfigsRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.pageToken != null) + message.pageToken = String(object.pageToken); + if (object.pageSize != null) + message.pageSize = object.pageSize | 0; + return message; + }; + + /** + * Creates a plain object from a ListScanConfigsRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.websecurityscanner.v1beta.ListScanConfigsRequest + * @static + * @param {google.cloud.websecurityscanner.v1beta.ListScanConfigsRequest} message ListScanConfigsRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListScanConfigsRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.pageToken = ""; + object.pageSize = 0; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + object.pageToken = message.pageToken; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + object.pageSize = message.pageSize; + return object; + }; + + /** + * Converts this ListScanConfigsRequest to JSON. + * @function toJSON + * @memberof google.cloud.websecurityscanner.v1beta.ListScanConfigsRequest + * @instance + * @returns {Object.} JSON object + */ + ListScanConfigsRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListScanConfigsRequest + * @function getTypeUrl + * @memberof google.cloud.websecurityscanner.v1beta.ListScanConfigsRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListScanConfigsRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.websecurityscanner.v1beta.ListScanConfigsRequest"; + }; + + return ListScanConfigsRequest; + })(); + + v1beta.UpdateScanConfigRequest = (function() { + + /** + * Properties of an UpdateScanConfigRequest. + * @memberof google.cloud.websecurityscanner.v1beta + * @interface IUpdateScanConfigRequest + * @property {google.cloud.websecurityscanner.v1beta.IScanConfig|null} [scanConfig] UpdateScanConfigRequest scanConfig + * @property {google.protobuf.IFieldMask|null} [updateMask] UpdateScanConfigRequest updateMask + */ + + /** + * Constructs a new UpdateScanConfigRequest. + * @memberof google.cloud.websecurityscanner.v1beta + * @classdesc Represents an UpdateScanConfigRequest. + * @implements IUpdateScanConfigRequest + * @constructor + * @param {google.cloud.websecurityscanner.v1beta.IUpdateScanConfigRequest=} [properties] Properties to set + */ + function UpdateScanConfigRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * UpdateScanConfigRequest scanConfig. + * @member {google.cloud.websecurityscanner.v1beta.IScanConfig|null|undefined} scanConfig + * @memberof google.cloud.websecurityscanner.v1beta.UpdateScanConfigRequest + * @instance + */ + UpdateScanConfigRequest.prototype.scanConfig = null; + + /** + * UpdateScanConfigRequest updateMask. + * @member {google.protobuf.IFieldMask|null|undefined} updateMask + * @memberof google.cloud.websecurityscanner.v1beta.UpdateScanConfigRequest + * @instance + */ + UpdateScanConfigRequest.prototype.updateMask = null; + + /** + * Creates a new UpdateScanConfigRequest instance using the specified properties. + * @function create + * @memberof google.cloud.websecurityscanner.v1beta.UpdateScanConfigRequest + * @static + * @param {google.cloud.websecurityscanner.v1beta.IUpdateScanConfigRequest=} [properties] Properties to set + * @returns {google.cloud.websecurityscanner.v1beta.UpdateScanConfigRequest} UpdateScanConfigRequest instance + */ + UpdateScanConfigRequest.create = function create(properties) { + return new UpdateScanConfigRequest(properties); + }; + + /** + * Encodes the specified UpdateScanConfigRequest message. Does not implicitly {@link google.cloud.websecurityscanner.v1beta.UpdateScanConfigRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.websecurityscanner.v1beta.UpdateScanConfigRequest + * @static + * @param {google.cloud.websecurityscanner.v1beta.IUpdateScanConfigRequest} message UpdateScanConfigRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateScanConfigRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.scanConfig != null && Object.hasOwnProperty.call(message, "scanConfig")) + $root.google.cloud.websecurityscanner.v1beta.ScanConfig.encode(message.scanConfig, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.updateMask != null && Object.hasOwnProperty.call(message, "updateMask")) + $root.google.protobuf.FieldMask.encode(message.updateMask, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified UpdateScanConfigRequest message, length delimited. Does not implicitly {@link google.cloud.websecurityscanner.v1beta.UpdateScanConfigRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.websecurityscanner.v1beta.UpdateScanConfigRequest + * @static + * @param {google.cloud.websecurityscanner.v1beta.IUpdateScanConfigRequest} message UpdateScanConfigRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateScanConfigRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an UpdateScanConfigRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.websecurityscanner.v1beta.UpdateScanConfigRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.websecurityscanner.v1beta.UpdateScanConfigRequest} UpdateScanConfigRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateScanConfigRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.websecurityscanner.v1beta.UpdateScanConfigRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 2: { + message.scanConfig = $root.google.cloud.websecurityscanner.v1beta.ScanConfig.decode(reader, reader.uint32()); + break; + } + case 3: { + message.updateMask = $root.google.protobuf.FieldMask.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an UpdateScanConfigRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.websecurityscanner.v1beta.UpdateScanConfigRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.websecurityscanner.v1beta.UpdateScanConfigRequest} UpdateScanConfigRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateScanConfigRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an UpdateScanConfigRequest message. + * @function verify + * @memberof google.cloud.websecurityscanner.v1beta.UpdateScanConfigRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + UpdateScanConfigRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.scanConfig != null && message.hasOwnProperty("scanConfig")) { + var error = $root.google.cloud.websecurityscanner.v1beta.ScanConfig.verify(message.scanConfig); + if (error) + return "scanConfig." + 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 UpdateScanConfigRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.websecurityscanner.v1beta.UpdateScanConfigRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.websecurityscanner.v1beta.UpdateScanConfigRequest} UpdateScanConfigRequest + */ + UpdateScanConfigRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.websecurityscanner.v1beta.UpdateScanConfigRequest) + return object; + var message = new $root.google.cloud.websecurityscanner.v1beta.UpdateScanConfigRequest(); + if (object.scanConfig != null) { + if (typeof object.scanConfig !== "object") + throw TypeError(".google.cloud.websecurityscanner.v1beta.UpdateScanConfigRequest.scanConfig: object expected"); + message.scanConfig = $root.google.cloud.websecurityscanner.v1beta.ScanConfig.fromObject(object.scanConfig); + } + if (object.updateMask != null) { + if (typeof object.updateMask !== "object") + throw TypeError(".google.cloud.websecurityscanner.v1beta.UpdateScanConfigRequest.updateMask: object expected"); + message.updateMask = $root.google.protobuf.FieldMask.fromObject(object.updateMask); + } + return message; + }; + + /** + * Creates a plain object from an UpdateScanConfigRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.websecurityscanner.v1beta.UpdateScanConfigRequest + * @static + * @param {google.cloud.websecurityscanner.v1beta.UpdateScanConfigRequest} message UpdateScanConfigRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + UpdateScanConfigRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.scanConfig = null; + object.updateMask = null; + } + if (message.scanConfig != null && message.hasOwnProperty("scanConfig")) + object.scanConfig = $root.google.cloud.websecurityscanner.v1beta.ScanConfig.toObject(message.scanConfig, options); + if (message.updateMask != null && message.hasOwnProperty("updateMask")) + object.updateMask = $root.google.protobuf.FieldMask.toObject(message.updateMask, options); + return object; + }; + + /** + * Converts this UpdateScanConfigRequest to JSON. + * @function toJSON + * @memberof google.cloud.websecurityscanner.v1beta.UpdateScanConfigRequest + * @instance + * @returns {Object.} JSON object + */ + UpdateScanConfigRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for UpdateScanConfigRequest + * @function getTypeUrl + * @memberof google.cloud.websecurityscanner.v1beta.UpdateScanConfigRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + UpdateScanConfigRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.websecurityscanner.v1beta.UpdateScanConfigRequest"; + }; + + return UpdateScanConfigRequest; + })(); + + v1beta.ListScanConfigsResponse = (function() { + + /** + * Properties of a ListScanConfigsResponse. + * @memberof google.cloud.websecurityscanner.v1beta + * @interface IListScanConfigsResponse + * @property {Array.|null} [scanConfigs] ListScanConfigsResponse scanConfigs + * @property {string|null} [nextPageToken] ListScanConfigsResponse nextPageToken + */ + + /** + * Constructs a new ListScanConfigsResponse. + * @memberof google.cloud.websecurityscanner.v1beta + * @classdesc Represents a ListScanConfigsResponse. + * @implements IListScanConfigsResponse + * @constructor + * @param {google.cloud.websecurityscanner.v1beta.IListScanConfigsResponse=} [properties] Properties to set + */ + function ListScanConfigsResponse(properties) { + this.scanConfigs = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListScanConfigsResponse scanConfigs. + * @member {Array.} scanConfigs + * @memberof google.cloud.websecurityscanner.v1beta.ListScanConfigsResponse + * @instance + */ + ListScanConfigsResponse.prototype.scanConfigs = $util.emptyArray; + + /** + * ListScanConfigsResponse nextPageToken. + * @member {string} nextPageToken + * @memberof google.cloud.websecurityscanner.v1beta.ListScanConfigsResponse + * @instance + */ + ListScanConfigsResponse.prototype.nextPageToken = ""; + + /** + * Creates a new ListScanConfigsResponse instance using the specified properties. + * @function create + * @memberof google.cloud.websecurityscanner.v1beta.ListScanConfigsResponse + * @static + * @param {google.cloud.websecurityscanner.v1beta.IListScanConfigsResponse=} [properties] Properties to set + * @returns {google.cloud.websecurityscanner.v1beta.ListScanConfigsResponse} ListScanConfigsResponse instance + */ + ListScanConfigsResponse.create = function create(properties) { + return new ListScanConfigsResponse(properties); + }; + + /** + * Encodes the specified ListScanConfigsResponse message. Does not implicitly {@link google.cloud.websecurityscanner.v1beta.ListScanConfigsResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.websecurityscanner.v1beta.ListScanConfigsResponse + * @static + * @param {google.cloud.websecurityscanner.v1beta.IListScanConfigsResponse} message ListScanConfigsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListScanConfigsResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.scanConfigs != null && message.scanConfigs.length) + for (var i = 0; i < message.scanConfigs.length; ++i) + $root.google.cloud.websecurityscanner.v1beta.ScanConfig.encode(message.scanConfigs[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 ListScanConfigsResponse message, length delimited. Does not implicitly {@link google.cloud.websecurityscanner.v1beta.ListScanConfigsResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.websecurityscanner.v1beta.ListScanConfigsResponse + * @static + * @param {google.cloud.websecurityscanner.v1beta.IListScanConfigsResponse} message ListScanConfigsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListScanConfigsResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListScanConfigsResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.websecurityscanner.v1beta.ListScanConfigsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.websecurityscanner.v1beta.ListScanConfigsResponse} ListScanConfigsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListScanConfigsResponse.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.websecurityscanner.v1beta.ListScanConfigsResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.scanConfigs && message.scanConfigs.length)) + message.scanConfigs = []; + message.scanConfigs.push($root.google.cloud.websecurityscanner.v1beta.ScanConfig.decode(reader, reader.uint32())); + break; + } + case 2: { + message.nextPageToken = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListScanConfigsResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.websecurityscanner.v1beta.ListScanConfigsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.websecurityscanner.v1beta.ListScanConfigsResponse} ListScanConfigsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListScanConfigsResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListScanConfigsResponse message. + * @function verify + * @memberof google.cloud.websecurityscanner.v1beta.ListScanConfigsResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListScanConfigsResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.scanConfigs != null && message.hasOwnProperty("scanConfigs")) { + if (!Array.isArray(message.scanConfigs)) + return "scanConfigs: array expected"; + for (var i = 0; i < message.scanConfigs.length; ++i) { + var error = $root.google.cloud.websecurityscanner.v1beta.ScanConfig.verify(message.scanConfigs[i]); + if (error) + return "scanConfigs." + error; + } + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; + return null; + }; + + /** + * Creates a ListScanConfigsResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.websecurityscanner.v1beta.ListScanConfigsResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.websecurityscanner.v1beta.ListScanConfigsResponse} ListScanConfigsResponse + */ + ListScanConfigsResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.websecurityscanner.v1beta.ListScanConfigsResponse) + return object; + var message = new $root.google.cloud.websecurityscanner.v1beta.ListScanConfigsResponse(); + if (object.scanConfigs) { + if (!Array.isArray(object.scanConfigs)) + throw TypeError(".google.cloud.websecurityscanner.v1beta.ListScanConfigsResponse.scanConfigs: array expected"); + message.scanConfigs = []; + for (var i = 0; i < object.scanConfigs.length; ++i) { + if (typeof object.scanConfigs[i] !== "object") + throw TypeError(".google.cloud.websecurityscanner.v1beta.ListScanConfigsResponse.scanConfigs: object expected"); + message.scanConfigs[i] = $root.google.cloud.websecurityscanner.v1beta.ScanConfig.fromObject(object.scanConfigs[i]); + } + } + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + return message; + }; + + /** + * Creates a plain object from a ListScanConfigsResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.websecurityscanner.v1beta.ListScanConfigsResponse + * @static + * @param {google.cloud.websecurityscanner.v1beta.ListScanConfigsResponse} message ListScanConfigsResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListScanConfigsResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.scanConfigs = []; + if (options.defaults) + object.nextPageToken = ""; + if (message.scanConfigs && message.scanConfigs.length) { + object.scanConfigs = []; + for (var j = 0; j < message.scanConfigs.length; ++j) + object.scanConfigs[j] = $root.google.cloud.websecurityscanner.v1beta.ScanConfig.toObject(message.scanConfigs[j], options); + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + object.nextPageToken = message.nextPageToken; + return object; + }; + + /** + * Converts this ListScanConfigsResponse to JSON. + * @function toJSON + * @memberof google.cloud.websecurityscanner.v1beta.ListScanConfigsResponse + * @instance + * @returns {Object.} JSON object + */ + ListScanConfigsResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListScanConfigsResponse + * @function getTypeUrl + * @memberof google.cloud.websecurityscanner.v1beta.ListScanConfigsResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListScanConfigsResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.websecurityscanner.v1beta.ListScanConfigsResponse"; + }; + + return ListScanConfigsResponse; + })(); + + v1beta.StartScanRunRequest = (function() { + + /** + * Properties of a StartScanRunRequest. + * @memberof google.cloud.websecurityscanner.v1beta + * @interface IStartScanRunRequest + * @property {string|null} [name] StartScanRunRequest name + */ + + /** + * Constructs a new StartScanRunRequest. + * @memberof google.cloud.websecurityscanner.v1beta + * @classdesc Represents a StartScanRunRequest. + * @implements IStartScanRunRequest + * @constructor + * @param {google.cloud.websecurityscanner.v1beta.IStartScanRunRequest=} [properties] Properties to set + */ + function StartScanRunRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * StartScanRunRequest name. + * @member {string} name + * @memberof google.cloud.websecurityscanner.v1beta.StartScanRunRequest + * @instance + */ + StartScanRunRequest.prototype.name = ""; + + /** + * Creates a new StartScanRunRequest instance using the specified properties. + * @function create + * @memberof google.cloud.websecurityscanner.v1beta.StartScanRunRequest + * @static + * @param {google.cloud.websecurityscanner.v1beta.IStartScanRunRequest=} [properties] Properties to set + * @returns {google.cloud.websecurityscanner.v1beta.StartScanRunRequest} StartScanRunRequest instance + */ + StartScanRunRequest.create = function create(properties) { + return new StartScanRunRequest(properties); + }; + + /** + * Encodes the specified StartScanRunRequest message. Does not implicitly {@link google.cloud.websecurityscanner.v1beta.StartScanRunRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.websecurityscanner.v1beta.StartScanRunRequest + * @static + * @param {google.cloud.websecurityscanner.v1beta.IStartScanRunRequest} message StartScanRunRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + StartScanRunRequest.encode = function encode(message, writer) { + 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 StartScanRunRequest message, length delimited. Does not implicitly {@link google.cloud.websecurityscanner.v1beta.StartScanRunRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.websecurityscanner.v1beta.StartScanRunRequest + * @static + * @param {google.cloud.websecurityscanner.v1beta.IStartScanRunRequest} message StartScanRunRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + StartScanRunRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a StartScanRunRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.websecurityscanner.v1beta.StartScanRunRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.websecurityscanner.v1beta.StartScanRunRequest} StartScanRunRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + StartScanRunRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.websecurityscanner.v1beta.StartScanRunRequest(); + 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 StartScanRunRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.websecurityscanner.v1beta.StartScanRunRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.websecurityscanner.v1beta.StartScanRunRequest} StartScanRunRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + StartScanRunRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a StartScanRunRequest message. + * @function verify + * @memberof google.cloud.websecurityscanner.v1beta.StartScanRunRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + StartScanRunRequest.verify = function verify(message) { + if (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 StartScanRunRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.websecurityscanner.v1beta.StartScanRunRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.websecurityscanner.v1beta.StartScanRunRequest} StartScanRunRequest + */ + StartScanRunRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.websecurityscanner.v1beta.StartScanRunRequest) + return object; + var message = new $root.google.cloud.websecurityscanner.v1beta.StartScanRunRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a StartScanRunRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.websecurityscanner.v1beta.StartScanRunRequest + * @static + * @param {google.cloud.websecurityscanner.v1beta.StartScanRunRequest} message StartScanRunRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + StartScanRunRequest.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 StartScanRunRequest to JSON. + * @function toJSON + * @memberof google.cloud.websecurityscanner.v1beta.StartScanRunRequest + * @instance + * @returns {Object.} JSON object + */ + StartScanRunRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for StartScanRunRequest + * @function getTypeUrl + * @memberof google.cloud.websecurityscanner.v1beta.StartScanRunRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + StartScanRunRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.websecurityscanner.v1beta.StartScanRunRequest"; + }; + + return StartScanRunRequest; + })(); + + v1beta.GetScanRunRequest = (function() { + + /** + * Properties of a GetScanRunRequest. + * @memberof google.cloud.websecurityscanner.v1beta + * @interface IGetScanRunRequest + * @property {string|null} [name] GetScanRunRequest name + */ + + /** + * Constructs a new GetScanRunRequest. + * @memberof google.cloud.websecurityscanner.v1beta + * @classdesc Represents a GetScanRunRequest. + * @implements IGetScanRunRequest + * @constructor + * @param {google.cloud.websecurityscanner.v1beta.IGetScanRunRequest=} [properties] Properties to set + */ + function GetScanRunRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetScanRunRequest name. + * @member {string} name + * @memberof google.cloud.websecurityscanner.v1beta.GetScanRunRequest + * @instance + */ + GetScanRunRequest.prototype.name = ""; + + /** + * Creates a new GetScanRunRequest instance using the specified properties. + * @function create + * @memberof google.cloud.websecurityscanner.v1beta.GetScanRunRequest + * @static + * @param {google.cloud.websecurityscanner.v1beta.IGetScanRunRequest=} [properties] Properties to set + * @returns {google.cloud.websecurityscanner.v1beta.GetScanRunRequest} GetScanRunRequest instance + */ + GetScanRunRequest.create = function create(properties) { + return new GetScanRunRequest(properties); + }; + + /** + * Encodes the specified GetScanRunRequest message. Does not implicitly {@link google.cloud.websecurityscanner.v1beta.GetScanRunRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.websecurityscanner.v1beta.GetScanRunRequest + * @static + * @param {google.cloud.websecurityscanner.v1beta.IGetScanRunRequest} message GetScanRunRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetScanRunRequest.encode = function encode(message, writer) { + 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 GetScanRunRequest message, length delimited. Does not implicitly {@link google.cloud.websecurityscanner.v1beta.GetScanRunRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.websecurityscanner.v1beta.GetScanRunRequest + * @static + * @param {google.cloud.websecurityscanner.v1beta.IGetScanRunRequest} message GetScanRunRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetScanRunRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetScanRunRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.websecurityscanner.v1beta.GetScanRunRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.websecurityscanner.v1beta.GetScanRunRequest} GetScanRunRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetScanRunRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.websecurityscanner.v1beta.GetScanRunRequest(); + 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 GetScanRunRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.websecurityscanner.v1beta.GetScanRunRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.websecurityscanner.v1beta.GetScanRunRequest} GetScanRunRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetScanRunRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetScanRunRequest message. + * @function verify + * @memberof google.cloud.websecurityscanner.v1beta.GetScanRunRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetScanRunRequest.verify = function verify(message) { + if (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 GetScanRunRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.websecurityscanner.v1beta.GetScanRunRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.websecurityscanner.v1beta.GetScanRunRequest} GetScanRunRequest + */ + GetScanRunRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.websecurityscanner.v1beta.GetScanRunRequest) + return object; + var message = new $root.google.cloud.websecurityscanner.v1beta.GetScanRunRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a GetScanRunRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.websecurityscanner.v1beta.GetScanRunRequest + * @static + * @param {google.cloud.websecurityscanner.v1beta.GetScanRunRequest} message GetScanRunRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetScanRunRequest.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 GetScanRunRequest to JSON. + * @function toJSON + * @memberof google.cloud.websecurityscanner.v1beta.GetScanRunRequest + * @instance + * @returns {Object.} JSON object + */ + GetScanRunRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GetScanRunRequest + * @function getTypeUrl + * @memberof google.cloud.websecurityscanner.v1beta.GetScanRunRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GetScanRunRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.websecurityscanner.v1beta.GetScanRunRequest"; + }; + + return GetScanRunRequest; + })(); + + v1beta.ListScanRunsRequest = (function() { + + /** + * Properties of a ListScanRunsRequest. + * @memberof google.cloud.websecurityscanner.v1beta + * @interface IListScanRunsRequest + * @property {string|null} [parent] ListScanRunsRequest parent + * @property {string|null} [pageToken] ListScanRunsRequest pageToken + * @property {number|null} [pageSize] ListScanRunsRequest pageSize + */ + + /** + * Constructs a new ListScanRunsRequest. + * @memberof google.cloud.websecurityscanner.v1beta + * @classdesc Represents a ListScanRunsRequest. + * @implements IListScanRunsRequest + * @constructor + * @param {google.cloud.websecurityscanner.v1beta.IListScanRunsRequest=} [properties] Properties to set + */ + function ListScanRunsRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListScanRunsRequest parent. + * @member {string} parent + * @memberof google.cloud.websecurityscanner.v1beta.ListScanRunsRequest + * @instance + */ + ListScanRunsRequest.prototype.parent = ""; + + /** + * ListScanRunsRequest pageToken. + * @member {string} pageToken + * @memberof google.cloud.websecurityscanner.v1beta.ListScanRunsRequest + * @instance + */ + ListScanRunsRequest.prototype.pageToken = ""; + + /** + * ListScanRunsRequest pageSize. + * @member {number} pageSize + * @memberof google.cloud.websecurityscanner.v1beta.ListScanRunsRequest + * @instance + */ + ListScanRunsRequest.prototype.pageSize = 0; + + /** + * Creates a new ListScanRunsRequest instance using the specified properties. + * @function create + * @memberof google.cloud.websecurityscanner.v1beta.ListScanRunsRequest + * @static + * @param {google.cloud.websecurityscanner.v1beta.IListScanRunsRequest=} [properties] Properties to set + * @returns {google.cloud.websecurityscanner.v1beta.ListScanRunsRequest} ListScanRunsRequest instance + */ + ListScanRunsRequest.create = function create(properties) { + return new ListScanRunsRequest(properties); + }; + + /** + * Encodes the specified ListScanRunsRequest message. Does not implicitly {@link google.cloud.websecurityscanner.v1beta.ListScanRunsRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.websecurityscanner.v1beta.ListScanRunsRequest + * @static + * @param {google.cloud.websecurityscanner.v1beta.IListScanRunsRequest} message ListScanRunsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListScanRunsRequest.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.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.pageToken); + if (message.pageSize != null && Object.hasOwnProperty.call(message, "pageSize")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.pageSize); + return writer; + }; + + /** + * Encodes the specified ListScanRunsRequest message, length delimited. Does not implicitly {@link google.cloud.websecurityscanner.v1beta.ListScanRunsRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.websecurityscanner.v1beta.ListScanRunsRequest + * @static + * @param {google.cloud.websecurityscanner.v1beta.IListScanRunsRequest} message ListScanRunsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListScanRunsRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListScanRunsRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.websecurityscanner.v1beta.ListScanRunsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.websecurityscanner.v1beta.ListScanRunsRequest} ListScanRunsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListScanRunsRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.websecurityscanner.v1beta.ListScanRunsRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + message.pageToken = reader.string(); + break; + } + case 3: { + message.pageSize = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListScanRunsRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.websecurityscanner.v1beta.ListScanRunsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.websecurityscanner.v1beta.ListScanRunsRequest} ListScanRunsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListScanRunsRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListScanRunsRequest message. + * @function verify + * @memberof google.cloud.websecurityscanner.v1beta.ListScanRunsRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListScanRunsRequest.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.pageToken != null && message.hasOwnProperty("pageToken")) + if (!$util.isString(message.pageToken)) + return "pageToken: string expected"; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + if (!$util.isInteger(message.pageSize)) + return "pageSize: integer expected"; + return null; + }; + + /** + * Creates a ListScanRunsRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.websecurityscanner.v1beta.ListScanRunsRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.websecurityscanner.v1beta.ListScanRunsRequest} ListScanRunsRequest + */ + ListScanRunsRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.websecurityscanner.v1beta.ListScanRunsRequest) + return object; + var message = new $root.google.cloud.websecurityscanner.v1beta.ListScanRunsRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.pageToken != null) + message.pageToken = String(object.pageToken); + if (object.pageSize != null) + message.pageSize = object.pageSize | 0; + return message; + }; + + /** + * Creates a plain object from a ListScanRunsRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.websecurityscanner.v1beta.ListScanRunsRequest + * @static + * @param {google.cloud.websecurityscanner.v1beta.ListScanRunsRequest} message ListScanRunsRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListScanRunsRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.pageToken = ""; + object.pageSize = 0; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + object.pageToken = message.pageToken; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + object.pageSize = message.pageSize; + return object; + }; + + /** + * Converts this ListScanRunsRequest to JSON. + * @function toJSON + * @memberof google.cloud.websecurityscanner.v1beta.ListScanRunsRequest + * @instance + * @returns {Object.} JSON object + */ + ListScanRunsRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListScanRunsRequest + * @function getTypeUrl + * @memberof google.cloud.websecurityscanner.v1beta.ListScanRunsRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListScanRunsRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.websecurityscanner.v1beta.ListScanRunsRequest"; + }; + + return ListScanRunsRequest; + })(); + + v1beta.ListScanRunsResponse = (function() { + + /** + * Properties of a ListScanRunsResponse. + * @memberof google.cloud.websecurityscanner.v1beta + * @interface IListScanRunsResponse + * @property {Array.|null} [scanRuns] ListScanRunsResponse scanRuns + * @property {string|null} [nextPageToken] ListScanRunsResponse nextPageToken + */ + + /** + * Constructs a new ListScanRunsResponse. + * @memberof google.cloud.websecurityscanner.v1beta + * @classdesc Represents a ListScanRunsResponse. + * @implements IListScanRunsResponse + * @constructor + * @param {google.cloud.websecurityscanner.v1beta.IListScanRunsResponse=} [properties] Properties to set + */ + function ListScanRunsResponse(properties) { + this.scanRuns = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListScanRunsResponse scanRuns. + * @member {Array.} scanRuns + * @memberof google.cloud.websecurityscanner.v1beta.ListScanRunsResponse + * @instance + */ + ListScanRunsResponse.prototype.scanRuns = $util.emptyArray; + + /** + * ListScanRunsResponse nextPageToken. + * @member {string} nextPageToken + * @memberof google.cloud.websecurityscanner.v1beta.ListScanRunsResponse + * @instance + */ + ListScanRunsResponse.prototype.nextPageToken = ""; + + /** + * Creates a new ListScanRunsResponse instance using the specified properties. + * @function create + * @memberof google.cloud.websecurityscanner.v1beta.ListScanRunsResponse + * @static + * @param {google.cloud.websecurityscanner.v1beta.IListScanRunsResponse=} [properties] Properties to set + * @returns {google.cloud.websecurityscanner.v1beta.ListScanRunsResponse} ListScanRunsResponse instance + */ + ListScanRunsResponse.create = function create(properties) { + return new ListScanRunsResponse(properties); + }; + + /** + * Encodes the specified ListScanRunsResponse message. Does not implicitly {@link google.cloud.websecurityscanner.v1beta.ListScanRunsResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.websecurityscanner.v1beta.ListScanRunsResponse + * @static + * @param {google.cloud.websecurityscanner.v1beta.IListScanRunsResponse} message ListScanRunsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListScanRunsResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.scanRuns != null && message.scanRuns.length) + for (var i = 0; i < message.scanRuns.length; ++i) + $root.google.cloud.websecurityscanner.v1beta.ScanRun.encode(message.scanRuns[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 ListScanRunsResponse message, length delimited. Does not implicitly {@link google.cloud.websecurityscanner.v1beta.ListScanRunsResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.websecurityscanner.v1beta.ListScanRunsResponse + * @static + * @param {google.cloud.websecurityscanner.v1beta.IListScanRunsResponse} message ListScanRunsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListScanRunsResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListScanRunsResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.websecurityscanner.v1beta.ListScanRunsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.websecurityscanner.v1beta.ListScanRunsResponse} ListScanRunsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListScanRunsResponse.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.websecurityscanner.v1beta.ListScanRunsResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.scanRuns && message.scanRuns.length)) + message.scanRuns = []; + message.scanRuns.push($root.google.cloud.websecurityscanner.v1beta.ScanRun.decode(reader, reader.uint32())); + break; + } + case 2: { + message.nextPageToken = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListScanRunsResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.websecurityscanner.v1beta.ListScanRunsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.websecurityscanner.v1beta.ListScanRunsResponse} ListScanRunsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListScanRunsResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListScanRunsResponse message. + * @function verify + * @memberof google.cloud.websecurityscanner.v1beta.ListScanRunsResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListScanRunsResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.scanRuns != null && message.hasOwnProperty("scanRuns")) { + if (!Array.isArray(message.scanRuns)) + return "scanRuns: array expected"; + for (var i = 0; i < message.scanRuns.length; ++i) { + var error = $root.google.cloud.websecurityscanner.v1beta.ScanRun.verify(message.scanRuns[i]); + if (error) + return "scanRuns." + error; + } + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; + return null; + }; + + /** + * Creates a ListScanRunsResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.websecurityscanner.v1beta.ListScanRunsResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.websecurityscanner.v1beta.ListScanRunsResponse} ListScanRunsResponse + */ + ListScanRunsResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.websecurityscanner.v1beta.ListScanRunsResponse) + return object; + var message = new $root.google.cloud.websecurityscanner.v1beta.ListScanRunsResponse(); + if (object.scanRuns) { + if (!Array.isArray(object.scanRuns)) + throw TypeError(".google.cloud.websecurityscanner.v1beta.ListScanRunsResponse.scanRuns: array expected"); + message.scanRuns = []; + for (var i = 0; i < object.scanRuns.length; ++i) { + if (typeof object.scanRuns[i] !== "object") + throw TypeError(".google.cloud.websecurityscanner.v1beta.ListScanRunsResponse.scanRuns: object expected"); + message.scanRuns[i] = $root.google.cloud.websecurityscanner.v1beta.ScanRun.fromObject(object.scanRuns[i]); + } + } + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + return message; + }; + + /** + * Creates a plain object from a ListScanRunsResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.websecurityscanner.v1beta.ListScanRunsResponse + * @static + * @param {google.cloud.websecurityscanner.v1beta.ListScanRunsResponse} message ListScanRunsResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListScanRunsResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.scanRuns = []; + if (options.defaults) + object.nextPageToken = ""; + if (message.scanRuns && message.scanRuns.length) { + object.scanRuns = []; + for (var j = 0; j < message.scanRuns.length; ++j) + object.scanRuns[j] = $root.google.cloud.websecurityscanner.v1beta.ScanRun.toObject(message.scanRuns[j], options); + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + object.nextPageToken = message.nextPageToken; + return object; + }; + + /** + * Converts this ListScanRunsResponse to JSON. + * @function toJSON + * @memberof google.cloud.websecurityscanner.v1beta.ListScanRunsResponse + * @instance + * @returns {Object.} JSON object + */ + ListScanRunsResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListScanRunsResponse + * @function getTypeUrl + * @memberof google.cloud.websecurityscanner.v1beta.ListScanRunsResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListScanRunsResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.websecurityscanner.v1beta.ListScanRunsResponse"; + }; + + return ListScanRunsResponse; + })(); + + v1beta.StopScanRunRequest = (function() { + + /** + * Properties of a StopScanRunRequest. + * @memberof google.cloud.websecurityscanner.v1beta + * @interface IStopScanRunRequest + * @property {string|null} [name] StopScanRunRequest name + */ + + /** + * Constructs a new StopScanRunRequest. + * @memberof google.cloud.websecurityscanner.v1beta + * @classdesc Represents a StopScanRunRequest. + * @implements IStopScanRunRequest + * @constructor + * @param {google.cloud.websecurityscanner.v1beta.IStopScanRunRequest=} [properties] Properties to set + */ + function StopScanRunRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * StopScanRunRequest name. + * @member {string} name + * @memberof google.cloud.websecurityscanner.v1beta.StopScanRunRequest + * @instance + */ + StopScanRunRequest.prototype.name = ""; + + /** + * Creates a new StopScanRunRequest instance using the specified properties. + * @function create + * @memberof google.cloud.websecurityscanner.v1beta.StopScanRunRequest + * @static + * @param {google.cloud.websecurityscanner.v1beta.IStopScanRunRequest=} [properties] Properties to set + * @returns {google.cloud.websecurityscanner.v1beta.StopScanRunRequest} StopScanRunRequest instance + */ + StopScanRunRequest.create = function create(properties) { + return new StopScanRunRequest(properties); + }; + + /** + * Encodes the specified StopScanRunRequest message. Does not implicitly {@link google.cloud.websecurityscanner.v1beta.StopScanRunRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.websecurityscanner.v1beta.StopScanRunRequest + * @static + * @param {google.cloud.websecurityscanner.v1beta.IStopScanRunRequest} message StopScanRunRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + StopScanRunRequest.encode = function encode(message, writer) { + 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 StopScanRunRequest message, length delimited. Does not implicitly {@link google.cloud.websecurityscanner.v1beta.StopScanRunRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.websecurityscanner.v1beta.StopScanRunRequest + * @static + * @param {google.cloud.websecurityscanner.v1beta.IStopScanRunRequest} message StopScanRunRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + StopScanRunRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a StopScanRunRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.websecurityscanner.v1beta.StopScanRunRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.websecurityscanner.v1beta.StopScanRunRequest} StopScanRunRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + StopScanRunRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.websecurityscanner.v1beta.StopScanRunRequest(); + 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 StopScanRunRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.websecurityscanner.v1beta.StopScanRunRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.websecurityscanner.v1beta.StopScanRunRequest} StopScanRunRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + StopScanRunRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a StopScanRunRequest message. + * @function verify + * @memberof google.cloud.websecurityscanner.v1beta.StopScanRunRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + StopScanRunRequest.verify = function verify(message) { + if (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 StopScanRunRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.websecurityscanner.v1beta.StopScanRunRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.websecurityscanner.v1beta.StopScanRunRequest} StopScanRunRequest + */ + StopScanRunRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.websecurityscanner.v1beta.StopScanRunRequest) + return object; + var message = new $root.google.cloud.websecurityscanner.v1beta.StopScanRunRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a StopScanRunRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.websecurityscanner.v1beta.StopScanRunRequest + * @static + * @param {google.cloud.websecurityscanner.v1beta.StopScanRunRequest} message StopScanRunRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + StopScanRunRequest.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 StopScanRunRequest to JSON. + * @function toJSON + * @memberof google.cloud.websecurityscanner.v1beta.StopScanRunRequest + * @instance + * @returns {Object.} JSON object + */ + StopScanRunRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for StopScanRunRequest + * @function getTypeUrl + * @memberof google.cloud.websecurityscanner.v1beta.StopScanRunRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + StopScanRunRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.websecurityscanner.v1beta.StopScanRunRequest"; + }; + + return StopScanRunRequest; + })(); + + v1beta.ListCrawledUrlsRequest = (function() { + + /** + * Properties of a ListCrawledUrlsRequest. + * @memberof google.cloud.websecurityscanner.v1beta + * @interface IListCrawledUrlsRequest + * @property {string|null} [parent] ListCrawledUrlsRequest parent + * @property {string|null} [pageToken] ListCrawledUrlsRequest pageToken + * @property {number|null} [pageSize] ListCrawledUrlsRequest pageSize + */ + + /** + * Constructs a new ListCrawledUrlsRequest. + * @memberof google.cloud.websecurityscanner.v1beta + * @classdesc Represents a ListCrawledUrlsRequest. + * @implements IListCrawledUrlsRequest + * @constructor + * @param {google.cloud.websecurityscanner.v1beta.IListCrawledUrlsRequest=} [properties] Properties to set + */ + function ListCrawledUrlsRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListCrawledUrlsRequest parent. + * @member {string} parent + * @memberof google.cloud.websecurityscanner.v1beta.ListCrawledUrlsRequest + * @instance + */ + ListCrawledUrlsRequest.prototype.parent = ""; + + /** + * ListCrawledUrlsRequest pageToken. + * @member {string} pageToken + * @memberof google.cloud.websecurityscanner.v1beta.ListCrawledUrlsRequest + * @instance + */ + ListCrawledUrlsRequest.prototype.pageToken = ""; + + /** + * ListCrawledUrlsRequest pageSize. + * @member {number} pageSize + * @memberof google.cloud.websecurityscanner.v1beta.ListCrawledUrlsRequest + * @instance + */ + ListCrawledUrlsRequest.prototype.pageSize = 0; + + /** + * Creates a new ListCrawledUrlsRequest instance using the specified properties. + * @function create + * @memberof google.cloud.websecurityscanner.v1beta.ListCrawledUrlsRequest + * @static + * @param {google.cloud.websecurityscanner.v1beta.IListCrawledUrlsRequest=} [properties] Properties to set + * @returns {google.cloud.websecurityscanner.v1beta.ListCrawledUrlsRequest} ListCrawledUrlsRequest instance + */ + ListCrawledUrlsRequest.create = function create(properties) { + return new ListCrawledUrlsRequest(properties); + }; + + /** + * Encodes the specified ListCrawledUrlsRequest message. Does not implicitly {@link google.cloud.websecurityscanner.v1beta.ListCrawledUrlsRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.websecurityscanner.v1beta.ListCrawledUrlsRequest + * @static + * @param {google.cloud.websecurityscanner.v1beta.IListCrawledUrlsRequest} message ListCrawledUrlsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListCrawledUrlsRequest.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.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.pageToken); + if (message.pageSize != null && Object.hasOwnProperty.call(message, "pageSize")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.pageSize); + return writer; + }; + + /** + * Encodes the specified ListCrawledUrlsRequest message, length delimited. Does not implicitly {@link google.cloud.websecurityscanner.v1beta.ListCrawledUrlsRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.websecurityscanner.v1beta.ListCrawledUrlsRequest + * @static + * @param {google.cloud.websecurityscanner.v1beta.IListCrawledUrlsRequest} message ListCrawledUrlsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListCrawledUrlsRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListCrawledUrlsRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.websecurityscanner.v1beta.ListCrawledUrlsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.websecurityscanner.v1beta.ListCrawledUrlsRequest} ListCrawledUrlsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListCrawledUrlsRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.websecurityscanner.v1beta.ListCrawledUrlsRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + message.pageToken = reader.string(); + break; + } + case 3: { + message.pageSize = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListCrawledUrlsRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.websecurityscanner.v1beta.ListCrawledUrlsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.websecurityscanner.v1beta.ListCrawledUrlsRequest} ListCrawledUrlsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListCrawledUrlsRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListCrawledUrlsRequest message. + * @function verify + * @memberof google.cloud.websecurityscanner.v1beta.ListCrawledUrlsRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListCrawledUrlsRequest.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.pageToken != null && message.hasOwnProperty("pageToken")) + if (!$util.isString(message.pageToken)) + return "pageToken: string expected"; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + if (!$util.isInteger(message.pageSize)) + return "pageSize: integer expected"; + return null; + }; + + /** + * Creates a ListCrawledUrlsRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.websecurityscanner.v1beta.ListCrawledUrlsRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.websecurityscanner.v1beta.ListCrawledUrlsRequest} ListCrawledUrlsRequest + */ + ListCrawledUrlsRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.websecurityscanner.v1beta.ListCrawledUrlsRequest) + return object; + var message = new $root.google.cloud.websecurityscanner.v1beta.ListCrawledUrlsRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.pageToken != null) + message.pageToken = String(object.pageToken); + if (object.pageSize != null) + message.pageSize = object.pageSize | 0; + return message; + }; + + /** + * Creates a plain object from a ListCrawledUrlsRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.websecurityscanner.v1beta.ListCrawledUrlsRequest + * @static + * @param {google.cloud.websecurityscanner.v1beta.ListCrawledUrlsRequest} message ListCrawledUrlsRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListCrawledUrlsRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.pageToken = ""; + object.pageSize = 0; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + object.pageToken = message.pageToken; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + object.pageSize = message.pageSize; + return object; + }; + + /** + * Converts this ListCrawledUrlsRequest to JSON. + * @function toJSON + * @memberof google.cloud.websecurityscanner.v1beta.ListCrawledUrlsRequest + * @instance + * @returns {Object.} JSON object + */ + ListCrawledUrlsRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListCrawledUrlsRequest + * @function getTypeUrl + * @memberof google.cloud.websecurityscanner.v1beta.ListCrawledUrlsRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListCrawledUrlsRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.websecurityscanner.v1beta.ListCrawledUrlsRequest"; + }; + + return ListCrawledUrlsRequest; + })(); + + v1beta.ListCrawledUrlsResponse = (function() { + + /** + * Properties of a ListCrawledUrlsResponse. + * @memberof google.cloud.websecurityscanner.v1beta + * @interface IListCrawledUrlsResponse + * @property {Array.|null} [crawledUrls] ListCrawledUrlsResponse crawledUrls + * @property {string|null} [nextPageToken] ListCrawledUrlsResponse nextPageToken + */ + + /** + * Constructs a new ListCrawledUrlsResponse. + * @memberof google.cloud.websecurityscanner.v1beta + * @classdesc Represents a ListCrawledUrlsResponse. + * @implements IListCrawledUrlsResponse + * @constructor + * @param {google.cloud.websecurityscanner.v1beta.IListCrawledUrlsResponse=} [properties] Properties to set + */ + function ListCrawledUrlsResponse(properties) { + this.crawledUrls = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListCrawledUrlsResponse crawledUrls. + * @member {Array.} crawledUrls + * @memberof google.cloud.websecurityscanner.v1beta.ListCrawledUrlsResponse + * @instance + */ + ListCrawledUrlsResponse.prototype.crawledUrls = $util.emptyArray; + + /** + * ListCrawledUrlsResponse nextPageToken. + * @member {string} nextPageToken + * @memberof google.cloud.websecurityscanner.v1beta.ListCrawledUrlsResponse + * @instance + */ + ListCrawledUrlsResponse.prototype.nextPageToken = ""; + + /** + * Creates a new ListCrawledUrlsResponse instance using the specified properties. + * @function create + * @memberof google.cloud.websecurityscanner.v1beta.ListCrawledUrlsResponse + * @static + * @param {google.cloud.websecurityscanner.v1beta.IListCrawledUrlsResponse=} [properties] Properties to set + * @returns {google.cloud.websecurityscanner.v1beta.ListCrawledUrlsResponse} ListCrawledUrlsResponse instance + */ + ListCrawledUrlsResponse.create = function create(properties) { + return new ListCrawledUrlsResponse(properties); + }; + + /** + * Encodes the specified ListCrawledUrlsResponse message. Does not implicitly {@link google.cloud.websecurityscanner.v1beta.ListCrawledUrlsResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.websecurityscanner.v1beta.ListCrawledUrlsResponse + * @static + * @param {google.cloud.websecurityscanner.v1beta.IListCrawledUrlsResponse} message ListCrawledUrlsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListCrawledUrlsResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.crawledUrls != null && message.crawledUrls.length) + for (var i = 0; i < message.crawledUrls.length; ++i) + $root.google.cloud.websecurityscanner.v1beta.CrawledUrl.encode(message.crawledUrls[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 ListCrawledUrlsResponse message, length delimited. Does not implicitly {@link google.cloud.websecurityscanner.v1beta.ListCrawledUrlsResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.websecurityscanner.v1beta.ListCrawledUrlsResponse + * @static + * @param {google.cloud.websecurityscanner.v1beta.IListCrawledUrlsResponse} message ListCrawledUrlsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListCrawledUrlsResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListCrawledUrlsResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.websecurityscanner.v1beta.ListCrawledUrlsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.websecurityscanner.v1beta.ListCrawledUrlsResponse} ListCrawledUrlsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListCrawledUrlsResponse.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.websecurityscanner.v1beta.ListCrawledUrlsResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.crawledUrls && message.crawledUrls.length)) + message.crawledUrls = []; + message.crawledUrls.push($root.google.cloud.websecurityscanner.v1beta.CrawledUrl.decode(reader, reader.uint32())); + break; + } + case 2: { + message.nextPageToken = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListCrawledUrlsResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.websecurityscanner.v1beta.ListCrawledUrlsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.websecurityscanner.v1beta.ListCrawledUrlsResponse} ListCrawledUrlsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListCrawledUrlsResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListCrawledUrlsResponse message. + * @function verify + * @memberof google.cloud.websecurityscanner.v1beta.ListCrawledUrlsResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListCrawledUrlsResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.crawledUrls != null && message.hasOwnProperty("crawledUrls")) { + if (!Array.isArray(message.crawledUrls)) + return "crawledUrls: array expected"; + for (var i = 0; i < message.crawledUrls.length; ++i) { + var error = $root.google.cloud.websecurityscanner.v1beta.CrawledUrl.verify(message.crawledUrls[i]); + if (error) + return "crawledUrls." + error; + } + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; + return null; + }; + + /** + * Creates a ListCrawledUrlsResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.websecurityscanner.v1beta.ListCrawledUrlsResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.websecurityscanner.v1beta.ListCrawledUrlsResponse} ListCrawledUrlsResponse + */ + ListCrawledUrlsResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.websecurityscanner.v1beta.ListCrawledUrlsResponse) + return object; + var message = new $root.google.cloud.websecurityscanner.v1beta.ListCrawledUrlsResponse(); + if (object.crawledUrls) { + if (!Array.isArray(object.crawledUrls)) + throw TypeError(".google.cloud.websecurityscanner.v1beta.ListCrawledUrlsResponse.crawledUrls: array expected"); + message.crawledUrls = []; + for (var i = 0; i < object.crawledUrls.length; ++i) { + if (typeof object.crawledUrls[i] !== "object") + throw TypeError(".google.cloud.websecurityscanner.v1beta.ListCrawledUrlsResponse.crawledUrls: object expected"); + message.crawledUrls[i] = $root.google.cloud.websecurityscanner.v1beta.CrawledUrl.fromObject(object.crawledUrls[i]); + } + } + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + return message; + }; + + /** + * Creates a plain object from a ListCrawledUrlsResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.websecurityscanner.v1beta.ListCrawledUrlsResponse + * @static + * @param {google.cloud.websecurityscanner.v1beta.ListCrawledUrlsResponse} message ListCrawledUrlsResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListCrawledUrlsResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.crawledUrls = []; + if (options.defaults) + object.nextPageToken = ""; + if (message.crawledUrls && message.crawledUrls.length) { + object.crawledUrls = []; + for (var j = 0; j < message.crawledUrls.length; ++j) + object.crawledUrls[j] = $root.google.cloud.websecurityscanner.v1beta.CrawledUrl.toObject(message.crawledUrls[j], options); + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + object.nextPageToken = message.nextPageToken; + return object; + }; + + /** + * Converts this ListCrawledUrlsResponse to JSON. + * @function toJSON + * @memberof google.cloud.websecurityscanner.v1beta.ListCrawledUrlsResponse + * @instance + * @returns {Object.} JSON object + */ + ListCrawledUrlsResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListCrawledUrlsResponse + * @function getTypeUrl + * @memberof google.cloud.websecurityscanner.v1beta.ListCrawledUrlsResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListCrawledUrlsResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.websecurityscanner.v1beta.ListCrawledUrlsResponse"; + }; + + return ListCrawledUrlsResponse; + })(); + + v1beta.GetFindingRequest = (function() { + + /** + * Properties of a GetFindingRequest. + * @memberof google.cloud.websecurityscanner.v1beta + * @interface IGetFindingRequest + * @property {string|null} [name] GetFindingRequest name + */ + + /** + * Constructs a new GetFindingRequest. + * @memberof google.cloud.websecurityscanner.v1beta + * @classdesc Represents a GetFindingRequest. + * @implements IGetFindingRequest + * @constructor + * @param {google.cloud.websecurityscanner.v1beta.IGetFindingRequest=} [properties] Properties to set + */ + function GetFindingRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetFindingRequest name. + * @member {string} name + * @memberof google.cloud.websecurityscanner.v1beta.GetFindingRequest + * @instance + */ + GetFindingRequest.prototype.name = ""; + + /** + * Creates a new GetFindingRequest instance using the specified properties. + * @function create + * @memberof google.cloud.websecurityscanner.v1beta.GetFindingRequest + * @static + * @param {google.cloud.websecurityscanner.v1beta.IGetFindingRequest=} [properties] Properties to set + * @returns {google.cloud.websecurityscanner.v1beta.GetFindingRequest} GetFindingRequest instance + */ + GetFindingRequest.create = function create(properties) { + return new GetFindingRequest(properties); + }; + + /** + * Encodes the specified GetFindingRequest message. Does not implicitly {@link google.cloud.websecurityscanner.v1beta.GetFindingRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.websecurityscanner.v1beta.GetFindingRequest + * @static + * @param {google.cloud.websecurityscanner.v1beta.IGetFindingRequest} message GetFindingRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetFindingRequest.encode = function encode(message, writer) { + 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 GetFindingRequest message, length delimited. Does not implicitly {@link google.cloud.websecurityscanner.v1beta.GetFindingRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.websecurityscanner.v1beta.GetFindingRequest + * @static + * @param {google.cloud.websecurityscanner.v1beta.IGetFindingRequest} message GetFindingRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetFindingRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetFindingRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.websecurityscanner.v1beta.GetFindingRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.websecurityscanner.v1beta.GetFindingRequest} GetFindingRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetFindingRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.websecurityscanner.v1beta.GetFindingRequest(); + 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 GetFindingRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.websecurityscanner.v1beta.GetFindingRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.websecurityscanner.v1beta.GetFindingRequest} GetFindingRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetFindingRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetFindingRequest message. + * @function verify + * @memberof google.cloud.websecurityscanner.v1beta.GetFindingRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetFindingRequest.verify = function verify(message) { + if (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 GetFindingRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.websecurityscanner.v1beta.GetFindingRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.websecurityscanner.v1beta.GetFindingRequest} GetFindingRequest + */ + GetFindingRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.websecurityscanner.v1beta.GetFindingRequest) + return object; + var message = new $root.google.cloud.websecurityscanner.v1beta.GetFindingRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a GetFindingRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.websecurityscanner.v1beta.GetFindingRequest + * @static + * @param {google.cloud.websecurityscanner.v1beta.GetFindingRequest} message GetFindingRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetFindingRequest.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 GetFindingRequest to JSON. + * @function toJSON + * @memberof google.cloud.websecurityscanner.v1beta.GetFindingRequest + * @instance + * @returns {Object.} JSON object + */ + GetFindingRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GetFindingRequest + * @function getTypeUrl + * @memberof google.cloud.websecurityscanner.v1beta.GetFindingRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GetFindingRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.websecurityscanner.v1beta.GetFindingRequest"; + }; + + return GetFindingRequest; + })(); + + v1beta.ListFindingsRequest = (function() { + + /** + * Properties of a ListFindingsRequest. + * @memberof google.cloud.websecurityscanner.v1beta + * @interface IListFindingsRequest + * @property {string|null} [parent] ListFindingsRequest parent + * @property {string|null} [filter] ListFindingsRequest filter + * @property {string|null} [pageToken] ListFindingsRequest pageToken + * @property {number|null} [pageSize] ListFindingsRequest pageSize + */ + + /** + * Constructs a new ListFindingsRequest. + * @memberof google.cloud.websecurityscanner.v1beta + * @classdesc Represents a ListFindingsRequest. + * @implements IListFindingsRequest + * @constructor + * @param {google.cloud.websecurityscanner.v1beta.IListFindingsRequest=} [properties] Properties to set + */ + function ListFindingsRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListFindingsRequest parent. + * @member {string} parent + * @memberof google.cloud.websecurityscanner.v1beta.ListFindingsRequest + * @instance + */ + ListFindingsRequest.prototype.parent = ""; + + /** + * ListFindingsRequest filter. + * @member {string} filter + * @memberof google.cloud.websecurityscanner.v1beta.ListFindingsRequest + * @instance + */ + ListFindingsRequest.prototype.filter = ""; + + /** + * ListFindingsRequest pageToken. + * @member {string} pageToken + * @memberof google.cloud.websecurityscanner.v1beta.ListFindingsRequest + * @instance + */ + ListFindingsRequest.prototype.pageToken = ""; + + /** + * ListFindingsRequest pageSize. + * @member {number} pageSize + * @memberof google.cloud.websecurityscanner.v1beta.ListFindingsRequest + * @instance + */ + ListFindingsRequest.prototype.pageSize = 0; + + /** + * Creates a new ListFindingsRequest instance using the specified properties. + * @function create + * @memberof google.cloud.websecurityscanner.v1beta.ListFindingsRequest + * @static + * @param {google.cloud.websecurityscanner.v1beta.IListFindingsRequest=} [properties] Properties to set + * @returns {google.cloud.websecurityscanner.v1beta.ListFindingsRequest} ListFindingsRequest instance + */ + ListFindingsRequest.create = function create(properties) { + return new ListFindingsRequest(properties); + }; + + /** + * Encodes the specified ListFindingsRequest message. Does not implicitly {@link google.cloud.websecurityscanner.v1beta.ListFindingsRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.websecurityscanner.v1beta.ListFindingsRequest + * @static + * @param {google.cloud.websecurityscanner.v1beta.IListFindingsRequest} message ListFindingsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListFindingsRequest.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.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.pageToken); + if (message.pageSize != null && Object.hasOwnProperty.call(message, "pageSize")) + writer.uint32(/* id 4, wireType 0 =*/32).int32(message.pageSize); + return writer; + }; + + /** + * Encodes the specified ListFindingsRequest message, length delimited. Does not implicitly {@link google.cloud.websecurityscanner.v1beta.ListFindingsRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.websecurityscanner.v1beta.ListFindingsRequest + * @static + * @param {google.cloud.websecurityscanner.v1beta.IListFindingsRequest} message ListFindingsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListFindingsRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListFindingsRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.websecurityscanner.v1beta.ListFindingsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.websecurityscanner.v1beta.ListFindingsRequest} ListFindingsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListFindingsRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.websecurityscanner.v1beta.ListFindingsRequest(); + 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.pageToken = reader.string(); + break; + } + case 4: { + message.pageSize = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListFindingsRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.websecurityscanner.v1beta.ListFindingsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.websecurityscanner.v1beta.ListFindingsRequest} ListFindingsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListFindingsRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListFindingsRequest message. + * @function verify + * @memberof google.cloud.websecurityscanner.v1beta.ListFindingsRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListFindingsRequest.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.pageToken != null && message.hasOwnProperty("pageToken")) + if (!$util.isString(message.pageToken)) + return "pageToken: string expected"; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + if (!$util.isInteger(message.pageSize)) + return "pageSize: integer expected"; + return null; + }; + + /** + * Creates a ListFindingsRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.websecurityscanner.v1beta.ListFindingsRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.websecurityscanner.v1beta.ListFindingsRequest} ListFindingsRequest + */ + ListFindingsRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.websecurityscanner.v1beta.ListFindingsRequest) + return object; + var message = new $root.google.cloud.websecurityscanner.v1beta.ListFindingsRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.filter != null) + message.filter = String(object.filter); + if (object.pageToken != null) + message.pageToken = String(object.pageToken); + if (object.pageSize != null) + message.pageSize = object.pageSize | 0; + return message; + }; + + /** + * Creates a plain object from a ListFindingsRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.websecurityscanner.v1beta.ListFindingsRequest + * @static + * @param {google.cloud.websecurityscanner.v1beta.ListFindingsRequest} message ListFindingsRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListFindingsRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.filter = ""; + object.pageToken = ""; + object.pageSize = 0; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.filter != null && message.hasOwnProperty("filter")) + object.filter = message.filter; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + object.pageToken = message.pageToken; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + object.pageSize = message.pageSize; + return object; + }; + + /** + * Converts this ListFindingsRequest to JSON. + * @function toJSON + * @memberof google.cloud.websecurityscanner.v1beta.ListFindingsRequest + * @instance + * @returns {Object.} JSON object + */ + ListFindingsRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListFindingsRequest + * @function getTypeUrl + * @memberof google.cloud.websecurityscanner.v1beta.ListFindingsRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListFindingsRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.websecurityscanner.v1beta.ListFindingsRequest"; + }; + + return ListFindingsRequest; + })(); + + v1beta.ListFindingsResponse = (function() { + + /** + * Properties of a ListFindingsResponse. + * @memberof google.cloud.websecurityscanner.v1beta + * @interface IListFindingsResponse + * @property {Array.|null} [findings] ListFindingsResponse findings + * @property {string|null} [nextPageToken] ListFindingsResponse nextPageToken + */ + + /** + * Constructs a new ListFindingsResponse. + * @memberof google.cloud.websecurityscanner.v1beta + * @classdesc Represents a ListFindingsResponse. + * @implements IListFindingsResponse + * @constructor + * @param {google.cloud.websecurityscanner.v1beta.IListFindingsResponse=} [properties] Properties to set + */ + function ListFindingsResponse(properties) { + this.findings = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListFindingsResponse findings. + * @member {Array.} findings + * @memberof google.cloud.websecurityscanner.v1beta.ListFindingsResponse + * @instance + */ + ListFindingsResponse.prototype.findings = $util.emptyArray; + + /** + * ListFindingsResponse nextPageToken. + * @member {string} nextPageToken + * @memberof google.cloud.websecurityscanner.v1beta.ListFindingsResponse + * @instance + */ + ListFindingsResponse.prototype.nextPageToken = ""; + + /** + * Creates a new ListFindingsResponse instance using the specified properties. + * @function create + * @memberof google.cloud.websecurityscanner.v1beta.ListFindingsResponse + * @static + * @param {google.cloud.websecurityscanner.v1beta.IListFindingsResponse=} [properties] Properties to set + * @returns {google.cloud.websecurityscanner.v1beta.ListFindingsResponse} ListFindingsResponse instance + */ + ListFindingsResponse.create = function create(properties) { + return new ListFindingsResponse(properties); + }; + + /** + * Encodes the specified ListFindingsResponse message. Does not implicitly {@link google.cloud.websecurityscanner.v1beta.ListFindingsResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.websecurityscanner.v1beta.ListFindingsResponse + * @static + * @param {google.cloud.websecurityscanner.v1beta.IListFindingsResponse} message ListFindingsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListFindingsResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.findings != null && message.findings.length) + for (var i = 0; i < message.findings.length; ++i) + $root.google.cloud.websecurityscanner.v1beta.Finding.encode(message.findings[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 ListFindingsResponse message, length delimited. Does not implicitly {@link google.cloud.websecurityscanner.v1beta.ListFindingsResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.websecurityscanner.v1beta.ListFindingsResponse + * @static + * @param {google.cloud.websecurityscanner.v1beta.IListFindingsResponse} message ListFindingsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListFindingsResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListFindingsResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.websecurityscanner.v1beta.ListFindingsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.websecurityscanner.v1beta.ListFindingsResponse} ListFindingsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListFindingsResponse.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.websecurityscanner.v1beta.ListFindingsResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.findings && message.findings.length)) + message.findings = []; + message.findings.push($root.google.cloud.websecurityscanner.v1beta.Finding.decode(reader, reader.uint32())); + break; + } + case 2: { + message.nextPageToken = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListFindingsResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.websecurityscanner.v1beta.ListFindingsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.websecurityscanner.v1beta.ListFindingsResponse} ListFindingsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListFindingsResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListFindingsResponse message. + * @function verify + * @memberof google.cloud.websecurityscanner.v1beta.ListFindingsResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListFindingsResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.findings != null && message.hasOwnProperty("findings")) { + if (!Array.isArray(message.findings)) + return "findings: array expected"; + for (var i = 0; i < message.findings.length; ++i) { + var error = $root.google.cloud.websecurityscanner.v1beta.Finding.verify(message.findings[i]); + if (error) + return "findings." + error; + } + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; + return null; + }; + + /** + * Creates a ListFindingsResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.websecurityscanner.v1beta.ListFindingsResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.websecurityscanner.v1beta.ListFindingsResponse} ListFindingsResponse + */ + ListFindingsResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.websecurityscanner.v1beta.ListFindingsResponse) + return object; + var message = new $root.google.cloud.websecurityscanner.v1beta.ListFindingsResponse(); + if (object.findings) { + if (!Array.isArray(object.findings)) + throw TypeError(".google.cloud.websecurityscanner.v1beta.ListFindingsResponse.findings: array expected"); + message.findings = []; + for (var i = 0; i < object.findings.length; ++i) { + if (typeof object.findings[i] !== "object") + throw TypeError(".google.cloud.websecurityscanner.v1beta.ListFindingsResponse.findings: object expected"); + message.findings[i] = $root.google.cloud.websecurityscanner.v1beta.Finding.fromObject(object.findings[i]); + } + } + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + return message; + }; + + /** + * Creates a plain object from a ListFindingsResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.websecurityscanner.v1beta.ListFindingsResponse + * @static + * @param {google.cloud.websecurityscanner.v1beta.ListFindingsResponse} message ListFindingsResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListFindingsResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.findings = []; + if (options.defaults) + object.nextPageToken = ""; + if (message.findings && message.findings.length) { + object.findings = []; + for (var j = 0; j < message.findings.length; ++j) + object.findings[j] = $root.google.cloud.websecurityscanner.v1beta.Finding.toObject(message.findings[j], options); + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + object.nextPageToken = message.nextPageToken; + return object; + }; + + /** + * Converts this ListFindingsResponse to JSON. + * @function toJSON + * @memberof google.cloud.websecurityscanner.v1beta.ListFindingsResponse + * @instance + * @returns {Object.} JSON object + */ + ListFindingsResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListFindingsResponse + * @function getTypeUrl + * @memberof google.cloud.websecurityscanner.v1beta.ListFindingsResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListFindingsResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.websecurityscanner.v1beta.ListFindingsResponse"; + }; + + return ListFindingsResponse; + })(); + + v1beta.ListFindingTypeStatsRequest = (function() { + + /** + * Properties of a ListFindingTypeStatsRequest. + * @memberof google.cloud.websecurityscanner.v1beta + * @interface IListFindingTypeStatsRequest + * @property {string|null} [parent] ListFindingTypeStatsRequest parent + */ + + /** + * Constructs a new ListFindingTypeStatsRequest. + * @memberof google.cloud.websecurityscanner.v1beta + * @classdesc Represents a ListFindingTypeStatsRequest. + * @implements IListFindingTypeStatsRequest + * @constructor + * @param {google.cloud.websecurityscanner.v1beta.IListFindingTypeStatsRequest=} [properties] Properties to set + */ + function ListFindingTypeStatsRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListFindingTypeStatsRequest parent. + * @member {string} parent + * @memberof google.cloud.websecurityscanner.v1beta.ListFindingTypeStatsRequest + * @instance + */ + ListFindingTypeStatsRequest.prototype.parent = ""; + + /** + * Creates a new ListFindingTypeStatsRequest instance using the specified properties. + * @function create + * @memberof google.cloud.websecurityscanner.v1beta.ListFindingTypeStatsRequest + * @static + * @param {google.cloud.websecurityscanner.v1beta.IListFindingTypeStatsRequest=} [properties] Properties to set + * @returns {google.cloud.websecurityscanner.v1beta.ListFindingTypeStatsRequest} ListFindingTypeStatsRequest instance + */ + ListFindingTypeStatsRequest.create = function create(properties) { + return new ListFindingTypeStatsRequest(properties); + }; + + /** + * Encodes the specified ListFindingTypeStatsRequest message. Does not implicitly {@link google.cloud.websecurityscanner.v1beta.ListFindingTypeStatsRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.websecurityscanner.v1beta.ListFindingTypeStatsRequest + * @static + * @param {google.cloud.websecurityscanner.v1beta.IListFindingTypeStatsRequest} message ListFindingTypeStatsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListFindingTypeStatsRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); + return writer; + }; + + /** + * Encodes the specified ListFindingTypeStatsRequest message, length delimited. Does not implicitly {@link google.cloud.websecurityscanner.v1beta.ListFindingTypeStatsRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.websecurityscanner.v1beta.ListFindingTypeStatsRequest + * @static + * @param {google.cloud.websecurityscanner.v1beta.IListFindingTypeStatsRequest} message ListFindingTypeStatsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListFindingTypeStatsRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListFindingTypeStatsRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.websecurityscanner.v1beta.ListFindingTypeStatsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.websecurityscanner.v1beta.ListFindingTypeStatsRequest} ListFindingTypeStatsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListFindingTypeStatsRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.websecurityscanner.v1beta.ListFindingTypeStatsRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.parent = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListFindingTypeStatsRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.websecurityscanner.v1beta.ListFindingTypeStatsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.websecurityscanner.v1beta.ListFindingTypeStatsRequest} ListFindingTypeStatsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListFindingTypeStatsRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListFindingTypeStatsRequest message. + * @function verify + * @memberof google.cloud.websecurityscanner.v1beta.ListFindingTypeStatsRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListFindingTypeStatsRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.parent != null && message.hasOwnProperty("parent")) + if (!$util.isString(message.parent)) + return "parent: string expected"; + return null; + }; + + /** + * Creates a ListFindingTypeStatsRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.websecurityscanner.v1beta.ListFindingTypeStatsRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.websecurityscanner.v1beta.ListFindingTypeStatsRequest} ListFindingTypeStatsRequest + */ + ListFindingTypeStatsRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.websecurityscanner.v1beta.ListFindingTypeStatsRequest) + return object; + var message = new $root.google.cloud.websecurityscanner.v1beta.ListFindingTypeStatsRequest(); + if (object.parent != null) + message.parent = String(object.parent); + return message; + }; + + /** + * Creates a plain object from a ListFindingTypeStatsRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.websecurityscanner.v1beta.ListFindingTypeStatsRequest + * @static + * @param {google.cloud.websecurityscanner.v1beta.ListFindingTypeStatsRequest} message ListFindingTypeStatsRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListFindingTypeStatsRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.parent = ""; + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + return object; + }; + + /** + * Converts this ListFindingTypeStatsRequest to JSON. + * @function toJSON + * @memberof google.cloud.websecurityscanner.v1beta.ListFindingTypeStatsRequest + * @instance + * @returns {Object.} JSON object + */ + ListFindingTypeStatsRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListFindingTypeStatsRequest + * @function getTypeUrl + * @memberof google.cloud.websecurityscanner.v1beta.ListFindingTypeStatsRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListFindingTypeStatsRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.websecurityscanner.v1beta.ListFindingTypeStatsRequest"; + }; + + return ListFindingTypeStatsRequest; + })(); + + v1beta.ListFindingTypeStatsResponse = (function() { + + /** + * Properties of a ListFindingTypeStatsResponse. + * @memberof google.cloud.websecurityscanner.v1beta + * @interface IListFindingTypeStatsResponse + * @property {Array.|null} [findingTypeStats] ListFindingTypeStatsResponse findingTypeStats + */ + + /** + * Constructs a new ListFindingTypeStatsResponse. + * @memberof google.cloud.websecurityscanner.v1beta + * @classdesc Represents a ListFindingTypeStatsResponse. + * @implements IListFindingTypeStatsResponse + * @constructor + * @param {google.cloud.websecurityscanner.v1beta.IListFindingTypeStatsResponse=} [properties] Properties to set + */ + function ListFindingTypeStatsResponse(properties) { + this.findingTypeStats = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListFindingTypeStatsResponse findingTypeStats. + * @member {Array.} findingTypeStats + * @memberof google.cloud.websecurityscanner.v1beta.ListFindingTypeStatsResponse + * @instance + */ + ListFindingTypeStatsResponse.prototype.findingTypeStats = $util.emptyArray; + + /** + * Creates a new ListFindingTypeStatsResponse instance using the specified properties. + * @function create + * @memberof google.cloud.websecurityscanner.v1beta.ListFindingTypeStatsResponse + * @static + * @param {google.cloud.websecurityscanner.v1beta.IListFindingTypeStatsResponse=} [properties] Properties to set + * @returns {google.cloud.websecurityscanner.v1beta.ListFindingTypeStatsResponse} ListFindingTypeStatsResponse instance + */ + ListFindingTypeStatsResponse.create = function create(properties) { + return new ListFindingTypeStatsResponse(properties); + }; + + /** + * Encodes the specified ListFindingTypeStatsResponse message. Does not implicitly {@link google.cloud.websecurityscanner.v1beta.ListFindingTypeStatsResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.websecurityscanner.v1beta.ListFindingTypeStatsResponse + * @static + * @param {google.cloud.websecurityscanner.v1beta.IListFindingTypeStatsResponse} message ListFindingTypeStatsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListFindingTypeStatsResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.findingTypeStats != null && message.findingTypeStats.length) + for (var i = 0; i < message.findingTypeStats.length; ++i) + $root.google.cloud.websecurityscanner.v1beta.FindingTypeStats.encode(message.findingTypeStats[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified ListFindingTypeStatsResponse message, length delimited. Does not implicitly {@link google.cloud.websecurityscanner.v1beta.ListFindingTypeStatsResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.websecurityscanner.v1beta.ListFindingTypeStatsResponse + * @static + * @param {google.cloud.websecurityscanner.v1beta.IListFindingTypeStatsResponse} message ListFindingTypeStatsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListFindingTypeStatsResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListFindingTypeStatsResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.websecurityscanner.v1beta.ListFindingTypeStatsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.websecurityscanner.v1beta.ListFindingTypeStatsResponse} ListFindingTypeStatsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListFindingTypeStatsResponse.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.websecurityscanner.v1beta.ListFindingTypeStatsResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.findingTypeStats && message.findingTypeStats.length)) + message.findingTypeStats = []; + message.findingTypeStats.push($root.google.cloud.websecurityscanner.v1beta.FindingTypeStats.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListFindingTypeStatsResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.websecurityscanner.v1beta.ListFindingTypeStatsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.websecurityscanner.v1beta.ListFindingTypeStatsResponse} ListFindingTypeStatsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListFindingTypeStatsResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListFindingTypeStatsResponse message. + * @function verify + * @memberof google.cloud.websecurityscanner.v1beta.ListFindingTypeStatsResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListFindingTypeStatsResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.findingTypeStats != null && message.hasOwnProperty("findingTypeStats")) { + if (!Array.isArray(message.findingTypeStats)) + return "findingTypeStats: array expected"; + for (var i = 0; i < message.findingTypeStats.length; ++i) { + var error = $root.google.cloud.websecurityscanner.v1beta.FindingTypeStats.verify(message.findingTypeStats[i]); + if (error) + return "findingTypeStats." + error; + } + } + return null; + }; + + /** + * Creates a ListFindingTypeStatsResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.websecurityscanner.v1beta.ListFindingTypeStatsResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.websecurityscanner.v1beta.ListFindingTypeStatsResponse} ListFindingTypeStatsResponse + */ + ListFindingTypeStatsResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.websecurityscanner.v1beta.ListFindingTypeStatsResponse) + return object; + var message = new $root.google.cloud.websecurityscanner.v1beta.ListFindingTypeStatsResponse(); + if (object.findingTypeStats) { + if (!Array.isArray(object.findingTypeStats)) + throw TypeError(".google.cloud.websecurityscanner.v1beta.ListFindingTypeStatsResponse.findingTypeStats: array expected"); + message.findingTypeStats = []; + for (var i = 0; i < object.findingTypeStats.length; ++i) { + if (typeof object.findingTypeStats[i] !== "object") + throw TypeError(".google.cloud.websecurityscanner.v1beta.ListFindingTypeStatsResponse.findingTypeStats: object expected"); + message.findingTypeStats[i] = $root.google.cloud.websecurityscanner.v1beta.FindingTypeStats.fromObject(object.findingTypeStats[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a ListFindingTypeStatsResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.websecurityscanner.v1beta.ListFindingTypeStatsResponse + * @static + * @param {google.cloud.websecurityscanner.v1beta.ListFindingTypeStatsResponse} message ListFindingTypeStatsResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListFindingTypeStatsResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.findingTypeStats = []; + if (message.findingTypeStats && message.findingTypeStats.length) { + object.findingTypeStats = []; + for (var j = 0; j < message.findingTypeStats.length; ++j) + object.findingTypeStats[j] = $root.google.cloud.websecurityscanner.v1beta.FindingTypeStats.toObject(message.findingTypeStats[j], options); + } + return object; + }; + + /** + * Converts this ListFindingTypeStatsResponse to JSON. + * @function toJSON + * @memberof google.cloud.websecurityscanner.v1beta.ListFindingTypeStatsResponse + * @instance + * @returns {Object.} JSON object + */ + ListFindingTypeStatsResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListFindingTypeStatsResponse + * @function getTypeUrl + * @memberof google.cloud.websecurityscanner.v1beta.ListFindingTypeStatsResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListFindingTypeStatsResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.websecurityscanner.v1beta.ListFindingTypeStatsResponse"; + }; + + return ListFindingTypeStatsResponse; + })(); + + return v1beta; + })(); + + return websecurityscanner; + })(); + + return cloud; + })(); + + google.api = (function() { + + /** + * Namespace api. + * @memberof google + * @namespace + */ + var api = {}; + + /** + * FieldBehavior enum. + * @name google.api.FieldBehavior + * @enum {number} + * @property {number} FIELD_BEHAVIOR_UNSPECIFIED=0 FIELD_BEHAVIOR_UNSPECIFIED value + * @property {number} OPTIONAL=1 OPTIONAL value + * @property {number} REQUIRED=2 REQUIRED value + * @property {number} OUTPUT_ONLY=3 OUTPUT_ONLY value + * @property {number} INPUT_ONLY=4 INPUT_ONLY value + * @property {number} IMMUTABLE=5 IMMUTABLE value + * @property {number} UNORDERED_LIST=6 UNORDERED_LIST value + * @property {number} NON_EMPTY_DEFAULT=7 NON_EMPTY_DEFAULT value + */ + api.FieldBehavior = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "FIELD_BEHAVIOR_UNSPECIFIED"] = 0; + values[valuesById[1] = "OPTIONAL"] = 1; + values[valuesById[2] = "REQUIRED"] = 2; + values[valuesById[3] = "OUTPUT_ONLY"] = 3; + values[valuesById[4] = "INPUT_ONLY"] = 4; + values[valuesById[5] = "IMMUTABLE"] = 5; + values[valuesById[6] = "UNORDERED_LIST"] = 6; + values[valuesById[7] = "NON_EMPTY_DEFAULT"] = 7; + return values; + })(); + + api.ResourceDescriptor = (function() { + + /** + * Properties of a ResourceDescriptor. + * @memberof google.api + * @interface IResourceDescriptor + * @property {string|null} [type] ResourceDescriptor type + * @property {Array.|null} [pattern] ResourceDescriptor pattern + * @property {string|null} [nameField] ResourceDescriptor nameField + * @property {google.api.ResourceDescriptor.History|null} [history] ResourceDescriptor history + * @property {string|null} [plural] ResourceDescriptor plural + * @property {string|null} [singular] ResourceDescriptor singular + * @property {Array.|null} [style] ResourceDescriptor style + */ + + /** + * Constructs a new ResourceDescriptor. + * @memberof google.api + * @classdesc Represents a ResourceDescriptor. + * @implements IResourceDescriptor + * @constructor + * @param {google.api.IResourceDescriptor=} [properties] Properties to set + */ + function ResourceDescriptor(properties) { + this.pattern = []; + this.style = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ResourceDescriptor type. + * @member {string} type + * @memberof google.api.ResourceDescriptor + * @instance + */ + ResourceDescriptor.prototype.type = ""; + + /** + * ResourceDescriptor pattern. + * @member {Array.} pattern + * @memberof google.api.ResourceDescriptor + * @instance + */ + ResourceDescriptor.prototype.pattern = $util.emptyArray; + + /** + * ResourceDescriptor nameField. + * @member {string} nameField + * @memberof google.api.ResourceDescriptor + * @instance + */ + ResourceDescriptor.prototype.nameField = ""; + + /** + * ResourceDescriptor history. + * @member {google.api.ResourceDescriptor.History} history + * @memberof google.api.ResourceDescriptor + * @instance + */ + ResourceDescriptor.prototype.history = 0; + + /** + * ResourceDescriptor plural. + * @member {string} plural + * @memberof google.api.ResourceDescriptor + * @instance + */ + ResourceDescriptor.prototype.plural = ""; + + /** + * ResourceDescriptor singular. + * @member {string} singular + * @memberof google.api.ResourceDescriptor + * @instance + */ + ResourceDescriptor.prototype.singular = ""; + + /** + * ResourceDescriptor style. + * @member {Array.} style + * @memberof google.api.ResourceDescriptor + * @instance + */ + ResourceDescriptor.prototype.style = $util.emptyArray; + + /** + * Creates a new ResourceDescriptor instance using the specified properties. + * @function create + * @memberof google.api.ResourceDescriptor + * @static + * @param {google.api.IResourceDescriptor=} [properties] Properties to set + * @returns {google.api.ResourceDescriptor} ResourceDescriptor instance + */ + ResourceDescriptor.create = function create(properties) { + return new ResourceDescriptor(properties); + }; + + /** + * Encodes the specified ResourceDescriptor message. Does not implicitly {@link google.api.ResourceDescriptor.verify|verify} messages. + * @function encode + * @memberof google.api.ResourceDescriptor + * @static + * @param {google.api.IResourceDescriptor} message ResourceDescriptor message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ResourceDescriptor.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.type != null && Object.hasOwnProperty.call(message, "type")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.type); + if (message.pattern != null && message.pattern.length) + for (var i = 0; i < message.pattern.length; ++i) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.pattern[i]); + if (message.nameField != null && Object.hasOwnProperty.call(message, "nameField")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.nameField); + if (message.history != null && Object.hasOwnProperty.call(message, "history")) + writer.uint32(/* id 4, wireType 0 =*/32).int32(message.history); + if (message.plural != null && Object.hasOwnProperty.call(message, "plural")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.plural); + if (message.singular != null && Object.hasOwnProperty.call(message, "singular")) + writer.uint32(/* id 6, wireType 2 =*/50).string(message.singular); + if (message.style != null && message.style.length) { + writer.uint32(/* id 10, wireType 2 =*/82).fork(); + for (var i = 0; i < message.style.length; ++i) + writer.int32(message.style[i]); + writer.ldelim(); + } + return writer; + }; + + /** + * Encodes the specified ResourceDescriptor message, length delimited. Does not implicitly {@link google.api.ResourceDescriptor.verify|verify} messages. + * @function encodeDelimited + * @memberof google.api.ResourceDescriptor + * @static + * @param {google.api.IResourceDescriptor} message ResourceDescriptor message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ResourceDescriptor.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ResourceDescriptor message from the specified reader or buffer. + * @function decode + * @memberof google.api.ResourceDescriptor + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.api.ResourceDescriptor} ResourceDescriptor + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ResourceDescriptor.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.ResourceDescriptor(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.type = reader.string(); + break; + } + case 2: { + if (!(message.pattern && message.pattern.length)) + message.pattern = []; + message.pattern.push(reader.string()); + break; + } + case 3: { + message.nameField = reader.string(); + break; + } + case 4: { + message.history = reader.int32(); + break; + } + case 5: { + message.plural = reader.string(); + break; + } + case 6: { + message.singular = reader.string(); + break; + } + case 10: { + if (!(message.style && message.style.length)) + message.style = []; + if ((tag & 7) === 2) { + var end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) + message.style.push(reader.int32()); + } else + message.style.push(reader.int32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ResourceDescriptor message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.api.ResourceDescriptor + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.api.ResourceDescriptor} ResourceDescriptor + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ResourceDescriptor.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ResourceDescriptor message. + * @function verify + * @memberof google.api.ResourceDescriptor + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ResourceDescriptor.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.type != null && message.hasOwnProperty("type")) + if (!$util.isString(message.type)) + return "type: string expected"; + if (message.pattern != null && message.hasOwnProperty("pattern")) { + if (!Array.isArray(message.pattern)) + return "pattern: array expected"; + for (var i = 0; i < message.pattern.length; ++i) + if (!$util.isString(message.pattern[i])) + return "pattern: string[] expected"; + } + if (message.nameField != null && message.hasOwnProperty("nameField")) + if (!$util.isString(message.nameField)) + return "nameField: string expected"; + if (message.history != null && message.hasOwnProperty("history")) + switch (message.history) { + default: + return "history: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.plural != null && message.hasOwnProperty("plural")) + if (!$util.isString(message.plural)) + return "plural: string expected"; + if (message.singular != null && message.hasOwnProperty("singular")) + if (!$util.isString(message.singular)) + return "singular: string expected"; + if (message.style != null && message.hasOwnProperty("style")) { + if (!Array.isArray(message.style)) + return "style: array expected"; + for (var i = 0; i < message.style.length; ++i) + switch (message.style[i]) { + default: + return "style: enum value[] expected"; + case 0: + case 1: + break; + } + } + return null; + }; + + /** + * Creates a ResourceDescriptor message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.api.ResourceDescriptor + * @static + * @param {Object.} object Plain object + * @returns {google.api.ResourceDescriptor} ResourceDescriptor + */ + ResourceDescriptor.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.ResourceDescriptor) + return object; + var message = new $root.google.api.ResourceDescriptor(); + if (object.type != null) + message.type = String(object.type); + if (object.pattern) { + if (!Array.isArray(object.pattern)) + throw TypeError(".google.api.ResourceDescriptor.pattern: array expected"); + message.pattern = []; + for (var i = 0; i < object.pattern.length; ++i) + message.pattern[i] = String(object.pattern[i]); + } + if (object.nameField != null) + message.nameField = String(object.nameField); + switch (object.history) { + default: + if (typeof object.history === "number") { + message.history = object.history; + break; + } + break; + case "HISTORY_UNSPECIFIED": + case 0: + message.history = 0; + break; + case "ORIGINALLY_SINGLE_PATTERN": + case 1: + message.history = 1; + break; + case "FUTURE_MULTI_PATTERN": + case 2: + message.history = 2; + break; + } + if (object.plural != null) + message.plural = String(object.plural); + if (object.singular != null) + message.singular = String(object.singular); + if (object.style) { + if (!Array.isArray(object.style)) + throw TypeError(".google.api.ResourceDescriptor.style: array expected"); + message.style = []; + for (var i = 0; i < object.style.length; ++i) + switch (object.style[i]) { + default: + if (typeof object.style[i] === "number") { + message.style[i] = object.style[i]; + break; + } + case "STYLE_UNSPECIFIED": + case 0: + message.style[i] = 0; + break; + case "DECLARATIVE_FRIENDLY": + case 1: + message.style[i] = 1; + break; + } + } + return message; + }; + + /** + * Creates a plain object from a ResourceDescriptor message. Also converts values to other types if specified. + * @function toObject + * @memberof google.api.ResourceDescriptor + * @static + * @param {google.api.ResourceDescriptor} message ResourceDescriptor + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ResourceDescriptor.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.pattern = []; + object.style = []; + } + if (options.defaults) { + object.type = ""; + object.nameField = ""; + object.history = options.enums === String ? "HISTORY_UNSPECIFIED" : 0; + object.plural = ""; + object.singular = ""; + } + if (message.type != null && message.hasOwnProperty("type")) + object.type = message.type; + if (message.pattern && message.pattern.length) { + object.pattern = []; + for (var j = 0; j < message.pattern.length; ++j) + object.pattern[j] = message.pattern[j]; + } + if (message.nameField != null && message.hasOwnProperty("nameField")) + object.nameField = message.nameField; + if (message.history != null && message.hasOwnProperty("history")) + object.history = options.enums === String ? $root.google.api.ResourceDescriptor.History[message.history] === undefined ? message.history : $root.google.api.ResourceDescriptor.History[message.history] : message.history; + if (message.plural != null && message.hasOwnProperty("plural")) + object.plural = message.plural; + if (message.singular != null && message.hasOwnProperty("singular")) + object.singular = message.singular; + if (message.style && message.style.length) { + object.style = []; + for (var j = 0; j < message.style.length; ++j) + object.style[j] = options.enums === String ? $root.google.api.ResourceDescriptor.Style[message.style[j]] === undefined ? message.style[j] : $root.google.api.ResourceDescriptor.Style[message.style[j]] : message.style[j]; + } + return object; + }; + + /** + * Converts this ResourceDescriptor to JSON. + * @function toJSON + * @memberof google.api.ResourceDescriptor + * @instance + * @returns {Object.} JSON object + */ + ResourceDescriptor.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ResourceDescriptor + * @function getTypeUrl + * @memberof google.api.ResourceDescriptor + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ResourceDescriptor.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.api.ResourceDescriptor"; + }; + + /** + * History enum. + * @name google.api.ResourceDescriptor.History + * @enum {number} + * @property {number} HISTORY_UNSPECIFIED=0 HISTORY_UNSPECIFIED value + * @property {number} ORIGINALLY_SINGLE_PATTERN=1 ORIGINALLY_SINGLE_PATTERN value + * @property {number} FUTURE_MULTI_PATTERN=2 FUTURE_MULTI_PATTERN value + */ + ResourceDescriptor.History = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "HISTORY_UNSPECIFIED"] = 0; + values[valuesById[1] = "ORIGINALLY_SINGLE_PATTERN"] = 1; + values[valuesById[2] = "FUTURE_MULTI_PATTERN"] = 2; + return values; + })(); + + /** + * Style enum. + * @name google.api.ResourceDescriptor.Style + * @enum {number} + * @property {number} STYLE_UNSPECIFIED=0 STYLE_UNSPECIFIED value + * @property {number} DECLARATIVE_FRIENDLY=1 DECLARATIVE_FRIENDLY value + */ + ResourceDescriptor.Style = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "STYLE_UNSPECIFIED"] = 0; + values[valuesById[1] = "DECLARATIVE_FRIENDLY"] = 1; + return values; + })(); + + return ResourceDescriptor; + })(); + + api.ResourceReference = (function() { + + /** + * Properties of a ResourceReference. + * @memberof google.api + * @interface IResourceReference + * @property {string|null} [type] ResourceReference type + * @property {string|null} [childType] ResourceReference childType + */ + + /** + * Constructs a new ResourceReference. + * @memberof google.api + * @classdesc Represents a ResourceReference. + * @implements IResourceReference + * @constructor + * @param {google.api.IResourceReference=} [properties] Properties to set + */ + function ResourceReference(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ResourceReference type. + * @member {string} type + * @memberof google.api.ResourceReference + * @instance + */ + ResourceReference.prototype.type = ""; + + /** + * ResourceReference childType. + * @member {string} childType + * @memberof google.api.ResourceReference + * @instance + */ + ResourceReference.prototype.childType = ""; + + /** + * Creates a new ResourceReference instance using the specified properties. + * @function create + * @memberof google.api.ResourceReference + * @static + * @param {google.api.IResourceReference=} [properties] Properties to set + * @returns {google.api.ResourceReference} ResourceReference instance + */ + ResourceReference.create = function create(properties) { + return new ResourceReference(properties); + }; + + /** + * Encodes the specified ResourceReference message. Does not implicitly {@link google.api.ResourceReference.verify|verify} messages. + * @function encode + * @memberof google.api.ResourceReference + * @static + * @param {google.api.IResourceReference} message ResourceReference message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ResourceReference.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.type != null && Object.hasOwnProperty.call(message, "type")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.type); + if (message.childType != null && Object.hasOwnProperty.call(message, "childType")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.childType); + return writer; + }; + + /** + * Encodes the specified ResourceReference message, length delimited. Does not implicitly {@link google.api.ResourceReference.verify|verify} messages. + * @function encodeDelimited + * @memberof google.api.ResourceReference + * @static + * @param {google.api.IResourceReference} message ResourceReference message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ResourceReference.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ResourceReference message from the specified reader or buffer. + * @function decode + * @memberof google.api.ResourceReference + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.api.ResourceReference} ResourceReference + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ResourceReference.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.ResourceReference(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.type = reader.string(); + break; + } + case 2: { + message.childType = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ResourceReference message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.api.ResourceReference + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.api.ResourceReference} ResourceReference + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ResourceReference.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ResourceReference message. + * @function verify + * @memberof google.api.ResourceReference + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ResourceReference.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.type != null && message.hasOwnProperty("type")) + if (!$util.isString(message.type)) + return "type: string expected"; + if (message.childType != null && message.hasOwnProperty("childType")) + if (!$util.isString(message.childType)) + return "childType: string expected"; + return null; + }; + + /** + * Creates a ResourceReference message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.api.ResourceReference + * @static + * @param {Object.} object Plain object + * @returns {google.api.ResourceReference} ResourceReference + */ + ResourceReference.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.ResourceReference) + return object; + var message = new $root.google.api.ResourceReference(); + if (object.type != null) + message.type = String(object.type); + if (object.childType != null) + message.childType = String(object.childType); + return message; + }; + + /** + * Creates a plain object from a ResourceReference message. Also converts values to other types if specified. + * @function toObject + * @memberof google.api.ResourceReference + * @static + * @param {google.api.ResourceReference} message ResourceReference + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ResourceReference.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.type = ""; + object.childType = ""; + } + if (message.type != null && message.hasOwnProperty("type")) + object.type = message.type; + if (message.childType != null && message.hasOwnProperty("childType")) + object.childType = message.childType; + return object; + }; + + /** + * Converts this ResourceReference to JSON. + * @function toJSON + * @memberof google.api.ResourceReference + * @instance + * @returns {Object.} JSON object + */ + ResourceReference.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ResourceReference + * @function getTypeUrl + * @memberof google.api.ResourceReference + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ResourceReference.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.api.ResourceReference"; + }; + + return ResourceReference; + })(); + + api.Http = (function() { + + /** + * Properties of a Http. + * @memberof google.api + * @interface IHttp + * @property {Array.|null} [rules] Http rules + * @property {boolean|null} [fullyDecodeReservedExpansion] Http fullyDecodeReservedExpansion + */ + + /** + * Constructs a new Http. + * @memberof google.api + * @classdesc Represents a Http. + * @implements IHttp + * @constructor + * @param {google.api.IHttp=} [properties] Properties to set + */ + function Http(properties) { + this.rules = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Http rules. + * @member {Array.} rules + * @memberof google.api.Http + * @instance + */ + Http.prototype.rules = $util.emptyArray; + + /** + * Http fullyDecodeReservedExpansion. + * @member {boolean} fullyDecodeReservedExpansion + * @memberof google.api.Http + * @instance + */ + Http.prototype.fullyDecodeReservedExpansion = false; + + /** + * Creates a new Http instance using the specified properties. + * @function create + * @memberof google.api.Http + * @static + * @param {google.api.IHttp=} [properties] Properties to set + * @returns {google.api.Http} Http instance + */ + Http.create = function create(properties) { + return new Http(properties); + }; + + /** + * Encodes the specified Http message. Does not implicitly {@link google.api.Http.verify|verify} messages. + * @function encode + * @memberof google.api.Http + * @static + * @param {google.api.IHttp} message Http message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Http.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.rules != null && message.rules.length) + for (var i = 0; i < message.rules.length; ++i) + $root.google.api.HttpRule.encode(message.rules[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.fullyDecodeReservedExpansion != null && Object.hasOwnProperty.call(message, "fullyDecodeReservedExpansion")) + writer.uint32(/* id 2, wireType 0 =*/16).bool(message.fullyDecodeReservedExpansion); + return writer; + }; + + /** + * Encodes the specified Http message, length delimited. Does not implicitly {@link google.api.Http.verify|verify} messages. + * @function encodeDelimited + * @memberof google.api.Http + * @static + * @param {google.api.IHttp} message Http message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Http.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Http message from the specified reader or buffer. + * @function decode + * @memberof google.api.Http + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.api.Http} Http + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Http.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.Http(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.rules && message.rules.length)) + message.rules = []; + message.rules.push($root.google.api.HttpRule.decode(reader, reader.uint32())); + break; + } + case 2: { + message.fullyDecodeReservedExpansion = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Http message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.api.Http + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.api.Http} Http + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Http.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Http message. + * @function verify + * @memberof google.api.Http + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Http.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.rules != null && message.hasOwnProperty("rules")) { + if (!Array.isArray(message.rules)) + return "rules: array expected"; + for (var i = 0; i < message.rules.length; ++i) { + var error = $root.google.api.HttpRule.verify(message.rules[i]); + if (error) + return "rules." + error; + } + } + if (message.fullyDecodeReservedExpansion != null && message.hasOwnProperty("fullyDecodeReservedExpansion")) + if (typeof message.fullyDecodeReservedExpansion !== "boolean") + return "fullyDecodeReservedExpansion: boolean expected"; + return null; + }; + + /** + * Creates a Http message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.api.Http + * @static + * @param {Object.} object Plain object + * @returns {google.api.Http} Http + */ + Http.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.Http) + return object; + var message = new $root.google.api.Http(); + if (object.rules) { + if (!Array.isArray(object.rules)) + throw TypeError(".google.api.Http.rules: array expected"); + message.rules = []; + for (var i = 0; i < object.rules.length; ++i) { + if (typeof object.rules[i] !== "object") + throw TypeError(".google.api.Http.rules: object expected"); + message.rules[i] = $root.google.api.HttpRule.fromObject(object.rules[i]); + } + } + if (object.fullyDecodeReservedExpansion != null) + message.fullyDecodeReservedExpansion = Boolean(object.fullyDecodeReservedExpansion); + return message; + }; + + /** + * Creates a plain object from a Http message. Also converts values to other types if specified. + * @function toObject + * @memberof google.api.Http + * @static + * @param {google.api.Http} message Http + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Http.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.rules = []; + if (options.defaults) + object.fullyDecodeReservedExpansion = false; + if (message.rules && message.rules.length) { + object.rules = []; + for (var j = 0; j < message.rules.length; ++j) + object.rules[j] = $root.google.api.HttpRule.toObject(message.rules[j], options); + } + if (message.fullyDecodeReservedExpansion != null && message.hasOwnProperty("fullyDecodeReservedExpansion")) + object.fullyDecodeReservedExpansion = message.fullyDecodeReservedExpansion; + return object; + }; + + /** + * Converts this Http to JSON. + * @function toJSON + * @memberof google.api.Http + * @instance + * @returns {Object.} JSON object + */ + Http.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Http + * @function getTypeUrl + * @memberof google.api.Http + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Http.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.api.Http"; + }; + + return Http; + })(); + + api.HttpRule = (function() { + + /** + * Properties of a HttpRule. + * @memberof google.api + * @interface IHttpRule + * @property {string|null} [selector] HttpRule selector + * @property {string|null} [get] HttpRule get + * @property {string|null} [put] HttpRule put + * @property {string|null} [post] HttpRule post + * @property {string|null} ["delete"] HttpRule delete + * @property {string|null} [patch] HttpRule patch + * @property {google.api.ICustomHttpPattern|null} [custom] HttpRule custom + * @property {string|null} [body] HttpRule body + * @property {string|null} [responseBody] HttpRule responseBody + * @property {Array.|null} [additionalBindings] HttpRule additionalBindings + */ + + /** + * Constructs a new HttpRule. + * @memberof google.api + * @classdesc Represents a HttpRule. + * @implements IHttpRule + * @constructor + * @param {google.api.IHttpRule=} [properties] Properties to set + */ + function HttpRule(properties) { + this.additionalBindings = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * HttpRule selector. + * @member {string} selector + * @memberof google.api.HttpRule + * @instance + */ + HttpRule.prototype.selector = ""; + + /** + * HttpRule get. + * @member {string|null|undefined} get + * @memberof google.api.HttpRule + * @instance + */ + HttpRule.prototype.get = null; + + /** + * HttpRule put. + * @member {string|null|undefined} put + * @memberof google.api.HttpRule + * @instance + */ + HttpRule.prototype.put = null; + + /** + * HttpRule post. + * @member {string|null|undefined} post + * @memberof google.api.HttpRule + * @instance + */ + HttpRule.prototype.post = null; + + /** + * HttpRule delete. + * @member {string|null|undefined} delete + * @memberof google.api.HttpRule + * @instance + */ + HttpRule.prototype["delete"] = null; + + /** + * HttpRule patch. + * @member {string|null|undefined} patch + * @memberof google.api.HttpRule + * @instance + */ + HttpRule.prototype.patch = null; + + /** + * HttpRule custom. + * @member {google.api.ICustomHttpPattern|null|undefined} custom + * @memberof google.api.HttpRule + * @instance + */ + HttpRule.prototype.custom = null; + + /** + * HttpRule body. + * @member {string} body + * @memberof google.api.HttpRule + * @instance + */ + HttpRule.prototype.body = ""; + + /** + * HttpRule responseBody. + * @member {string} responseBody + * @memberof google.api.HttpRule + * @instance + */ + HttpRule.prototype.responseBody = ""; + + /** + * HttpRule additionalBindings. + * @member {Array.} additionalBindings + * @memberof google.api.HttpRule + * @instance + */ + HttpRule.prototype.additionalBindings = $util.emptyArray; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * HttpRule pattern. + * @member {"get"|"put"|"post"|"delete"|"patch"|"custom"|undefined} pattern + * @memberof google.api.HttpRule + * @instance + */ + Object.defineProperty(HttpRule.prototype, "pattern", { + get: $util.oneOfGetter($oneOfFields = ["get", "put", "post", "delete", "patch", "custom"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new HttpRule instance using the specified properties. + * @function create + * @memberof google.api.HttpRule + * @static + * @param {google.api.IHttpRule=} [properties] Properties to set + * @returns {google.api.HttpRule} HttpRule instance + */ + HttpRule.create = function create(properties) { + return new HttpRule(properties); + }; + + /** + * Encodes the specified HttpRule message. Does not implicitly {@link google.api.HttpRule.verify|verify} messages. + * @function encode + * @memberof google.api.HttpRule + * @static + * @param {google.api.IHttpRule} message HttpRule message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + HttpRule.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.selector != null && Object.hasOwnProperty.call(message, "selector")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.selector); + if (message.get != null && Object.hasOwnProperty.call(message, "get")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.get); + if (message.put != null && Object.hasOwnProperty.call(message, "put")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.put); + if (message.post != null && Object.hasOwnProperty.call(message, "post")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.post); + if (message["delete"] != null && Object.hasOwnProperty.call(message, "delete")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message["delete"]); + if (message.patch != null && Object.hasOwnProperty.call(message, "patch")) + writer.uint32(/* id 6, wireType 2 =*/50).string(message.patch); + if (message.body != null && Object.hasOwnProperty.call(message, "body")) + writer.uint32(/* id 7, wireType 2 =*/58).string(message.body); + if (message.custom != null && Object.hasOwnProperty.call(message, "custom")) + $root.google.api.CustomHttpPattern.encode(message.custom, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); + if (message.additionalBindings != null && message.additionalBindings.length) + for (var i = 0; i < message.additionalBindings.length; ++i) + $root.google.api.HttpRule.encode(message.additionalBindings[i], writer.uint32(/* id 11, wireType 2 =*/90).fork()).ldelim(); + if (message.responseBody != null && Object.hasOwnProperty.call(message, "responseBody")) + writer.uint32(/* id 12, wireType 2 =*/98).string(message.responseBody); + return writer; + }; + + /** + * Encodes the specified HttpRule message, length delimited. Does not implicitly {@link google.api.HttpRule.verify|verify} messages. + * @function encodeDelimited + * @memberof google.api.HttpRule + * @static + * @param {google.api.IHttpRule} message HttpRule message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + HttpRule.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a HttpRule message from the specified reader or buffer. + * @function decode + * @memberof google.api.HttpRule + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.api.HttpRule} HttpRule + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + HttpRule.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.HttpRule(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.selector = reader.string(); + break; + } + case 2: { + message.get = reader.string(); + break; + } + case 3: { + message.put = reader.string(); + break; + } + case 4: { + message.post = reader.string(); + break; + } + case 5: { + message["delete"] = reader.string(); + break; + } + case 6: { + message.patch = reader.string(); + break; + } + case 8: { + message.custom = $root.google.api.CustomHttpPattern.decode(reader, reader.uint32()); + break; + } + case 7: { + message.body = reader.string(); + break; + } + case 12: { + message.responseBody = reader.string(); + break; + } + case 11: { + if (!(message.additionalBindings && message.additionalBindings.length)) + message.additionalBindings = []; + message.additionalBindings.push($root.google.api.HttpRule.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a HttpRule message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.api.HttpRule + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.api.HttpRule} HttpRule + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + HttpRule.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a HttpRule message. + * @function verify + * @memberof google.api.HttpRule + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + HttpRule.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.selector != null && message.hasOwnProperty("selector")) + if (!$util.isString(message.selector)) + return "selector: string expected"; + if (message.get != null && message.hasOwnProperty("get")) { + properties.pattern = 1; + if (!$util.isString(message.get)) + return "get: string expected"; + } + if (message.put != null && message.hasOwnProperty("put")) { + if (properties.pattern === 1) + return "pattern: multiple values"; + properties.pattern = 1; + if (!$util.isString(message.put)) + return "put: string expected"; + } + if (message.post != null && message.hasOwnProperty("post")) { + if (properties.pattern === 1) + return "pattern: multiple values"; + properties.pattern = 1; + if (!$util.isString(message.post)) + return "post: string expected"; + } + if (message["delete"] != null && message.hasOwnProperty("delete")) { + if (properties.pattern === 1) + return "pattern: multiple values"; + properties.pattern = 1; + if (!$util.isString(message["delete"])) + return "delete: string expected"; + } + if (message.patch != null && message.hasOwnProperty("patch")) { + if (properties.pattern === 1) + return "pattern: multiple values"; + properties.pattern = 1; + if (!$util.isString(message.patch)) + return "patch: string expected"; + } + if (message.custom != null && message.hasOwnProperty("custom")) { + if (properties.pattern === 1) + return "pattern: multiple values"; + properties.pattern = 1; + { + var error = $root.google.api.CustomHttpPattern.verify(message.custom); + if (error) + return "custom." + error; + } + } + if (message.body != null && message.hasOwnProperty("body")) + if (!$util.isString(message.body)) + return "body: string expected"; + if (message.responseBody != null && message.hasOwnProperty("responseBody")) + if (!$util.isString(message.responseBody)) + return "responseBody: string expected"; + if (message.additionalBindings != null && message.hasOwnProperty("additionalBindings")) { + if (!Array.isArray(message.additionalBindings)) + return "additionalBindings: array expected"; + for (var i = 0; i < message.additionalBindings.length; ++i) { + var error = $root.google.api.HttpRule.verify(message.additionalBindings[i]); + if (error) + return "additionalBindings." + error; + } + } + return null; + }; + + /** + * Creates a HttpRule message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.api.HttpRule + * @static + * @param {Object.} object Plain object + * @returns {google.api.HttpRule} HttpRule + */ + HttpRule.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.HttpRule) + return object; + var message = new $root.google.api.HttpRule(); + if (object.selector != null) + message.selector = String(object.selector); + if (object.get != null) + message.get = String(object.get); + if (object.put != null) + message.put = String(object.put); + if (object.post != null) + message.post = String(object.post); + if (object["delete"] != null) + message["delete"] = String(object["delete"]); + if (object.patch != null) + message.patch = String(object.patch); + if (object.custom != null) { + if (typeof object.custom !== "object") + throw TypeError(".google.api.HttpRule.custom: object expected"); + message.custom = $root.google.api.CustomHttpPattern.fromObject(object.custom); + } + if (object.body != null) + message.body = String(object.body); + if (object.responseBody != null) + message.responseBody = String(object.responseBody); + if (object.additionalBindings) { + if (!Array.isArray(object.additionalBindings)) + throw TypeError(".google.api.HttpRule.additionalBindings: array expected"); + message.additionalBindings = []; + for (var i = 0; i < object.additionalBindings.length; ++i) { + if (typeof object.additionalBindings[i] !== "object") + throw TypeError(".google.api.HttpRule.additionalBindings: object expected"); + message.additionalBindings[i] = $root.google.api.HttpRule.fromObject(object.additionalBindings[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a HttpRule message. Also converts values to other types if specified. + * @function toObject + * @memberof google.api.HttpRule + * @static + * @param {google.api.HttpRule} message HttpRule + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + HttpRule.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.additionalBindings = []; + if (options.defaults) { + object.selector = ""; + object.body = ""; + object.responseBody = ""; + } + if (message.selector != null && message.hasOwnProperty("selector")) + object.selector = message.selector; + if (message.get != null && message.hasOwnProperty("get")) { + object.get = message.get; + if (options.oneofs) + object.pattern = "get"; + } + if (message.put != null && message.hasOwnProperty("put")) { + object.put = message.put; + if (options.oneofs) + object.pattern = "put"; + } + if (message.post != null && message.hasOwnProperty("post")) { + object.post = message.post; + if (options.oneofs) + object.pattern = "post"; + } + if (message["delete"] != null && message.hasOwnProperty("delete")) { + object["delete"] = message["delete"]; + if (options.oneofs) + object.pattern = "delete"; + } + if (message.patch != null && message.hasOwnProperty("patch")) { + object.patch = message.patch; + if (options.oneofs) + object.pattern = "patch"; + } + if (message.body != null && message.hasOwnProperty("body")) + object.body = message.body; + if (message.custom != null && message.hasOwnProperty("custom")) { + object.custom = $root.google.api.CustomHttpPattern.toObject(message.custom, options); + if (options.oneofs) + object.pattern = "custom"; + } + if (message.additionalBindings && message.additionalBindings.length) { + object.additionalBindings = []; + for (var j = 0; j < message.additionalBindings.length; ++j) + object.additionalBindings[j] = $root.google.api.HttpRule.toObject(message.additionalBindings[j], options); + } + if (message.responseBody != null && message.hasOwnProperty("responseBody")) + object.responseBody = message.responseBody; + return object; + }; + + /** + * Converts this HttpRule to JSON. + * @function toJSON + * @memberof google.api.HttpRule + * @instance + * @returns {Object.} JSON object + */ + HttpRule.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for HttpRule + * @function getTypeUrl + * @memberof google.api.HttpRule + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + HttpRule.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.api.HttpRule"; + }; + + return HttpRule; + })(); + + api.CustomHttpPattern = (function() { + + /** + * Properties of a CustomHttpPattern. + * @memberof google.api + * @interface ICustomHttpPattern + * @property {string|null} [kind] CustomHttpPattern kind + * @property {string|null} [path] CustomHttpPattern path + */ + + /** + * Constructs a new CustomHttpPattern. + * @memberof google.api + * @classdesc Represents a CustomHttpPattern. + * @implements ICustomHttpPattern + * @constructor + * @param {google.api.ICustomHttpPattern=} [properties] Properties to set + */ + function CustomHttpPattern(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * CustomHttpPattern kind. + * @member {string} kind + * @memberof google.api.CustomHttpPattern + * @instance + */ + CustomHttpPattern.prototype.kind = ""; + + /** + * CustomHttpPattern path. + * @member {string} path + * @memberof google.api.CustomHttpPattern + * @instance + */ + CustomHttpPattern.prototype.path = ""; + + /** + * Creates a new CustomHttpPattern instance using the specified properties. + * @function create + * @memberof google.api.CustomHttpPattern + * @static + * @param {google.api.ICustomHttpPattern=} [properties] Properties to set + * @returns {google.api.CustomHttpPattern} CustomHttpPattern instance + */ + CustomHttpPattern.create = function create(properties) { + return new CustomHttpPattern(properties); + }; + + /** + * Encodes the specified CustomHttpPattern message. Does not implicitly {@link google.api.CustomHttpPattern.verify|verify} messages. + * @function encode + * @memberof google.api.CustomHttpPattern + * @static + * @param {google.api.ICustomHttpPattern} message CustomHttpPattern message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CustomHttpPattern.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.kind != null && Object.hasOwnProperty.call(message, "kind")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.kind); + if (message.path != null && Object.hasOwnProperty.call(message, "path")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.path); + return writer; + }; + + /** + * Encodes the specified CustomHttpPattern message, length delimited. Does not implicitly {@link google.api.CustomHttpPattern.verify|verify} messages. + * @function encodeDelimited + * @memberof google.api.CustomHttpPattern + * @static + * @param {google.api.ICustomHttpPattern} message CustomHttpPattern message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CustomHttpPattern.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CustomHttpPattern message from the specified reader or buffer. + * @function decode + * @memberof google.api.CustomHttpPattern + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.api.CustomHttpPattern} CustomHttpPattern + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CustomHttpPattern.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.CustomHttpPattern(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.kind = reader.string(); + break; + } + case 2: { + message.path = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CustomHttpPattern message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.api.CustomHttpPattern + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.api.CustomHttpPattern} CustomHttpPattern + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CustomHttpPattern.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CustomHttpPattern message. + * @function verify + * @memberof google.api.CustomHttpPattern + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CustomHttpPattern.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.kind != null && message.hasOwnProperty("kind")) + if (!$util.isString(message.kind)) + return "kind: string expected"; + if (message.path != null && message.hasOwnProperty("path")) + if (!$util.isString(message.path)) + return "path: string expected"; + return null; + }; + + /** + * Creates a CustomHttpPattern message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.api.CustomHttpPattern + * @static + * @param {Object.} object Plain object + * @returns {google.api.CustomHttpPattern} CustomHttpPattern + */ + CustomHttpPattern.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.CustomHttpPattern) + return object; + var message = new $root.google.api.CustomHttpPattern(); + if (object.kind != null) + message.kind = String(object.kind); + if (object.path != null) + message.path = String(object.path); + return message; + }; + + /** + * Creates a plain object from a CustomHttpPattern message. Also converts values to other types if specified. + * @function toObject + * @memberof google.api.CustomHttpPattern + * @static + * @param {google.api.CustomHttpPattern} message CustomHttpPattern + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CustomHttpPattern.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.kind = ""; + object.path = ""; + } + if (message.kind != null && message.hasOwnProperty("kind")) + object.kind = message.kind; + if (message.path != null && message.hasOwnProperty("path")) + object.path = message.path; + return object; + }; + + /** + * Converts this CustomHttpPattern to JSON. + * @function toJSON + * @memberof google.api.CustomHttpPattern + * @instance + * @returns {Object.} JSON object + */ + CustomHttpPattern.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CustomHttpPattern + * @function getTypeUrl + * @memberof google.api.CustomHttpPattern + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CustomHttpPattern.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.api.CustomHttpPattern"; + }; + + return CustomHttpPattern; + })(); + + return api; + })(); + + google.protobuf = (function() { + + /** + * Namespace protobuf. + * @memberof google + * @namespace + */ + var protobuf = {}; + + protobuf.FileDescriptorSet = (function() { + + /** + * Properties of a FileDescriptorSet. + * @memberof google.protobuf + * @interface IFileDescriptorSet + * @property {Array.|null} [file] FileDescriptorSet file + */ + + /** + * Constructs a new FileDescriptorSet. + * @memberof google.protobuf + * @classdesc Represents a FileDescriptorSet. + * @implements IFileDescriptorSet + * @constructor + * @param {google.protobuf.IFileDescriptorSet=} [properties] Properties to set + */ + function FileDescriptorSet(properties) { + this.file = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * FileDescriptorSet file. + * @member {Array.} file + * @memberof google.protobuf.FileDescriptorSet + * @instance + */ + FileDescriptorSet.prototype.file = $util.emptyArray; + + /** + * Creates a new FileDescriptorSet instance using the specified properties. + * @function create + * @memberof google.protobuf.FileDescriptorSet + * @static + * @param {google.protobuf.IFileDescriptorSet=} [properties] Properties to set + * @returns {google.protobuf.FileDescriptorSet} FileDescriptorSet instance + */ + FileDescriptorSet.create = function create(properties) { + return new FileDescriptorSet(properties); + }; + + /** + * Encodes the specified FileDescriptorSet message. Does not implicitly {@link google.protobuf.FileDescriptorSet.verify|verify} messages. + * @function encode + * @memberof google.protobuf.FileDescriptorSet + * @static + * @param {google.protobuf.IFileDescriptorSet} message FileDescriptorSet message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FileDescriptorSet.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.file != null && message.file.length) + for (var i = 0; i < message.file.length; ++i) + $root.google.protobuf.FileDescriptorProto.encode(message.file[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified FileDescriptorSet message, length delimited. Does not implicitly {@link google.protobuf.FileDescriptorSet.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.FileDescriptorSet + * @static + * @param {google.protobuf.IFileDescriptorSet} message FileDescriptorSet message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FileDescriptorSet.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a FileDescriptorSet message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.FileDescriptorSet + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.FileDescriptorSet} FileDescriptorSet + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FileDescriptorSet.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.FileDescriptorSet(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.file && message.file.length)) + message.file = []; + message.file.push($root.google.protobuf.FileDescriptorProto.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a FileDescriptorSet message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.FileDescriptorSet + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.FileDescriptorSet} FileDescriptorSet + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FileDescriptorSet.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a FileDescriptorSet message. + * @function verify + * @memberof google.protobuf.FileDescriptorSet + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + FileDescriptorSet.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.file != null && message.hasOwnProperty("file")) { + if (!Array.isArray(message.file)) + return "file: array expected"; + for (var i = 0; i < message.file.length; ++i) { + var error = $root.google.protobuf.FileDescriptorProto.verify(message.file[i]); + if (error) + return "file." + error; + } + } + return null; + }; + + /** + * Creates a FileDescriptorSet message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.FileDescriptorSet + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.FileDescriptorSet} FileDescriptorSet + */ + FileDescriptorSet.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.FileDescriptorSet) + return object; + var message = new $root.google.protobuf.FileDescriptorSet(); + if (object.file) { + if (!Array.isArray(object.file)) + throw TypeError(".google.protobuf.FileDescriptorSet.file: array expected"); + message.file = []; + for (var i = 0; i < object.file.length; ++i) { + if (typeof object.file[i] !== "object") + throw TypeError(".google.protobuf.FileDescriptorSet.file: object expected"); + message.file[i] = $root.google.protobuf.FileDescriptorProto.fromObject(object.file[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a FileDescriptorSet message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.FileDescriptorSet + * @static + * @param {google.protobuf.FileDescriptorSet} message FileDescriptorSet + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + FileDescriptorSet.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.file = []; + if (message.file && message.file.length) { + object.file = []; + for (var j = 0; j < message.file.length; ++j) + object.file[j] = $root.google.protobuf.FileDescriptorProto.toObject(message.file[j], options); + } + return object; + }; + + /** + * Converts this FileDescriptorSet to JSON. + * @function toJSON + * @memberof google.protobuf.FileDescriptorSet + * @instance + * @returns {Object.} JSON object + */ + FileDescriptorSet.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for FileDescriptorSet + * @function getTypeUrl + * @memberof google.protobuf.FileDescriptorSet + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FileDescriptorSet.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.FileDescriptorSet"; + }; + + return FileDescriptorSet; + })(); + + protobuf.FileDescriptorProto = (function() { + + /** + * Properties of a FileDescriptorProto. + * @memberof google.protobuf + * @interface IFileDescriptorProto + * @property {string|null} [name] FileDescriptorProto name + * @property {string|null} ["package"] FileDescriptorProto package + * @property {Array.|null} [dependency] FileDescriptorProto dependency + * @property {Array.|null} [publicDependency] FileDescriptorProto publicDependency + * @property {Array.|null} [weakDependency] FileDescriptorProto weakDependency + * @property {Array.|null} [messageType] FileDescriptorProto messageType + * @property {Array.|null} [enumType] FileDescriptorProto enumType + * @property {Array.|null} [service] FileDescriptorProto service + * @property {Array.|null} [extension] FileDescriptorProto extension + * @property {google.protobuf.IFileOptions|null} [options] FileDescriptorProto options + * @property {google.protobuf.ISourceCodeInfo|null} [sourceCodeInfo] FileDescriptorProto sourceCodeInfo + * @property {string|null} [syntax] FileDescriptorProto syntax + * @property {string|null} [edition] FileDescriptorProto edition + */ + + /** + * Constructs a new FileDescriptorProto. + * @memberof google.protobuf + * @classdesc Represents a FileDescriptorProto. + * @implements IFileDescriptorProto + * @constructor + * @param {google.protobuf.IFileDescriptorProto=} [properties] Properties to set + */ + function FileDescriptorProto(properties) { + this.dependency = []; + this.publicDependency = []; + this.weakDependency = []; + this.messageType = []; + this.enumType = []; + this.service = []; + this.extension = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * FileDescriptorProto name. + * @member {string} name + * @memberof google.protobuf.FileDescriptorProto + * @instance + */ + FileDescriptorProto.prototype.name = ""; + + /** + * FileDescriptorProto package. + * @member {string} package + * @memberof google.protobuf.FileDescriptorProto + * @instance + */ + FileDescriptorProto.prototype["package"] = ""; + + /** + * FileDescriptorProto dependency. + * @member {Array.} dependency + * @memberof google.protobuf.FileDescriptorProto + * @instance + */ + FileDescriptorProto.prototype.dependency = $util.emptyArray; + + /** + * FileDescriptorProto publicDependency. + * @member {Array.} publicDependency + * @memberof google.protobuf.FileDescriptorProto + * @instance + */ + FileDescriptorProto.prototype.publicDependency = $util.emptyArray; + + /** + * FileDescriptorProto weakDependency. + * @member {Array.} weakDependency + * @memberof google.protobuf.FileDescriptorProto + * @instance + */ + FileDescriptorProto.prototype.weakDependency = $util.emptyArray; + + /** + * FileDescriptorProto messageType. + * @member {Array.} messageType + * @memberof google.protobuf.FileDescriptorProto + * @instance + */ + FileDescriptorProto.prototype.messageType = $util.emptyArray; + + /** + * FileDescriptorProto enumType. + * @member {Array.} enumType + * @memberof google.protobuf.FileDescriptorProto + * @instance + */ + FileDescriptorProto.prototype.enumType = $util.emptyArray; + + /** + * FileDescriptorProto service. + * @member {Array.} service + * @memberof google.protobuf.FileDescriptorProto + * @instance + */ + FileDescriptorProto.prototype.service = $util.emptyArray; + + /** + * FileDescriptorProto extension. + * @member {Array.} extension + * @memberof google.protobuf.FileDescriptorProto + * @instance + */ + FileDescriptorProto.prototype.extension = $util.emptyArray; + + /** + * FileDescriptorProto options. + * @member {google.protobuf.IFileOptions|null|undefined} options + * @memberof google.protobuf.FileDescriptorProto + * @instance + */ + FileDescriptorProto.prototype.options = null; + + /** + * FileDescriptorProto sourceCodeInfo. + * @member {google.protobuf.ISourceCodeInfo|null|undefined} sourceCodeInfo + * @memberof google.protobuf.FileDescriptorProto + * @instance + */ + FileDescriptorProto.prototype.sourceCodeInfo = null; + + /** + * FileDescriptorProto syntax. + * @member {string} syntax + * @memberof google.protobuf.FileDescriptorProto + * @instance + */ + FileDescriptorProto.prototype.syntax = ""; + + /** + * FileDescriptorProto edition. + * @member {string} edition + * @memberof google.protobuf.FileDescriptorProto + * @instance + */ + FileDescriptorProto.prototype.edition = ""; + + /** + * Creates a new FileDescriptorProto instance using the specified properties. + * @function create + * @memberof google.protobuf.FileDescriptorProto + * @static + * @param {google.protobuf.IFileDescriptorProto=} [properties] Properties to set + * @returns {google.protobuf.FileDescriptorProto} FileDescriptorProto instance + */ + FileDescriptorProto.create = function create(properties) { + return new FileDescriptorProto(properties); + }; + + /** + * Encodes the specified FileDescriptorProto message. Does not implicitly {@link google.protobuf.FileDescriptorProto.verify|verify} messages. + * @function encode + * @memberof google.protobuf.FileDescriptorProto + * @static + * @param {google.protobuf.IFileDescriptorProto} message FileDescriptorProto message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FileDescriptorProto.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message["package"] != null && Object.hasOwnProperty.call(message, "package")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message["package"]); + if (message.dependency != null && message.dependency.length) + for (var i = 0; i < message.dependency.length; ++i) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.dependency[i]); + if (message.messageType != null && message.messageType.length) + for (var i = 0; i < message.messageType.length; ++i) + $root.google.protobuf.DescriptorProto.encode(message.messageType[i], writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.enumType != null && message.enumType.length) + for (var i = 0; i < message.enumType.length; ++i) + $root.google.protobuf.EnumDescriptorProto.encode(message.enumType[i], writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.service != null && message.service.length) + for (var i = 0; i < message.service.length; ++i) + $root.google.protobuf.ServiceDescriptorProto.encode(message.service[i], writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + if (message.extension != null && message.extension.length) + for (var i = 0; i < message.extension.length; ++i) + $root.google.protobuf.FieldDescriptorProto.encode(message.extension[i], writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); + if (message.options != null && Object.hasOwnProperty.call(message, "options")) + $root.google.protobuf.FileOptions.encode(message.options, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); + if (message.sourceCodeInfo != null && Object.hasOwnProperty.call(message, "sourceCodeInfo")) + $root.google.protobuf.SourceCodeInfo.encode(message.sourceCodeInfo, writer.uint32(/* id 9, wireType 2 =*/74).fork()).ldelim(); + if (message.publicDependency != null && message.publicDependency.length) + for (var i = 0; i < message.publicDependency.length; ++i) + writer.uint32(/* id 10, wireType 0 =*/80).int32(message.publicDependency[i]); + if (message.weakDependency != null && message.weakDependency.length) + for (var i = 0; i < message.weakDependency.length; ++i) + writer.uint32(/* id 11, wireType 0 =*/88).int32(message.weakDependency[i]); + if (message.syntax != null && Object.hasOwnProperty.call(message, "syntax")) + writer.uint32(/* id 12, wireType 2 =*/98).string(message.syntax); + if (message.edition != null && Object.hasOwnProperty.call(message, "edition")) + writer.uint32(/* id 13, wireType 2 =*/106).string(message.edition); + return writer; + }; + + /** + * Encodes the specified FileDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.FileDescriptorProto.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.FileDescriptorProto + * @static + * @param {google.protobuf.IFileDescriptorProto} message FileDescriptorProto message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FileDescriptorProto.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a FileDescriptorProto message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.FileDescriptorProto + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.FileDescriptorProto} FileDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FileDescriptorProto.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.FileDescriptorProto(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message["package"] = reader.string(); + break; + } + case 3: { + if (!(message.dependency && message.dependency.length)) + message.dependency = []; + message.dependency.push(reader.string()); + break; + } + case 10: { + if (!(message.publicDependency && message.publicDependency.length)) + message.publicDependency = []; + if ((tag & 7) === 2) { + var end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) + message.publicDependency.push(reader.int32()); + } else + message.publicDependency.push(reader.int32()); + break; + } + case 11: { + if (!(message.weakDependency && message.weakDependency.length)) + message.weakDependency = []; + if ((tag & 7) === 2) { + var end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) + message.weakDependency.push(reader.int32()); + } else + message.weakDependency.push(reader.int32()); + break; + } + case 4: { + if (!(message.messageType && message.messageType.length)) + message.messageType = []; + message.messageType.push($root.google.protobuf.DescriptorProto.decode(reader, reader.uint32())); + break; + } + case 5: { + if (!(message.enumType && message.enumType.length)) + message.enumType = []; + message.enumType.push($root.google.protobuf.EnumDescriptorProto.decode(reader, reader.uint32())); + break; + } + case 6: { + if (!(message.service && message.service.length)) + message.service = []; + message.service.push($root.google.protobuf.ServiceDescriptorProto.decode(reader, reader.uint32())); + break; + } + case 7: { + if (!(message.extension && message.extension.length)) + message.extension = []; + message.extension.push($root.google.protobuf.FieldDescriptorProto.decode(reader, reader.uint32())); + break; + } + case 8: { + message.options = $root.google.protobuf.FileOptions.decode(reader, reader.uint32()); + break; + } + case 9: { + message.sourceCodeInfo = $root.google.protobuf.SourceCodeInfo.decode(reader, reader.uint32()); + break; + } + case 12: { + message.syntax = reader.string(); + break; + } + case 13: { + message.edition = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a FileDescriptorProto message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.FileDescriptorProto + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.FileDescriptorProto} FileDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FileDescriptorProto.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a FileDescriptorProto message. + * @function verify + * @memberof google.protobuf.FileDescriptorProto + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + FileDescriptorProto.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message["package"] != null && message.hasOwnProperty("package")) + if (!$util.isString(message["package"])) + return "package: string expected"; + if (message.dependency != null && message.hasOwnProperty("dependency")) { + if (!Array.isArray(message.dependency)) + return "dependency: array expected"; + for (var i = 0; i < message.dependency.length; ++i) + if (!$util.isString(message.dependency[i])) + return "dependency: string[] expected"; + } + if (message.publicDependency != null && message.hasOwnProperty("publicDependency")) { + if (!Array.isArray(message.publicDependency)) + return "publicDependency: array expected"; + for (var i = 0; i < message.publicDependency.length; ++i) + if (!$util.isInteger(message.publicDependency[i])) + return "publicDependency: integer[] expected"; + } + if (message.weakDependency != null && message.hasOwnProperty("weakDependency")) { + if (!Array.isArray(message.weakDependency)) + return "weakDependency: array expected"; + for (var i = 0; i < message.weakDependency.length; ++i) + if (!$util.isInteger(message.weakDependency[i])) + return "weakDependency: integer[] expected"; + } + if (message.messageType != null && message.hasOwnProperty("messageType")) { + if (!Array.isArray(message.messageType)) + return "messageType: array expected"; + for (var i = 0; i < message.messageType.length; ++i) { + var error = $root.google.protobuf.DescriptorProto.verify(message.messageType[i]); + if (error) + return "messageType." + error; + } + } + if (message.enumType != null && message.hasOwnProperty("enumType")) { + if (!Array.isArray(message.enumType)) + return "enumType: array expected"; + for (var i = 0; i < message.enumType.length; ++i) { + var error = $root.google.protobuf.EnumDescriptorProto.verify(message.enumType[i]); + if (error) + return "enumType." + error; + } + } + if (message.service != null && message.hasOwnProperty("service")) { + if (!Array.isArray(message.service)) + return "service: array expected"; + for (var i = 0; i < message.service.length; ++i) { + var error = $root.google.protobuf.ServiceDescriptorProto.verify(message.service[i]); + if (error) + return "service." + error; + } + } + if (message.extension != null && message.hasOwnProperty("extension")) { + if (!Array.isArray(message.extension)) + return "extension: array expected"; + for (var i = 0; i < message.extension.length; ++i) { + var error = $root.google.protobuf.FieldDescriptorProto.verify(message.extension[i]); + if (error) + return "extension." + error; + } + } + if (message.options != null && message.hasOwnProperty("options")) { + var error = $root.google.protobuf.FileOptions.verify(message.options); + if (error) + return "options." + error; + } + if (message.sourceCodeInfo != null && message.hasOwnProperty("sourceCodeInfo")) { + var error = $root.google.protobuf.SourceCodeInfo.verify(message.sourceCodeInfo); + if (error) + return "sourceCodeInfo." + error; + } + if (message.syntax != null && message.hasOwnProperty("syntax")) + if (!$util.isString(message.syntax)) + return "syntax: string expected"; + if (message.edition != null && message.hasOwnProperty("edition")) + if (!$util.isString(message.edition)) + return "edition: string expected"; + return null; + }; + + /** + * Creates a FileDescriptorProto message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.FileDescriptorProto + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.FileDescriptorProto} FileDescriptorProto + */ + FileDescriptorProto.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.FileDescriptorProto) + return object; + var message = new $root.google.protobuf.FileDescriptorProto(); + if (object.name != null) + message.name = String(object.name); + if (object["package"] != null) + message["package"] = String(object["package"]); + if (object.dependency) { + if (!Array.isArray(object.dependency)) + throw TypeError(".google.protobuf.FileDescriptorProto.dependency: array expected"); + message.dependency = []; + for (var i = 0; i < object.dependency.length; ++i) + message.dependency[i] = String(object.dependency[i]); + } + if (object.publicDependency) { + if (!Array.isArray(object.publicDependency)) + throw TypeError(".google.protobuf.FileDescriptorProto.publicDependency: array expected"); + message.publicDependency = []; + for (var i = 0; i < object.publicDependency.length; ++i) + message.publicDependency[i] = object.publicDependency[i] | 0; + } + if (object.weakDependency) { + if (!Array.isArray(object.weakDependency)) + throw TypeError(".google.protobuf.FileDescriptorProto.weakDependency: array expected"); + message.weakDependency = []; + for (var i = 0; i < object.weakDependency.length; ++i) + message.weakDependency[i] = object.weakDependency[i] | 0; + } + if (object.messageType) { + if (!Array.isArray(object.messageType)) + throw TypeError(".google.protobuf.FileDescriptorProto.messageType: array expected"); + message.messageType = []; + for (var i = 0; i < object.messageType.length; ++i) { + if (typeof object.messageType[i] !== "object") + throw TypeError(".google.protobuf.FileDescriptorProto.messageType: object expected"); + message.messageType[i] = $root.google.protobuf.DescriptorProto.fromObject(object.messageType[i]); + } + } + if (object.enumType) { + if (!Array.isArray(object.enumType)) + throw TypeError(".google.protobuf.FileDescriptorProto.enumType: array expected"); + message.enumType = []; + for (var i = 0; i < object.enumType.length; ++i) { + if (typeof object.enumType[i] !== "object") + throw TypeError(".google.protobuf.FileDescriptorProto.enumType: object expected"); + message.enumType[i] = $root.google.protobuf.EnumDescriptorProto.fromObject(object.enumType[i]); + } + } + if (object.service) { + if (!Array.isArray(object.service)) + throw TypeError(".google.protobuf.FileDescriptorProto.service: array expected"); + message.service = []; + for (var i = 0; i < object.service.length; ++i) { + if (typeof object.service[i] !== "object") + throw TypeError(".google.protobuf.FileDescriptorProto.service: object expected"); + message.service[i] = $root.google.protobuf.ServiceDescriptorProto.fromObject(object.service[i]); + } + } + if (object.extension) { + if (!Array.isArray(object.extension)) + throw TypeError(".google.protobuf.FileDescriptorProto.extension: array expected"); + message.extension = []; + for (var i = 0; i < object.extension.length; ++i) { + if (typeof object.extension[i] !== "object") + throw TypeError(".google.protobuf.FileDescriptorProto.extension: object expected"); + message.extension[i] = $root.google.protobuf.FieldDescriptorProto.fromObject(object.extension[i]); + } + } + if (object.options != null) { + if (typeof object.options !== "object") + throw TypeError(".google.protobuf.FileDescriptorProto.options: object expected"); + message.options = $root.google.protobuf.FileOptions.fromObject(object.options); + } + if (object.sourceCodeInfo != null) { + if (typeof object.sourceCodeInfo !== "object") + throw TypeError(".google.protobuf.FileDescriptorProto.sourceCodeInfo: object expected"); + message.sourceCodeInfo = $root.google.protobuf.SourceCodeInfo.fromObject(object.sourceCodeInfo); + } + if (object.syntax != null) + message.syntax = String(object.syntax); + if (object.edition != null) + message.edition = String(object.edition); + return message; + }; + + /** + * Creates a plain object from a FileDescriptorProto message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.FileDescriptorProto + * @static + * @param {google.protobuf.FileDescriptorProto} message FileDescriptorProto + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + FileDescriptorProto.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.dependency = []; + object.messageType = []; + object.enumType = []; + object.service = []; + object.extension = []; + object.publicDependency = []; + object.weakDependency = []; + } + if (options.defaults) { + object.name = ""; + object["package"] = ""; + object.options = null; + object.sourceCodeInfo = null; + object.syntax = ""; + object.edition = ""; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message["package"] != null && message.hasOwnProperty("package")) + object["package"] = message["package"]; + if (message.dependency && message.dependency.length) { + object.dependency = []; + for (var j = 0; j < message.dependency.length; ++j) + object.dependency[j] = message.dependency[j]; + } + if (message.messageType && message.messageType.length) { + object.messageType = []; + for (var j = 0; j < message.messageType.length; ++j) + object.messageType[j] = $root.google.protobuf.DescriptorProto.toObject(message.messageType[j], options); + } + if (message.enumType && message.enumType.length) { + object.enumType = []; + for (var j = 0; j < message.enumType.length; ++j) + object.enumType[j] = $root.google.protobuf.EnumDescriptorProto.toObject(message.enumType[j], options); + } + if (message.service && message.service.length) { + object.service = []; + for (var j = 0; j < message.service.length; ++j) + object.service[j] = $root.google.protobuf.ServiceDescriptorProto.toObject(message.service[j], options); + } + if (message.extension && message.extension.length) { + object.extension = []; + for (var j = 0; j < message.extension.length; ++j) + object.extension[j] = $root.google.protobuf.FieldDescriptorProto.toObject(message.extension[j], options); + } + if (message.options != null && message.hasOwnProperty("options")) + object.options = $root.google.protobuf.FileOptions.toObject(message.options, options); + if (message.sourceCodeInfo != null && message.hasOwnProperty("sourceCodeInfo")) + object.sourceCodeInfo = $root.google.protobuf.SourceCodeInfo.toObject(message.sourceCodeInfo, options); + if (message.publicDependency && message.publicDependency.length) { + object.publicDependency = []; + for (var j = 0; j < message.publicDependency.length; ++j) + object.publicDependency[j] = message.publicDependency[j]; + } + if (message.weakDependency && message.weakDependency.length) { + object.weakDependency = []; + for (var j = 0; j < message.weakDependency.length; ++j) + object.weakDependency[j] = message.weakDependency[j]; + } + if (message.syntax != null && message.hasOwnProperty("syntax")) + object.syntax = message.syntax; + if (message.edition != null && message.hasOwnProperty("edition")) + object.edition = message.edition; + return object; + }; + + /** + * Converts this FileDescriptorProto to JSON. + * @function toJSON + * @memberof google.protobuf.FileDescriptorProto + * @instance + * @returns {Object.} JSON object + */ + FileDescriptorProto.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for FileDescriptorProto + * @function getTypeUrl + * @memberof google.protobuf.FileDescriptorProto + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FileDescriptorProto.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.FileDescriptorProto"; + }; + + return FileDescriptorProto; + })(); + + protobuf.DescriptorProto = (function() { + + /** + * Properties of a DescriptorProto. + * @memberof google.protobuf + * @interface IDescriptorProto + * @property {string|null} [name] DescriptorProto name + * @property {Array.|null} [field] DescriptorProto field + * @property {Array.|null} [extension] DescriptorProto extension + * @property {Array.|null} [nestedType] DescriptorProto nestedType + * @property {Array.|null} [enumType] DescriptorProto enumType + * @property {Array.|null} [extensionRange] DescriptorProto extensionRange + * @property {Array.|null} [oneofDecl] DescriptorProto oneofDecl + * @property {google.protobuf.IMessageOptions|null} [options] DescriptorProto options + * @property {Array.|null} [reservedRange] DescriptorProto reservedRange + * @property {Array.|null} [reservedName] DescriptorProto reservedName + */ + + /** + * Constructs a new DescriptorProto. + * @memberof google.protobuf + * @classdesc Represents a DescriptorProto. + * @implements IDescriptorProto + * @constructor + * @param {google.protobuf.IDescriptorProto=} [properties] Properties to set + */ + function DescriptorProto(properties) { + this.field = []; + this.extension = []; + this.nestedType = []; + this.enumType = []; + this.extensionRange = []; + this.oneofDecl = []; + this.reservedRange = []; + this.reservedName = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * DescriptorProto name. + * @member {string} name + * @memberof google.protobuf.DescriptorProto + * @instance + */ + DescriptorProto.prototype.name = ""; + + /** + * DescriptorProto field. + * @member {Array.} field + * @memberof google.protobuf.DescriptorProto + * @instance + */ + DescriptorProto.prototype.field = $util.emptyArray; + + /** + * DescriptorProto extension. + * @member {Array.} extension + * @memberof google.protobuf.DescriptorProto + * @instance + */ + DescriptorProto.prototype.extension = $util.emptyArray; + + /** + * DescriptorProto nestedType. + * @member {Array.} nestedType + * @memberof google.protobuf.DescriptorProto + * @instance + */ + DescriptorProto.prototype.nestedType = $util.emptyArray; + + /** + * DescriptorProto enumType. + * @member {Array.} enumType + * @memberof google.protobuf.DescriptorProto + * @instance + */ + DescriptorProto.prototype.enumType = $util.emptyArray; + + /** + * DescriptorProto extensionRange. + * @member {Array.} extensionRange + * @memberof google.protobuf.DescriptorProto + * @instance + */ + DescriptorProto.prototype.extensionRange = $util.emptyArray; + + /** + * DescriptorProto oneofDecl. + * @member {Array.} oneofDecl + * @memberof google.protobuf.DescriptorProto + * @instance + */ + DescriptorProto.prototype.oneofDecl = $util.emptyArray; + + /** + * DescriptorProto options. + * @member {google.protobuf.IMessageOptions|null|undefined} options + * @memberof google.protobuf.DescriptorProto + * @instance + */ + DescriptorProto.prototype.options = null; + + /** + * DescriptorProto reservedRange. + * @member {Array.} reservedRange + * @memberof google.protobuf.DescriptorProto + * @instance + */ + DescriptorProto.prototype.reservedRange = $util.emptyArray; + + /** + * DescriptorProto reservedName. + * @member {Array.} reservedName + * @memberof google.protobuf.DescriptorProto + * @instance + */ + DescriptorProto.prototype.reservedName = $util.emptyArray; + + /** + * Creates a new DescriptorProto instance using the specified properties. + * @function create + * @memberof google.protobuf.DescriptorProto + * @static + * @param {google.protobuf.IDescriptorProto=} [properties] Properties to set + * @returns {google.protobuf.DescriptorProto} DescriptorProto instance + */ + DescriptorProto.create = function create(properties) { + return new DescriptorProto(properties); + }; + + /** + * Encodes the specified DescriptorProto message. Does not implicitly {@link google.protobuf.DescriptorProto.verify|verify} messages. + * @function encode + * @memberof google.protobuf.DescriptorProto + * @static + * @param {google.protobuf.IDescriptorProto} message DescriptorProto message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DescriptorProto.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.field != null && message.field.length) + for (var i = 0; i < message.field.length; ++i) + $root.google.protobuf.FieldDescriptorProto.encode(message.field[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.nestedType != null && message.nestedType.length) + for (var i = 0; i < message.nestedType.length; ++i) + $root.google.protobuf.DescriptorProto.encode(message.nestedType[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.enumType != null && message.enumType.length) + for (var i = 0; i < message.enumType.length; ++i) + $root.google.protobuf.EnumDescriptorProto.encode(message.enumType[i], writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.extensionRange != null && message.extensionRange.length) + for (var i = 0; i < message.extensionRange.length; ++i) + $root.google.protobuf.DescriptorProto.ExtensionRange.encode(message.extensionRange[i], writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.extension != null && message.extension.length) + for (var i = 0; i < message.extension.length; ++i) + $root.google.protobuf.FieldDescriptorProto.encode(message.extension[i], writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + if (message.options != null && Object.hasOwnProperty.call(message, "options")) + $root.google.protobuf.MessageOptions.encode(message.options, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); + if (message.oneofDecl != null && message.oneofDecl.length) + for (var i = 0; i < message.oneofDecl.length; ++i) + $root.google.protobuf.OneofDescriptorProto.encode(message.oneofDecl[i], writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); + if (message.reservedRange != null && message.reservedRange.length) + for (var i = 0; i < message.reservedRange.length; ++i) + $root.google.protobuf.DescriptorProto.ReservedRange.encode(message.reservedRange[i], writer.uint32(/* id 9, wireType 2 =*/74).fork()).ldelim(); + if (message.reservedName != null && message.reservedName.length) + for (var i = 0; i < message.reservedName.length; ++i) + writer.uint32(/* id 10, wireType 2 =*/82).string(message.reservedName[i]); + return writer; + }; + + /** + * Encodes the specified DescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.DescriptorProto.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.DescriptorProto + * @static + * @param {google.protobuf.IDescriptorProto} message DescriptorProto message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DescriptorProto.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DescriptorProto message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.DescriptorProto + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.DescriptorProto} DescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DescriptorProto.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.DescriptorProto(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + if (!(message.field && message.field.length)) + message.field = []; + message.field.push($root.google.protobuf.FieldDescriptorProto.decode(reader, reader.uint32())); + break; + } + case 6: { + if (!(message.extension && message.extension.length)) + message.extension = []; + message.extension.push($root.google.protobuf.FieldDescriptorProto.decode(reader, reader.uint32())); + break; + } + case 3: { + if (!(message.nestedType && message.nestedType.length)) + message.nestedType = []; + message.nestedType.push($root.google.protobuf.DescriptorProto.decode(reader, reader.uint32())); + break; + } + case 4: { + if (!(message.enumType && message.enumType.length)) + message.enumType = []; + message.enumType.push($root.google.protobuf.EnumDescriptorProto.decode(reader, reader.uint32())); + break; + } + case 5: { + if (!(message.extensionRange && message.extensionRange.length)) + message.extensionRange = []; + message.extensionRange.push($root.google.protobuf.DescriptorProto.ExtensionRange.decode(reader, reader.uint32())); + break; + } + case 8: { + if (!(message.oneofDecl && message.oneofDecl.length)) + message.oneofDecl = []; + message.oneofDecl.push($root.google.protobuf.OneofDescriptorProto.decode(reader, reader.uint32())); + break; + } + case 7: { + message.options = $root.google.protobuf.MessageOptions.decode(reader, reader.uint32()); + break; + } + case 9: { + if (!(message.reservedRange && message.reservedRange.length)) + message.reservedRange = []; + message.reservedRange.push($root.google.protobuf.DescriptorProto.ReservedRange.decode(reader, reader.uint32())); + break; + } + case 10: { + if (!(message.reservedName && message.reservedName.length)) + message.reservedName = []; + message.reservedName.push(reader.string()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DescriptorProto message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.DescriptorProto + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.DescriptorProto} DescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DescriptorProto.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DescriptorProto message. + * @function verify + * @memberof google.protobuf.DescriptorProto + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DescriptorProto.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.field != null && message.hasOwnProperty("field")) { + if (!Array.isArray(message.field)) + return "field: array expected"; + for (var i = 0; i < message.field.length; ++i) { + var error = $root.google.protobuf.FieldDescriptorProto.verify(message.field[i]); + if (error) + return "field." + error; + } + } + if (message.extension != null && message.hasOwnProperty("extension")) { + if (!Array.isArray(message.extension)) + return "extension: array expected"; + for (var i = 0; i < message.extension.length; ++i) { + var error = $root.google.protobuf.FieldDescriptorProto.verify(message.extension[i]); + if (error) + return "extension." + error; + } + } + if (message.nestedType != null && message.hasOwnProperty("nestedType")) { + if (!Array.isArray(message.nestedType)) + return "nestedType: array expected"; + for (var i = 0; i < message.nestedType.length; ++i) { + var error = $root.google.protobuf.DescriptorProto.verify(message.nestedType[i]); + if (error) + return "nestedType." + error; + } + } + if (message.enumType != null && message.hasOwnProperty("enumType")) { + if (!Array.isArray(message.enumType)) + return "enumType: array expected"; + for (var i = 0; i < message.enumType.length; ++i) { + var error = $root.google.protobuf.EnumDescriptorProto.verify(message.enumType[i]); + if (error) + return "enumType." + error; + } + } + if (message.extensionRange != null && message.hasOwnProperty("extensionRange")) { + if (!Array.isArray(message.extensionRange)) + return "extensionRange: array expected"; + for (var i = 0; i < message.extensionRange.length; ++i) { + var error = $root.google.protobuf.DescriptorProto.ExtensionRange.verify(message.extensionRange[i]); + if (error) + return "extensionRange." + error; + } + } + if (message.oneofDecl != null && message.hasOwnProperty("oneofDecl")) { + if (!Array.isArray(message.oneofDecl)) + return "oneofDecl: array expected"; + for (var i = 0; i < message.oneofDecl.length; ++i) { + var error = $root.google.protobuf.OneofDescriptorProto.verify(message.oneofDecl[i]); + if (error) + return "oneofDecl." + error; + } + } + if (message.options != null && message.hasOwnProperty("options")) { + var error = $root.google.protobuf.MessageOptions.verify(message.options); + if (error) + return "options." + error; + } + if (message.reservedRange != null && message.hasOwnProperty("reservedRange")) { + if (!Array.isArray(message.reservedRange)) + return "reservedRange: array expected"; + for (var i = 0; i < message.reservedRange.length; ++i) { + var error = $root.google.protobuf.DescriptorProto.ReservedRange.verify(message.reservedRange[i]); + if (error) + return "reservedRange." + error; + } + } + if (message.reservedName != null && message.hasOwnProperty("reservedName")) { + if (!Array.isArray(message.reservedName)) + return "reservedName: array expected"; + for (var i = 0; i < message.reservedName.length; ++i) + if (!$util.isString(message.reservedName[i])) + return "reservedName: string[] expected"; + } + return null; + }; + + /** + * Creates a DescriptorProto message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.DescriptorProto + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.DescriptorProto} DescriptorProto + */ + DescriptorProto.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.DescriptorProto) + return object; + var message = new $root.google.protobuf.DescriptorProto(); + if (object.name != null) + message.name = String(object.name); + if (object.field) { + if (!Array.isArray(object.field)) + throw TypeError(".google.protobuf.DescriptorProto.field: array expected"); + message.field = []; + for (var i = 0; i < object.field.length; ++i) { + if (typeof object.field[i] !== "object") + throw TypeError(".google.protobuf.DescriptorProto.field: object expected"); + message.field[i] = $root.google.protobuf.FieldDescriptorProto.fromObject(object.field[i]); + } + } + if (object.extension) { + if (!Array.isArray(object.extension)) + throw TypeError(".google.protobuf.DescriptorProto.extension: array expected"); + message.extension = []; + for (var i = 0; i < object.extension.length; ++i) { + if (typeof object.extension[i] !== "object") + throw TypeError(".google.protobuf.DescriptorProto.extension: object expected"); + message.extension[i] = $root.google.protobuf.FieldDescriptorProto.fromObject(object.extension[i]); + } + } + if (object.nestedType) { + if (!Array.isArray(object.nestedType)) + throw TypeError(".google.protobuf.DescriptorProto.nestedType: array expected"); + message.nestedType = []; + for (var i = 0; i < object.nestedType.length; ++i) { + if (typeof object.nestedType[i] !== "object") + throw TypeError(".google.protobuf.DescriptorProto.nestedType: object expected"); + message.nestedType[i] = $root.google.protobuf.DescriptorProto.fromObject(object.nestedType[i]); + } + } + if (object.enumType) { + if (!Array.isArray(object.enumType)) + throw TypeError(".google.protobuf.DescriptorProto.enumType: array expected"); + message.enumType = []; + for (var i = 0; i < object.enumType.length; ++i) { + if (typeof object.enumType[i] !== "object") + throw TypeError(".google.protobuf.DescriptorProto.enumType: object expected"); + message.enumType[i] = $root.google.protobuf.EnumDescriptorProto.fromObject(object.enumType[i]); + } + } + if (object.extensionRange) { + if (!Array.isArray(object.extensionRange)) + throw TypeError(".google.protobuf.DescriptorProto.extensionRange: array expected"); + message.extensionRange = []; + for (var i = 0; i < object.extensionRange.length; ++i) { + if (typeof object.extensionRange[i] !== "object") + throw TypeError(".google.protobuf.DescriptorProto.extensionRange: object expected"); + message.extensionRange[i] = $root.google.protobuf.DescriptorProto.ExtensionRange.fromObject(object.extensionRange[i]); + } + } + if (object.oneofDecl) { + if (!Array.isArray(object.oneofDecl)) + throw TypeError(".google.protobuf.DescriptorProto.oneofDecl: array expected"); + message.oneofDecl = []; + for (var i = 0; i < object.oneofDecl.length; ++i) { + if (typeof object.oneofDecl[i] !== "object") + throw TypeError(".google.protobuf.DescriptorProto.oneofDecl: object expected"); + message.oneofDecl[i] = $root.google.protobuf.OneofDescriptorProto.fromObject(object.oneofDecl[i]); + } + } + if (object.options != null) { + if (typeof object.options !== "object") + throw TypeError(".google.protobuf.DescriptorProto.options: object expected"); + message.options = $root.google.protobuf.MessageOptions.fromObject(object.options); + } + if (object.reservedRange) { + if (!Array.isArray(object.reservedRange)) + throw TypeError(".google.protobuf.DescriptorProto.reservedRange: array expected"); + message.reservedRange = []; + for (var i = 0; i < object.reservedRange.length; ++i) { + if (typeof object.reservedRange[i] !== "object") + throw TypeError(".google.protobuf.DescriptorProto.reservedRange: object expected"); + message.reservedRange[i] = $root.google.protobuf.DescriptorProto.ReservedRange.fromObject(object.reservedRange[i]); + } + } + if (object.reservedName) { + if (!Array.isArray(object.reservedName)) + throw TypeError(".google.protobuf.DescriptorProto.reservedName: array expected"); + message.reservedName = []; + for (var i = 0; i < object.reservedName.length; ++i) + message.reservedName[i] = String(object.reservedName[i]); + } + return message; + }; + + /** + * Creates a plain object from a DescriptorProto message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.DescriptorProto + * @static + * @param {google.protobuf.DescriptorProto} message DescriptorProto + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DescriptorProto.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.field = []; + object.nestedType = []; + object.enumType = []; + object.extensionRange = []; + object.extension = []; + object.oneofDecl = []; + object.reservedRange = []; + object.reservedName = []; + } + if (options.defaults) { + object.name = ""; + object.options = null; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.field && message.field.length) { + object.field = []; + for (var j = 0; j < message.field.length; ++j) + object.field[j] = $root.google.protobuf.FieldDescriptorProto.toObject(message.field[j], options); + } + if (message.nestedType && message.nestedType.length) { + object.nestedType = []; + for (var j = 0; j < message.nestedType.length; ++j) + object.nestedType[j] = $root.google.protobuf.DescriptorProto.toObject(message.nestedType[j], options); + } + if (message.enumType && message.enumType.length) { + object.enumType = []; + for (var j = 0; j < message.enumType.length; ++j) + object.enumType[j] = $root.google.protobuf.EnumDescriptorProto.toObject(message.enumType[j], options); + } + if (message.extensionRange && message.extensionRange.length) { + object.extensionRange = []; + for (var j = 0; j < message.extensionRange.length; ++j) + object.extensionRange[j] = $root.google.protobuf.DescriptorProto.ExtensionRange.toObject(message.extensionRange[j], options); + } + if (message.extension && message.extension.length) { + object.extension = []; + for (var j = 0; j < message.extension.length; ++j) + object.extension[j] = $root.google.protobuf.FieldDescriptorProto.toObject(message.extension[j], options); + } + if (message.options != null && message.hasOwnProperty("options")) + object.options = $root.google.protobuf.MessageOptions.toObject(message.options, options); + if (message.oneofDecl && message.oneofDecl.length) { + object.oneofDecl = []; + for (var j = 0; j < message.oneofDecl.length; ++j) + object.oneofDecl[j] = $root.google.protobuf.OneofDescriptorProto.toObject(message.oneofDecl[j], options); + } + if (message.reservedRange && message.reservedRange.length) { + object.reservedRange = []; + for (var j = 0; j < message.reservedRange.length; ++j) + object.reservedRange[j] = $root.google.protobuf.DescriptorProto.ReservedRange.toObject(message.reservedRange[j], options); + } + if (message.reservedName && message.reservedName.length) { + object.reservedName = []; + for (var j = 0; j < message.reservedName.length; ++j) + object.reservedName[j] = message.reservedName[j]; + } + return object; + }; + + /** + * Converts this DescriptorProto to JSON. + * @function toJSON + * @memberof google.protobuf.DescriptorProto + * @instance + * @returns {Object.} JSON object + */ + DescriptorProto.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DescriptorProto + * @function getTypeUrl + * @memberof google.protobuf.DescriptorProto + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DescriptorProto.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.DescriptorProto"; + }; + + DescriptorProto.ExtensionRange = (function() { + + /** + * Properties of an ExtensionRange. + * @memberof google.protobuf.DescriptorProto + * @interface IExtensionRange + * @property {number|null} [start] ExtensionRange start + * @property {number|null} [end] ExtensionRange end + * @property {google.protobuf.IExtensionRangeOptions|null} [options] ExtensionRange options + */ + + /** + * Constructs a new ExtensionRange. + * @memberof google.protobuf.DescriptorProto + * @classdesc Represents an ExtensionRange. + * @implements IExtensionRange + * @constructor + * @param {google.protobuf.DescriptorProto.IExtensionRange=} [properties] Properties to set + */ + function ExtensionRange(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ExtensionRange start. + * @member {number} start + * @memberof google.protobuf.DescriptorProto.ExtensionRange + * @instance + */ + ExtensionRange.prototype.start = 0; + + /** + * ExtensionRange end. + * @member {number} end + * @memberof google.protobuf.DescriptorProto.ExtensionRange + * @instance + */ + ExtensionRange.prototype.end = 0; + + /** + * ExtensionRange options. + * @member {google.protobuf.IExtensionRangeOptions|null|undefined} options + * @memberof google.protobuf.DescriptorProto.ExtensionRange + * @instance + */ + ExtensionRange.prototype.options = null; + + /** + * Creates a new ExtensionRange instance using the specified properties. + * @function create + * @memberof google.protobuf.DescriptorProto.ExtensionRange + * @static + * @param {google.protobuf.DescriptorProto.IExtensionRange=} [properties] Properties to set + * @returns {google.protobuf.DescriptorProto.ExtensionRange} ExtensionRange instance + */ + ExtensionRange.create = function create(properties) { + return new ExtensionRange(properties); + }; + + /** + * Encodes the specified ExtensionRange message. Does not implicitly {@link google.protobuf.DescriptorProto.ExtensionRange.verify|verify} messages. + * @function encode + * @memberof google.protobuf.DescriptorProto.ExtensionRange + * @static + * @param {google.protobuf.DescriptorProto.IExtensionRange} message ExtensionRange message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ExtensionRange.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.start != null && Object.hasOwnProperty.call(message, "start")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.start); + if (message.end != null && Object.hasOwnProperty.call(message, "end")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.end); + if (message.options != null && Object.hasOwnProperty.call(message, "options")) + $root.google.protobuf.ExtensionRangeOptions.encode(message.options, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified ExtensionRange message, length delimited. Does not implicitly {@link google.protobuf.DescriptorProto.ExtensionRange.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.DescriptorProto.ExtensionRange + * @static + * @param {google.protobuf.DescriptorProto.IExtensionRange} message ExtensionRange message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ExtensionRange.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an ExtensionRange message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.DescriptorProto.ExtensionRange + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.DescriptorProto.ExtensionRange} ExtensionRange + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ExtensionRange.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.DescriptorProto.ExtensionRange(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.start = reader.int32(); + break; + } + case 2: { + message.end = reader.int32(); + break; + } + case 3: { + message.options = $root.google.protobuf.ExtensionRangeOptions.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an ExtensionRange message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.DescriptorProto.ExtensionRange + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.DescriptorProto.ExtensionRange} ExtensionRange + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ExtensionRange.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an ExtensionRange message. + * @function verify + * @memberof google.protobuf.DescriptorProto.ExtensionRange + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ExtensionRange.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.start != null && message.hasOwnProperty("start")) + if (!$util.isInteger(message.start)) + return "start: integer expected"; + if (message.end != null && message.hasOwnProperty("end")) + if (!$util.isInteger(message.end)) + return "end: integer expected"; + if (message.options != null && message.hasOwnProperty("options")) { + var error = $root.google.protobuf.ExtensionRangeOptions.verify(message.options); + if (error) + return "options." + error; + } + return null; + }; + + /** + * Creates an ExtensionRange message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.DescriptorProto.ExtensionRange + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.DescriptorProto.ExtensionRange} ExtensionRange + */ + ExtensionRange.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.DescriptorProto.ExtensionRange) + return object; + var message = new $root.google.protobuf.DescriptorProto.ExtensionRange(); + if (object.start != null) + message.start = object.start | 0; + if (object.end != null) + message.end = object.end | 0; + if (object.options != null) { + if (typeof object.options !== "object") + throw TypeError(".google.protobuf.DescriptorProto.ExtensionRange.options: object expected"); + message.options = $root.google.protobuf.ExtensionRangeOptions.fromObject(object.options); + } + return message; + }; + + /** + * Creates a plain object from an ExtensionRange message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.DescriptorProto.ExtensionRange + * @static + * @param {google.protobuf.DescriptorProto.ExtensionRange} message ExtensionRange + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ExtensionRange.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.start = 0; + object.end = 0; + object.options = null; + } + if (message.start != null && message.hasOwnProperty("start")) + object.start = message.start; + if (message.end != null && message.hasOwnProperty("end")) + object.end = message.end; + if (message.options != null && message.hasOwnProperty("options")) + object.options = $root.google.protobuf.ExtensionRangeOptions.toObject(message.options, options); + return object; + }; + + /** + * Converts this ExtensionRange to JSON. + * @function toJSON + * @memberof google.protobuf.DescriptorProto.ExtensionRange + * @instance + * @returns {Object.} JSON object + */ + ExtensionRange.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ExtensionRange + * @function getTypeUrl + * @memberof google.protobuf.DescriptorProto.ExtensionRange + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ExtensionRange.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.DescriptorProto.ExtensionRange"; + }; + + return ExtensionRange; + })(); + + DescriptorProto.ReservedRange = (function() { + + /** + * Properties of a ReservedRange. + * @memberof google.protobuf.DescriptorProto + * @interface IReservedRange + * @property {number|null} [start] ReservedRange start + * @property {number|null} [end] ReservedRange end + */ + + /** + * Constructs a new ReservedRange. + * @memberof google.protobuf.DescriptorProto + * @classdesc Represents a ReservedRange. + * @implements IReservedRange + * @constructor + * @param {google.protobuf.DescriptorProto.IReservedRange=} [properties] Properties to set + */ + function ReservedRange(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ReservedRange start. + * @member {number} start + * @memberof google.protobuf.DescriptorProto.ReservedRange + * @instance + */ + ReservedRange.prototype.start = 0; + + /** + * ReservedRange end. + * @member {number} end + * @memberof google.protobuf.DescriptorProto.ReservedRange + * @instance + */ + ReservedRange.prototype.end = 0; + + /** + * Creates a new ReservedRange instance using the specified properties. + * @function create + * @memberof google.protobuf.DescriptorProto.ReservedRange + * @static + * @param {google.protobuf.DescriptorProto.IReservedRange=} [properties] Properties to set + * @returns {google.protobuf.DescriptorProto.ReservedRange} ReservedRange instance + */ + ReservedRange.create = function create(properties) { + return new ReservedRange(properties); + }; + + /** + * Encodes the specified ReservedRange message. Does not implicitly {@link google.protobuf.DescriptorProto.ReservedRange.verify|verify} messages. + * @function encode + * @memberof google.protobuf.DescriptorProto.ReservedRange + * @static + * @param {google.protobuf.DescriptorProto.IReservedRange} message ReservedRange message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ReservedRange.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.start != null && Object.hasOwnProperty.call(message, "start")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.start); + if (message.end != null && Object.hasOwnProperty.call(message, "end")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.end); + return writer; + }; + + /** + * Encodes the specified ReservedRange message, length delimited. Does not implicitly {@link google.protobuf.DescriptorProto.ReservedRange.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.DescriptorProto.ReservedRange + * @static + * @param {google.protobuf.DescriptorProto.IReservedRange} message ReservedRange message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ReservedRange.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ReservedRange message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.DescriptorProto.ReservedRange + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.DescriptorProto.ReservedRange} ReservedRange + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ReservedRange.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.DescriptorProto.ReservedRange(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.start = reader.int32(); + break; + } + case 2: { + message.end = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ReservedRange message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.DescriptorProto.ReservedRange + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.DescriptorProto.ReservedRange} ReservedRange + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ReservedRange.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ReservedRange message. + * @function verify + * @memberof google.protobuf.DescriptorProto.ReservedRange + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ReservedRange.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.start != null && message.hasOwnProperty("start")) + if (!$util.isInteger(message.start)) + return "start: integer expected"; + if (message.end != null && message.hasOwnProperty("end")) + if (!$util.isInteger(message.end)) + return "end: integer expected"; + return null; + }; + + /** + * Creates a ReservedRange message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.DescriptorProto.ReservedRange + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.DescriptorProto.ReservedRange} ReservedRange + */ + ReservedRange.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.DescriptorProto.ReservedRange) + return object; + var message = new $root.google.protobuf.DescriptorProto.ReservedRange(); + if (object.start != null) + message.start = object.start | 0; + if (object.end != null) + message.end = object.end | 0; + return message; + }; + + /** + * Creates a plain object from a ReservedRange message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.DescriptorProto.ReservedRange + * @static + * @param {google.protobuf.DescriptorProto.ReservedRange} message ReservedRange + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ReservedRange.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.start = 0; + object.end = 0; + } + if (message.start != null && message.hasOwnProperty("start")) + object.start = message.start; + if (message.end != null && message.hasOwnProperty("end")) + object.end = message.end; + return object; + }; + + /** + * Converts this ReservedRange to JSON. + * @function toJSON + * @memberof google.protobuf.DescriptorProto.ReservedRange + * @instance + * @returns {Object.} JSON object + */ + ReservedRange.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ReservedRange + * @function getTypeUrl + * @memberof google.protobuf.DescriptorProto.ReservedRange + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ReservedRange.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.DescriptorProto.ReservedRange"; + }; + + return ReservedRange; + })(); + + return DescriptorProto; + })(); + + protobuf.ExtensionRangeOptions = (function() { + + /** + * Properties of an ExtensionRangeOptions. + * @memberof google.protobuf + * @interface IExtensionRangeOptions + * @property {Array.|null} [uninterpretedOption] ExtensionRangeOptions uninterpretedOption + */ + + /** + * Constructs a new ExtensionRangeOptions. + * @memberof google.protobuf + * @classdesc Represents an ExtensionRangeOptions. + * @implements IExtensionRangeOptions + * @constructor + * @param {google.protobuf.IExtensionRangeOptions=} [properties] Properties to set + */ + function ExtensionRangeOptions(properties) { + this.uninterpretedOption = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ExtensionRangeOptions uninterpretedOption. + * @member {Array.} uninterpretedOption + * @memberof google.protobuf.ExtensionRangeOptions + * @instance + */ + ExtensionRangeOptions.prototype.uninterpretedOption = $util.emptyArray; + + /** + * Creates a new ExtensionRangeOptions instance using the specified properties. + * @function create + * @memberof google.protobuf.ExtensionRangeOptions + * @static + * @param {google.protobuf.IExtensionRangeOptions=} [properties] Properties to set + * @returns {google.protobuf.ExtensionRangeOptions} ExtensionRangeOptions instance + */ + ExtensionRangeOptions.create = function create(properties) { + return new ExtensionRangeOptions(properties); + }; + + /** + * Encodes the specified ExtensionRangeOptions message. Does not implicitly {@link google.protobuf.ExtensionRangeOptions.verify|verify} messages. + * @function encode + * @memberof google.protobuf.ExtensionRangeOptions + * @static + * @param {google.protobuf.IExtensionRangeOptions} message ExtensionRangeOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ExtensionRangeOptions.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.uninterpretedOption != null && message.uninterpretedOption.length) + for (var i = 0; i < message.uninterpretedOption.length; ++i) + $root.google.protobuf.UninterpretedOption.encode(message.uninterpretedOption[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified ExtensionRangeOptions message, length delimited. Does not implicitly {@link google.protobuf.ExtensionRangeOptions.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.ExtensionRangeOptions + * @static + * @param {google.protobuf.IExtensionRangeOptions} message ExtensionRangeOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ExtensionRangeOptions.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an ExtensionRangeOptions message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.ExtensionRangeOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.ExtensionRangeOptions} ExtensionRangeOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ExtensionRangeOptions.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.ExtensionRangeOptions(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 999: { + if (!(message.uninterpretedOption && message.uninterpretedOption.length)) + message.uninterpretedOption = []; + message.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an ExtensionRangeOptions message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.ExtensionRangeOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.ExtensionRangeOptions} ExtensionRangeOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ExtensionRangeOptions.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an ExtensionRangeOptions message. + * @function verify + * @memberof google.protobuf.ExtensionRangeOptions + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ExtensionRangeOptions.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.uninterpretedOption != null && message.hasOwnProperty("uninterpretedOption")) { + if (!Array.isArray(message.uninterpretedOption)) + return "uninterpretedOption: array expected"; + for (var i = 0; i < message.uninterpretedOption.length; ++i) { + var error = $root.google.protobuf.UninterpretedOption.verify(message.uninterpretedOption[i]); + if (error) + return "uninterpretedOption." + error; + } + } + return null; + }; + + /** + * Creates an ExtensionRangeOptions message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.ExtensionRangeOptions + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.ExtensionRangeOptions} ExtensionRangeOptions + */ + ExtensionRangeOptions.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.ExtensionRangeOptions) + return object; + var message = new $root.google.protobuf.ExtensionRangeOptions(); + if (object.uninterpretedOption) { + if (!Array.isArray(object.uninterpretedOption)) + throw TypeError(".google.protobuf.ExtensionRangeOptions.uninterpretedOption: array expected"); + message.uninterpretedOption = []; + for (var i = 0; i < object.uninterpretedOption.length; ++i) { + if (typeof object.uninterpretedOption[i] !== "object") + throw TypeError(".google.protobuf.ExtensionRangeOptions.uninterpretedOption: object expected"); + message.uninterpretedOption[i] = $root.google.protobuf.UninterpretedOption.fromObject(object.uninterpretedOption[i]); + } + } + return message; + }; + + /** + * Creates a plain object from an ExtensionRangeOptions message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.ExtensionRangeOptions + * @static + * @param {google.protobuf.ExtensionRangeOptions} message ExtensionRangeOptions + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ExtensionRangeOptions.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.uninterpretedOption = []; + if (message.uninterpretedOption && message.uninterpretedOption.length) { + object.uninterpretedOption = []; + for (var j = 0; j < message.uninterpretedOption.length; ++j) + object.uninterpretedOption[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpretedOption[j], options); + } + return object; + }; + + /** + * Converts this ExtensionRangeOptions to JSON. + * @function toJSON + * @memberof google.protobuf.ExtensionRangeOptions + * @instance + * @returns {Object.} JSON object + */ + ExtensionRangeOptions.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ExtensionRangeOptions + * @function getTypeUrl + * @memberof google.protobuf.ExtensionRangeOptions + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ExtensionRangeOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.ExtensionRangeOptions"; + }; + + return ExtensionRangeOptions; + })(); + + protobuf.FieldDescriptorProto = (function() { + + /** + * Properties of a FieldDescriptorProto. + * @memberof google.protobuf + * @interface IFieldDescriptorProto + * @property {string|null} [name] FieldDescriptorProto name + * @property {number|null} [number] FieldDescriptorProto number + * @property {google.protobuf.FieldDescriptorProto.Label|null} [label] FieldDescriptorProto label + * @property {google.protobuf.FieldDescriptorProto.Type|null} [type] FieldDescriptorProto type + * @property {string|null} [typeName] FieldDescriptorProto typeName + * @property {string|null} [extendee] FieldDescriptorProto extendee + * @property {string|null} [defaultValue] FieldDescriptorProto defaultValue + * @property {number|null} [oneofIndex] FieldDescriptorProto oneofIndex + * @property {string|null} [jsonName] FieldDescriptorProto jsonName + * @property {google.protobuf.IFieldOptions|null} [options] FieldDescriptorProto options + * @property {boolean|null} [proto3Optional] FieldDescriptorProto proto3Optional + */ + + /** + * Constructs a new FieldDescriptorProto. + * @memberof google.protobuf + * @classdesc Represents a FieldDescriptorProto. + * @implements IFieldDescriptorProto + * @constructor + * @param {google.protobuf.IFieldDescriptorProto=} [properties] Properties to set + */ + function FieldDescriptorProto(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * FieldDescriptorProto name. + * @member {string} name + * @memberof google.protobuf.FieldDescriptorProto + * @instance + */ + FieldDescriptorProto.prototype.name = ""; + + /** + * FieldDescriptorProto number. + * @member {number} number + * @memberof google.protobuf.FieldDescriptorProto + * @instance + */ + FieldDescriptorProto.prototype.number = 0; + + /** + * FieldDescriptorProto label. + * @member {google.protobuf.FieldDescriptorProto.Label} label + * @memberof google.protobuf.FieldDescriptorProto + * @instance + */ + FieldDescriptorProto.prototype.label = 1; + + /** + * FieldDescriptorProto type. + * @member {google.protobuf.FieldDescriptorProto.Type} type + * @memberof google.protobuf.FieldDescriptorProto + * @instance + */ + FieldDescriptorProto.prototype.type = 1; + + /** + * FieldDescriptorProto typeName. + * @member {string} typeName + * @memberof google.protobuf.FieldDescriptorProto + * @instance + */ + FieldDescriptorProto.prototype.typeName = ""; + + /** + * FieldDescriptorProto extendee. + * @member {string} extendee + * @memberof google.protobuf.FieldDescriptorProto + * @instance + */ + FieldDescriptorProto.prototype.extendee = ""; + + /** + * FieldDescriptorProto defaultValue. + * @member {string} defaultValue + * @memberof google.protobuf.FieldDescriptorProto + * @instance + */ + FieldDescriptorProto.prototype.defaultValue = ""; + + /** + * FieldDescriptorProto oneofIndex. + * @member {number} oneofIndex + * @memberof google.protobuf.FieldDescriptorProto + * @instance + */ + FieldDescriptorProto.prototype.oneofIndex = 0; + + /** + * FieldDescriptorProto jsonName. + * @member {string} jsonName + * @memberof google.protobuf.FieldDescriptorProto + * @instance + */ + FieldDescriptorProto.prototype.jsonName = ""; + + /** + * FieldDescriptorProto options. + * @member {google.protobuf.IFieldOptions|null|undefined} options + * @memberof google.protobuf.FieldDescriptorProto + * @instance + */ + FieldDescriptorProto.prototype.options = null; + + /** + * FieldDescriptorProto proto3Optional. + * @member {boolean} proto3Optional + * @memberof google.protobuf.FieldDescriptorProto + * @instance + */ + FieldDescriptorProto.prototype.proto3Optional = false; + + /** + * Creates a new FieldDescriptorProto instance using the specified properties. + * @function create + * @memberof google.protobuf.FieldDescriptorProto + * @static + * @param {google.protobuf.IFieldDescriptorProto=} [properties] Properties to set + * @returns {google.protobuf.FieldDescriptorProto} FieldDescriptorProto instance + */ + FieldDescriptorProto.create = function create(properties) { + return new FieldDescriptorProto(properties); + }; + + /** + * Encodes the specified FieldDescriptorProto message. Does not implicitly {@link google.protobuf.FieldDescriptorProto.verify|verify} messages. + * @function encode + * @memberof google.protobuf.FieldDescriptorProto + * @static + * @param {google.protobuf.IFieldDescriptorProto} message FieldDescriptorProto message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FieldDescriptorProto.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.extendee != null && Object.hasOwnProperty.call(message, "extendee")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.extendee); + if (message.number != null && Object.hasOwnProperty.call(message, "number")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.number); + if (message.label != null && Object.hasOwnProperty.call(message, "label")) + writer.uint32(/* id 4, wireType 0 =*/32).int32(message.label); + if (message.type != null && Object.hasOwnProperty.call(message, "type")) + writer.uint32(/* id 5, wireType 0 =*/40).int32(message.type); + if (message.typeName != null && Object.hasOwnProperty.call(message, "typeName")) + writer.uint32(/* id 6, wireType 2 =*/50).string(message.typeName); + if (message.defaultValue != null && Object.hasOwnProperty.call(message, "defaultValue")) + writer.uint32(/* id 7, wireType 2 =*/58).string(message.defaultValue); + if (message.options != null && Object.hasOwnProperty.call(message, "options")) + $root.google.protobuf.FieldOptions.encode(message.options, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); + if (message.oneofIndex != null && Object.hasOwnProperty.call(message, "oneofIndex")) + writer.uint32(/* id 9, wireType 0 =*/72).int32(message.oneofIndex); + if (message.jsonName != null && Object.hasOwnProperty.call(message, "jsonName")) + writer.uint32(/* id 10, wireType 2 =*/82).string(message.jsonName); + if (message.proto3Optional != null && Object.hasOwnProperty.call(message, "proto3Optional")) + writer.uint32(/* id 17, wireType 0 =*/136).bool(message.proto3Optional); + return writer; + }; + + /** + * Encodes the specified FieldDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.FieldDescriptorProto.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.FieldDescriptorProto + * @static + * @param {google.protobuf.IFieldDescriptorProto} message FieldDescriptorProto message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FieldDescriptorProto.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a FieldDescriptorProto message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.FieldDescriptorProto + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.FieldDescriptorProto} FieldDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FieldDescriptorProto.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.FieldDescriptorProto(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 3: { + message.number = reader.int32(); + break; + } + case 4: { + message.label = reader.int32(); + break; + } + case 5: { + message.type = reader.int32(); + break; + } + case 6: { + message.typeName = reader.string(); + break; + } + case 2: { + message.extendee = reader.string(); + break; + } + case 7: { + message.defaultValue = reader.string(); + break; + } + case 9: { + message.oneofIndex = reader.int32(); + break; + } + case 10: { + message.jsonName = reader.string(); + break; + } + case 8: { + message.options = $root.google.protobuf.FieldOptions.decode(reader, reader.uint32()); + break; + } + case 17: { + message.proto3Optional = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a FieldDescriptorProto message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.FieldDescriptorProto + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.FieldDescriptorProto} FieldDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FieldDescriptorProto.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a FieldDescriptorProto message. + * @function verify + * @memberof google.protobuf.FieldDescriptorProto + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + FieldDescriptorProto.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.number != null && message.hasOwnProperty("number")) + if (!$util.isInteger(message.number)) + return "number: integer expected"; + if (message.label != null && message.hasOwnProperty("label")) + switch (message.label) { + default: + return "label: enum value expected"; + case 1: + case 2: + case 3: + break; + } + if (message.type != null && message.hasOwnProperty("type")) + switch (message.type) { + default: + return "type: enum value expected"; + case 1: + case 2: + case 3: + case 4: + case 5: + case 6: + case 7: + case 8: + case 9: + case 10: + case 11: + case 12: + case 13: + case 14: + case 15: + case 16: + case 17: + case 18: + break; + } + if (message.typeName != null && message.hasOwnProperty("typeName")) + if (!$util.isString(message.typeName)) + return "typeName: string expected"; + if (message.extendee != null && message.hasOwnProperty("extendee")) + if (!$util.isString(message.extendee)) + return "extendee: string expected"; + if (message.defaultValue != null && message.hasOwnProperty("defaultValue")) + if (!$util.isString(message.defaultValue)) + return "defaultValue: string expected"; + if (message.oneofIndex != null && message.hasOwnProperty("oneofIndex")) + if (!$util.isInteger(message.oneofIndex)) + return "oneofIndex: integer expected"; + if (message.jsonName != null && message.hasOwnProperty("jsonName")) + if (!$util.isString(message.jsonName)) + return "jsonName: string expected"; + if (message.options != null && message.hasOwnProperty("options")) { + var error = $root.google.protobuf.FieldOptions.verify(message.options); + if (error) + return "options." + error; + } + if (message.proto3Optional != null && message.hasOwnProperty("proto3Optional")) + if (typeof message.proto3Optional !== "boolean") + return "proto3Optional: boolean expected"; + return null; + }; + + /** + * Creates a FieldDescriptorProto message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.FieldDescriptorProto + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.FieldDescriptorProto} FieldDescriptorProto + */ + FieldDescriptorProto.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.FieldDescriptorProto) + return object; + var message = new $root.google.protobuf.FieldDescriptorProto(); + if (object.name != null) + message.name = String(object.name); + if (object.number != null) + message.number = object.number | 0; + switch (object.label) { + default: + if (typeof object.label === "number") { + message.label = object.label; + break; + } + break; + case "LABEL_OPTIONAL": + case 1: + message.label = 1; + break; + case "LABEL_REQUIRED": + case 2: + message.label = 2; + break; + case "LABEL_REPEATED": + case 3: + message.label = 3; + break; + } + switch (object.type) { + default: + if (typeof object.type === "number") { + message.type = object.type; + break; + } + break; + case "TYPE_DOUBLE": + case 1: + message.type = 1; + break; + case "TYPE_FLOAT": + case 2: + message.type = 2; + break; + case "TYPE_INT64": + case 3: + message.type = 3; + break; + case "TYPE_UINT64": + case 4: + message.type = 4; + break; + case "TYPE_INT32": + case 5: + message.type = 5; + break; + case "TYPE_FIXED64": + case 6: + message.type = 6; + break; + case "TYPE_FIXED32": + case 7: + message.type = 7; + break; + case "TYPE_BOOL": + case 8: + message.type = 8; + break; + case "TYPE_STRING": + case 9: + message.type = 9; + break; + case "TYPE_GROUP": + case 10: + message.type = 10; + break; + case "TYPE_MESSAGE": + case 11: + message.type = 11; + break; + case "TYPE_BYTES": + case 12: + message.type = 12; + break; + case "TYPE_UINT32": + case 13: + message.type = 13; + break; + case "TYPE_ENUM": + case 14: + message.type = 14; + break; + case "TYPE_SFIXED32": + case 15: + message.type = 15; + break; + case "TYPE_SFIXED64": + case 16: + message.type = 16; + break; + case "TYPE_SINT32": + case 17: + message.type = 17; + break; + case "TYPE_SINT64": + case 18: + message.type = 18; + break; + } + if (object.typeName != null) + message.typeName = String(object.typeName); + if (object.extendee != null) + message.extendee = String(object.extendee); + if (object.defaultValue != null) + message.defaultValue = String(object.defaultValue); + if (object.oneofIndex != null) + message.oneofIndex = object.oneofIndex | 0; + if (object.jsonName != null) + message.jsonName = String(object.jsonName); + if (object.options != null) { + if (typeof object.options !== "object") + throw TypeError(".google.protobuf.FieldDescriptorProto.options: object expected"); + message.options = $root.google.protobuf.FieldOptions.fromObject(object.options); + } + if (object.proto3Optional != null) + message.proto3Optional = Boolean(object.proto3Optional); + return message; + }; + + /** + * Creates a plain object from a FieldDescriptorProto message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.FieldDescriptorProto + * @static + * @param {google.protobuf.FieldDescriptorProto} message FieldDescriptorProto + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + FieldDescriptorProto.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.extendee = ""; + object.number = 0; + object.label = options.enums === String ? "LABEL_OPTIONAL" : 1; + object.type = options.enums === String ? "TYPE_DOUBLE" : 1; + object.typeName = ""; + object.defaultValue = ""; + object.options = null; + object.oneofIndex = 0; + object.jsonName = ""; + object.proto3Optional = false; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.extendee != null && message.hasOwnProperty("extendee")) + object.extendee = message.extendee; + if (message.number != null && message.hasOwnProperty("number")) + object.number = message.number; + if (message.label != null && message.hasOwnProperty("label")) + object.label = options.enums === String ? $root.google.protobuf.FieldDescriptorProto.Label[message.label] === undefined ? message.label : $root.google.protobuf.FieldDescriptorProto.Label[message.label] : message.label; + if (message.type != null && message.hasOwnProperty("type")) + object.type = options.enums === String ? $root.google.protobuf.FieldDescriptorProto.Type[message.type] === undefined ? message.type : $root.google.protobuf.FieldDescriptorProto.Type[message.type] : message.type; + if (message.typeName != null && message.hasOwnProperty("typeName")) + object.typeName = message.typeName; + if (message.defaultValue != null && message.hasOwnProperty("defaultValue")) + object.defaultValue = message.defaultValue; + if (message.options != null && message.hasOwnProperty("options")) + object.options = $root.google.protobuf.FieldOptions.toObject(message.options, options); + if (message.oneofIndex != null && message.hasOwnProperty("oneofIndex")) + object.oneofIndex = message.oneofIndex; + if (message.jsonName != null && message.hasOwnProperty("jsonName")) + object.jsonName = message.jsonName; + if (message.proto3Optional != null && message.hasOwnProperty("proto3Optional")) + object.proto3Optional = message.proto3Optional; + return object; + }; + + /** + * Converts this FieldDescriptorProto to JSON. + * @function toJSON + * @memberof google.protobuf.FieldDescriptorProto + * @instance + * @returns {Object.} JSON object + */ + FieldDescriptorProto.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for FieldDescriptorProto + * @function getTypeUrl + * @memberof google.protobuf.FieldDescriptorProto + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FieldDescriptorProto.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.FieldDescriptorProto"; + }; + + /** + * Type enum. + * @name google.protobuf.FieldDescriptorProto.Type + * @enum {number} + * @property {number} TYPE_DOUBLE=1 TYPE_DOUBLE value + * @property {number} TYPE_FLOAT=2 TYPE_FLOAT value + * @property {number} TYPE_INT64=3 TYPE_INT64 value + * @property {number} TYPE_UINT64=4 TYPE_UINT64 value + * @property {number} TYPE_INT32=5 TYPE_INT32 value + * @property {number} TYPE_FIXED64=6 TYPE_FIXED64 value + * @property {number} TYPE_FIXED32=7 TYPE_FIXED32 value + * @property {number} TYPE_BOOL=8 TYPE_BOOL value + * @property {number} TYPE_STRING=9 TYPE_STRING value + * @property {number} TYPE_GROUP=10 TYPE_GROUP value + * @property {number} TYPE_MESSAGE=11 TYPE_MESSAGE value + * @property {number} TYPE_BYTES=12 TYPE_BYTES value + * @property {number} TYPE_UINT32=13 TYPE_UINT32 value + * @property {number} TYPE_ENUM=14 TYPE_ENUM value + * @property {number} TYPE_SFIXED32=15 TYPE_SFIXED32 value + * @property {number} TYPE_SFIXED64=16 TYPE_SFIXED64 value + * @property {number} TYPE_SINT32=17 TYPE_SINT32 value + * @property {number} TYPE_SINT64=18 TYPE_SINT64 value + */ + FieldDescriptorProto.Type = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[1] = "TYPE_DOUBLE"] = 1; + values[valuesById[2] = "TYPE_FLOAT"] = 2; + values[valuesById[3] = "TYPE_INT64"] = 3; + values[valuesById[4] = "TYPE_UINT64"] = 4; + values[valuesById[5] = "TYPE_INT32"] = 5; + values[valuesById[6] = "TYPE_FIXED64"] = 6; + values[valuesById[7] = "TYPE_FIXED32"] = 7; + values[valuesById[8] = "TYPE_BOOL"] = 8; + values[valuesById[9] = "TYPE_STRING"] = 9; + values[valuesById[10] = "TYPE_GROUP"] = 10; + values[valuesById[11] = "TYPE_MESSAGE"] = 11; + values[valuesById[12] = "TYPE_BYTES"] = 12; + values[valuesById[13] = "TYPE_UINT32"] = 13; + values[valuesById[14] = "TYPE_ENUM"] = 14; + values[valuesById[15] = "TYPE_SFIXED32"] = 15; + values[valuesById[16] = "TYPE_SFIXED64"] = 16; + values[valuesById[17] = "TYPE_SINT32"] = 17; + values[valuesById[18] = "TYPE_SINT64"] = 18; + return values; + })(); + + /** + * Label enum. + * @name google.protobuf.FieldDescriptorProto.Label + * @enum {number} + * @property {number} LABEL_OPTIONAL=1 LABEL_OPTIONAL value + * @property {number} LABEL_REQUIRED=2 LABEL_REQUIRED value + * @property {number} LABEL_REPEATED=3 LABEL_REPEATED value + */ + FieldDescriptorProto.Label = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[1] = "LABEL_OPTIONAL"] = 1; + values[valuesById[2] = "LABEL_REQUIRED"] = 2; + values[valuesById[3] = "LABEL_REPEATED"] = 3; + return values; + })(); + + return FieldDescriptorProto; + })(); + + protobuf.OneofDescriptorProto = (function() { + + /** + * Properties of an OneofDescriptorProto. + * @memberof google.protobuf + * @interface IOneofDescriptorProto + * @property {string|null} [name] OneofDescriptorProto name + * @property {google.protobuf.IOneofOptions|null} [options] OneofDescriptorProto options + */ + + /** + * Constructs a new OneofDescriptorProto. + * @memberof google.protobuf + * @classdesc Represents an OneofDescriptorProto. + * @implements IOneofDescriptorProto + * @constructor + * @param {google.protobuf.IOneofDescriptorProto=} [properties] Properties to set + */ + function OneofDescriptorProto(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * OneofDescriptorProto name. + * @member {string} name + * @memberof google.protobuf.OneofDescriptorProto + * @instance + */ + OneofDescriptorProto.prototype.name = ""; + + /** + * OneofDescriptorProto options. + * @member {google.protobuf.IOneofOptions|null|undefined} options + * @memberof google.protobuf.OneofDescriptorProto + * @instance + */ + OneofDescriptorProto.prototype.options = null; + + /** + * Creates a new OneofDescriptorProto instance using the specified properties. + * @function create + * @memberof google.protobuf.OneofDescriptorProto + * @static + * @param {google.protobuf.IOneofDescriptorProto=} [properties] Properties to set + * @returns {google.protobuf.OneofDescriptorProto} OneofDescriptorProto instance + */ + OneofDescriptorProto.create = function create(properties) { + return new OneofDescriptorProto(properties); + }; + + /** + * Encodes the specified OneofDescriptorProto message. Does not implicitly {@link google.protobuf.OneofDescriptorProto.verify|verify} messages. + * @function encode + * @memberof google.protobuf.OneofDescriptorProto + * @static + * @param {google.protobuf.IOneofDescriptorProto} message OneofDescriptorProto message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + OneofDescriptorProto.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.options != null && Object.hasOwnProperty.call(message, "options")) + $root.google.protobuf.OneofOptions.encode(message.options, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified OneofDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.OneofDescriptorProto.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.OneofDescriptorProto + * @static + * @param {google.protobuf.IOneofDescriptorProto} message OneofDescriptorProto message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + OneofDescriptorProto.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an OneofDescriptorProto message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.OneofDescriptorProto + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.OneofDescriptorProto} OneofDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + OneofDescriptorProto.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.OneofDescriptorProto(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.options = $root.google.protobuf.OneofOptions.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an OneofDescriptorProto message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.OneofDescriptorProto + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.OneofDescriptorProto} OneofDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + OneofDescriptorProto.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an OneofDescriptorProto message. + * @function verify + * @memberof google.protobuf.OneofDescriptorProto + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + OneofDescriptorProto.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.options != null && message.hasOwnProperty("options")) { + var error = $root.google.protobuf.OneofOptions.verify(message.options); + if (error) + return "options." + error; + } + return null; + }; + + /** + * Creates an OneofDescriptorProto message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.OneofDescriptorProto + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.OneofDescriptorProto} OneofDescriptorProto + */ + OneofDescriptorProto.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.OneofDescriptorProto) + return object; + var message = new $root.google.protobuf.OneofDescriptorProto(); + if (object.name != null) + message.name = String(object.name); + if (object.options != null) { + if (typeof object.options !== "object") + throw TypeError(".google.protobuf.OneofDescriptorProto.options: object expected"); + message.options = $root.google.protobuf.OneofOptions.fromObject(object.options); + } + return message; + }; + + /** + * Creates a plain object from an OneofDescriptorProto message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.OneofDescriptorProto + * @static + * @param {google.protobuf.OneofDescriptorProto} message OneofDescriptorProto + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + OneofDescriptorProto.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.options = null; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.options != null && message.hasOwnProperty("options")) + object.options = $root.google.protobuf.OneofOptions.toObject(message.options, options); + return object; + }; + + /** + * Converts this OneofDescriptorProto to JSON. + * @function toJSON + * @memberof google.protobuf.OneofDescriptorProto + * @instance + * @returns {Object.} JSON object + */ + OneofDescriptorProto.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for OneofDescriptorProto + * @function getTypeUrl + * @memberof google.protobuf.OneofDescriptorProto + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + OneofDescriptorProto.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.OneofDescriptorProto"; + }; + + return OneofDescriptorProto; + })(); + + protobuf.EnumDescriptorProto = (function() { + + /** + * Properties of an EnumDescriptorProto. + * @memberof google.protobuf + * @interface IEnumDescriptorProto + * @property {string|null} [name] EnumDescriptorProto name + * @property {Array.|null} [value] EnumDescriptorProto value + * @property {google.protobuf.IEnumOptions|null} [options] EnumDescriptorProto options + * @property {Array.|null} [reservedRange] EnumDescriptorProto reservedRange + * @property {Array.|null} [reservedName] EnumDescriptorProto reservedName + */ + + /** + * Constructs a new EnumDescriptorProto. + * @memberof google.protobuf + * @classdesc Represents an EnumDescriptorProto. + * @implements IEnumDescriptorProto + * @constructor + * @param {google.protobuf.IEnumDescriptorProto=} [properties] Properties to set + */ + function EnumDescriptorProto(properties) { + this.value = []; + this.reservedRange = []; + this.reservedName = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * EnumDescriptorProto name. + * @member {string} name + * @memberof google.protobuf.EnumDescriptorProto + * @instance + */ + EnumDescriptorProto.prototype.name = ""; + + /** + * EnumDescriptorProto value. + * @member {Array.} value + * @memberof google.protobuf.EnumDescriptorProto + * @instance + */ + EnumDescriptorProto.prototype.value = $util.emptyArray; + + /** + * EnumDescriptorProto options. + * @member {google.protobuf.IEnumOptions|null|undefined} options + * @memberof google.protobuf.EnumDescriptorProto + * @instance + */ + EnumDescriptorProto.prototype.options = null; + + /** + * EnumDescriptorProto reservedRange. + * @member {Array.} reservedRange + * @memberof google.protobuf.EnumDescriptorProto + * @instance + */ + EnumDescriptorProto.prototype.reservedRange = $util.emptyArray; + + /** + * EnumDescriptorProto reservedName. + * @member {Array.} reservedName + * @memberof google.protobuf.EnumDescriptorProto + * @instance + */ + EnumDescriptorProto.prototype.reservedName = $util.emptyArray; + + /** + * Creates a new EnumDescriptorProto instance using the specified properties. + * @function create + * @memberof google.protobuf.EnumDescriptorProto + * @static + * @param {google.protobuf.IEnumDescriptorProto=} [properties] Properties to set + * @returns {google.protobuf.EnumDescriptorProto} EnumDescriptorProto instance + */ + EnumDescriptorProto.create = function create(properties) { + return new EnumDescriptorProto(properties); + }; + + /** + * Encodes the specified EnumDescriptorProto message. Does not implicitly {@link google.protobuf.EnumDescriptorProto.verify|verify} messages. + * @function encode + * @memberof google.protobuf.EnumDescriptorProto + * @static + * @param {google.protobuf.IEnumDescriptorProto} message EnumDescriptorProto message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EnumDescriptorProto.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.value != null && message.value.length) + for (var i = 0; i < message.value.length; ++i) + $root.google.protobuf.EnumValueDescriptorProto.encode(message.value[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.options != null && Object.hasOwnProperty.call(message, "options")) + $root.google.protobuf.EnumOptions.encode(message.options, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.reservedRange != null && message.reservedRange.length) + for (var i = 0; i < message.reservedRange.length; ++i) + $root.google.protobuf.EnumDescriptorProto.EnumReservedRange.encode(message.reservedRange[i], writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.reservedName != null && message.reservedName.length) + for (var i = 0; i < message.reservedName.length; ++i) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.reservedName[i]); + return writer; + }; + + /** + * Encodes the specified EnumDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.EnumDescriptorProto.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.EnumDescriptorProto + * @static + * @param {google.protobuf.IEnumDescriptorProto} message EnumDescriptorProto message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EnumDescriptorProto.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an EnumDescriptorProto message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.EnumDescriptorProto + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.EnumDescriptorProto} EnumDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EnumDescriptorProto.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.EnumDescriptorProto(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + if (!(message.value && message.value.length)) + message.value = []; + message.value.push($root.google.protobuf.EnumValueDescriptorProto.decode(reader, reader.uint32())); + break; + } + case 3: { + message.options = $root.google.protobuf.EnumOptions.decode(reader, reader.uint32()); + break; + } + case 4: { + if (!(message.reservedRange && message.reservedRange.length)) + message.reservedRange = []; + message.reservedRange.push($root.google.protobuf.EnumDescriptorProto.EnumReservedRange.decode(reader, reader.uint32())); + break; + } + case 5: { + if (!(message.reservedName && message.reservedName.length)) + message.reservedName = []; + message.reservedName.push(reader.string()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an EnumDescriptorProto message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.EnumDescriptorProto + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.EnumDescriptorProto} EnumDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EnumDescriptorProto.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an EnumDescriptorProto message. + * @function verify + * @memberof google.protobuf.EnumDescriptorProto + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + EnumDescriptorProto.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.value != null && message.hasOwnProperty("value")) { + if (!Array.isArray(message.value)) + return "value: array expected"; + for (var i = 0; i < message.value.length; ++i) { + var error = $root.google.protobuf.EnumValueDescriptorProto.verify(message.value[i]); + if (error) + return "value." + error; + } + } + if (message.options != null && message.hasOwnProperty("options")) { + var error = $root.google.protobuf.EnumOptions.verify(message.options); + if (error) + return "options." + error; + } + if (message.reservedRange != null && message.hasOwnProperty("reservedRange")) { + if (!Array.isArray(message.reservedRange)) + return "reservedRange: array expected"; + for (var i = 0; i < message.reservedRange.length; ++i) { + var error = $root.google.protobuf.EnumDescriptorProto.EnumReservedRange.verify(message.reservedRange[i]); + if (error) + return "reservedRange." + error; + } + } + if (message.reservedName != null && message.hasOwnProperty("reservedName")) { + if (!Array.isArray(message.reservedName)) + return "reservedName: array expected"; + for (var i = 0; i < message.reservedName.length; ++i) + if (!$util.isString(message.reservedName[i])) + return "reservedName: string[] expected"; + } + return null; + }; + + /** + * Creates an EnumDescriptorProto message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.EnumDescriptorProto + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.EnumDescriptorProto} EnumDescriptorProto + */ + EnumDescriptorProto.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.EnumDescriptorProto) + return object; + var message = new $root.google.protobuf.EnumDescriptorProto(); + if (object.name != null) + message.name = String(object.name); + if (object.value) { + if (!Array.isArray(object.value)) + throw TypeError(".google.protobuf.EnumDescriptorProto.value: array expected"); + message.value = []; + for (var i = 0; i < object.value.length; ++i) { + if (typeof object.value[i] !== "object") + throw TypeError(".google.protobuf.EnumDescriptorProto.value: object expected"); + message.value[i] = $root.google.protobuf.EnumValueDescriptorProto.fromObject(object.value[i]); + } + } + if (object.options != null) { + if (typeof object.options !== "object") + throw TypeError(".google.protobuf.EnumDescriptorProto.options: object expected"); + message.options = $root.google.protobuf.EnumOptions.fromObject(object.options); + } + if (object.reservedRange) { + if (!Array.isArray(object.reservedRange)) + throw TypeError(".google.protobuf.EnumDescriptorProto.reservedRange: array expected"); + message.reservedRange = []; + for (var i = 0; i < object.reservedRange.length; ++i) { + if (typeof object.reservedRange[i] !== "object") + throw TypeError(".google.protobuf.EnumDescriptorProto.reservedRange: object expected"); + message.reservedRange[i] = $root.google.protobuf.EnumDescriptorProto.EnumReservedRange.fromObject(object.reservedRange[i]); + } + } + if (object.reservedName) { + if (!Array.isArray(object.reservedName)) + throw TypeError(".google.protobuf.EnumDescriptorProto.reservedName: array expected"); + message.reservedName = []; + for (var i = 0; i < object.reservedName.length; ++i) + message.reservedName[i] = String(object.reservedName[i]); + } + return message; + }; + + /** + * Creates a plain object from an EnumDescriptorProto message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.EnumDescriptorProto + * @static + * @param {google.protobuf.EnumDescriptorProto} message EnumDescriptorProto + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + EnumDescriptorProto.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.value = []; + object.reservedRange = []; + object.reservedName = []; + } + if (options.defaults) { + object.name = ""; + object.options = null; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.value && message.value.length) { + object.value = []; + for (var j = 0; j < message.value.length; ++j) + object.value[j] = $root.google.protobuf.EnumValueDescriptorProto.toObject(message.value[j], options); + } + if (message.options != null && message.hasOwnProperty("options")) + object.options = $root.google.protobuf.EnumOptions.toObject(message.options, options); + if (message.reservedRange && message.reservedRange.length) { + object.reservedRange = []; + for (var j = 0; j < message.reservedRange.length; ++j) + object.reservedRange[j] = $root.google.protobuf.EnumDescriptorProto.EnumReservedRange.toObject(message.reservedRange[j], options); + } + if (message.reservedName && message.reservedName.length) { + object.reservedName = []; + for (var j = 0; j < message.reservedName.length; ++j) + object.reservedName[j] = message.reservedName[j]; + } + return object; + }; + + /** + * Converts this EnumDescriptorProto to JSON. + * @function toJSON + * @memberof google.protobuf.EnumDescriptorProto + * @instance + * @returns {Object.} JSON object + */ + EnumDescriptorProto.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for EnumDescriptorProto + * @function getTypeUrl + * @memberof google.protobuf.EnumDescriptorProto + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + EnumDescriptorProto.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.EnumDescriptorProto"; + }; + + EnumDescriptorProto.EnumReservedRange = (function() { + + /** + * Properties of an EnumReservedRange. + * @memberof google.protobuf.EnumDescriptorProto + * @interface IEnumReservedRange + * @property {number|null} [start] EnumReservedRange start + * @property {number|null} [end] EnumReservedRange end + */ + + /** + * Constructs a new EnumReservedRange. + * @memberof google.protobuf.EnumDescriptorProto + * @classdesc Represents an EnumReservedRange. + * @implements IEnumReservedRange + * @constructor + * @param {google.protobuf.EnumDescriptorProto.IEnumReservedRange=} [properties] Properties to set + */ + function EnumReservedRange(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * EnumReservedRange start. + * @member {number} start + * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange + * @instance + */ + EnumReservedRange.prototype.start = 0; + + /** + * EnumReservedRange end. + * @member {number} end + * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange + * @instance + */ + EnumReservedRange.prototype.end = 0; + + /** + * Creates a new EnumReservedRange instance using the specified properties. + * @function create + * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange + * @static + * @param {google.protobuf.EnumDescriptorProto.IEnumReservedRange=} [properties] Properties to set + * @returns {google.protobuf.EnumDescriptorProto.EnumReservedRange} EnumReservedRange instance + */ + EnumReservedRange.create = function create(properties) { + return new EnumReservedRange(properties); + }; + + /** + * Encodes the specified EnumReservedRange message. Does not implicitly {@link google.protobuf.EnumDescriptorProto.EnumReservedRange.verify|verify} messages. + * @function encode + * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange + * @static + * @param {google.protobuf.EnumDescriptorProto.IEnumReservedRange} message EnumReservedRange message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EnumReservedRange.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.start != null && Object.hasOwnProperty.call(message, "start")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.start); + if (message.end != null && Object.hasOwnProperty.call(message, "end")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.end); + return writer; + }; + + /** + * Encodes the specified EnumReservedRange message, length delimited. Does not implicitly {@link google.protobuf.EnumDescriptorProto.EnumReservedRange.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange + * @static + * @param {google.protobuf.EnumDescriptorProto.IEnumReservedRange} message EnumReservedRange message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EnumReservedRange.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an EnumReservedRange message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.EnumDescriptorProto.EnumReservedRange} EnumReservedRange + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EnumReservedRange.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.EnumDescriptorProto.EnumReservedRange(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.start = reader.int32(); + break; + } + case 2: { + message.end = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an EnumReservedRange message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.EnumDescriptorProto.EnumReservedRange} EnumReservedRange + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EnumReservedRange.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an EnumReservedRange message. + * @function verify + * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + EnumReservedRange.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.start != null && message.hasOwnProperty("start")) + if (!$util.isInteger(message.start)) + return "start: integer expected"; + if (message.end != null && message.hasOwnProperty("end")) + if (!$util.isInteger(message.end)) + return "end: integer expected"; + return null; + }; + + /** + * Creates an EnumReservedRange message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.EnumDescriptorProto.EnumReservedRange} EnumReservedRange + */ + EnumReservedRange.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.EnumDescriptorProto.EnumReservedRange) + return object; + var message = new $root.google.protobuf.EnumDescriptorProto.EnumReservedRange(); + if (object.start != null) + message.start = object.start | 0; + if (object.end != null) + message.end = object.end | 0; + return message; + }; + + /** + * Creates a plain object from an EnumReservedRange message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange + * @static + * @param {google.protobuf.EnumDescriptorProto.EnumReservedRange} message EnumReservedRange + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + EnumReservedRange.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.start = 0; + object.end = 0; + } + if (message.start != null && message.hasOwnProperty("start")) + object.start = message.start; + if (message.end != null && message.hasOwnProperty("end")) + object.end = message.end; + return object; + }; + + /** + * Converts this EnumReservedRange to JSON. + * @function toJSON + * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange + * @instance + * @returns {Object.} JSON object + */ + EnumReservedRange.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for EnumReservedRange + * @function getTypeUrl + * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + EnumReservedRange.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.EnumDescriptorProto.EnumReservedRange"; + }; + + return EnumReservedRange; + })(); + + return EnumDescriptorProto; + })(); + + protobuf.EnumValueDescriptorProto = (function() { + + /** + * Properties of an EnumValueDescriptorProto. + * @memberof google.protobuf + * @interface IEnumValueDescriptorProto + * @property {string|null} [name] EnumValueDescriptorProto name + * @property {number|null} [number] EnumValueDescriptorProto number + * @property {google.protobuf.IEnumValueOptions|null} [options] EnumValueDescriptorProto options + */ + + /** + * Constructs a new EnumValueDescriptorProto. + * @memberof google.protobuf + * @classdesc Represents an EnumValueDescriptorProto. + * @implements IEnumValueDescriptorProto + * @constructor + * @param {google.protobuf.IEnumValueDescriptorProto=} [properties] Properties to set + */ + function EnumValueDescriptorProto(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * EnumValueDescriptorProto name. + * @member {string} name + * @memberof google.protobuf.EnumValueDescriptorProto + * @instance + */ + EnumValueDescriptorProto.prototype.name = ""; + + /** + * EnumValueDescriptorProto number. + * @member {number} number + * @memberof google.protobuf.EnumValueDescriptorProto + * @instance + */ + EnumValueDescriptorProto.prototype.number = 0; + + /** + * EnumValueDescriptorProto options. + * @member {google.protobuf.IEnumValueOptions|null|undefined} options + * @memberof google.protobuf.EnumValueDescriptorProto + * @instance + */ + EnumValueDescriptorProto.prototype.options = null; + + /** + * Creates a new EnumValueDescriptorProto instance using the specified properties. + * @function create + * @memberof google.protobuf.EnumValueDescriptorProto + * @static + * @param {google.protobuf.IEnumValueDescriptorProto=} [properties] Properties to set + * @returns {google.protobuf.EnumValueDescriptorProto} EnumValueDescriptorProto instance + */ + EnumValueDescriptorProto.create = function create(properties) { + return new EnumValueDescriptorProto(properties); + }; + + /** + * Encodes the specified EnumValueDescriptorProto message. Does not implicitly {@link google.protobuf.EnumValueDescriptorProto.verify|verify} messages. + * @function encode + * @memberof google.protobuf.EnumValueDescriptorProto + * @static + * @param {google.protobuf.IEnumValueDescriptorProto} message EnumValueDescriptorProto message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EnumValueDescriptorProto.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.number != null && Object.hasOwnProperty.call(message, "number")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.number); + if (message.options != null && Object.hasOwnProperty.call(message, "options")) + $root.google.protobuf.EnumValueOptions.encode(message.options, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified EnumValueDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.EnumValueDescriptorProto.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.EnumValueDescriptorProto + * @static + * @param {google.protobuf.IEnumValueDescriptorProto} message EnumValueDescriptorProto message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EnumValueDescriptorProto.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an EnumValueDescriptorProto message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.EnumValueDescriptorProto + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.EnumValueDescriptorProto} EnumValueDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EnumValueDescriptorProto.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.EnumValueDescriptorProto(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.number = reader.int32(); + break; + } + case 3: { + message.options = $root.google.protobuf.EnumValueOptions.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an EnumValueDescriptorProto message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.EnumValueDescriptorProto + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.EnumValueDescriptorProto} EnumValueDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EnumValueDescriptorProto.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an EnumValueDescriptorProto message. + * @function verify + * @memberof google.protobuf.EnumValueDescriptorProto + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + EnumValueDescriptorProto.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.number != null && message.hasOwnProperty("number")) + if (!$util.isInteger(message.number)) + return "number: integer expected"; + if (message.options != null && message.hasOwnProperty("options")) { + var error = $root.google.protobuf.EnumValueOptions.verify(message.options); + if (error) + return "options." + error; + } + return null; + }; + + /** + * Creates an EnumValueDescriptorProto message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.EnumValueDescriptorProto + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.EnumValueDescriptorProto} EnumValueDescriptorProto + */ + EnumValueDescriptorProto.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.EnumValueDescriptorProto) + return object; + var message = new $root.google.protobuf.EnumValueDescriptorProto(); + if (object.name != null) + message.name = String(object.name); + if (object.number != null) + message.number = object.number | 0; + if (object.options != null) { + if (typeof object.options !== "object") + throw TypeError(".google.protobuf.EnumValueDescriptorProto.options: object expected"); + message.options = $root.google.protobuf.EnumValueOptions.fromObject(object.options); + } + return message; + }; + + /** + * Creates a plain object from an EnumValueDescriptorProto message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.EnumValueDescriptorProto + * @static + * @param {google.protobuf.EnumValueDescriptorProto} message EnumValueDescriptorProto + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + EnumValueDescriptorProto.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.number = 0; + object.options = null; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.number != null && message.hasOwnProperty("number")) + object.number = message.number; + if (message.options != null && message.hasOwnProperty("options")) + object.options = $root.google.protobuf.EnumValueOptions.toObject(message.options, options); + return object; + }; + + /** + * Converts this EnumValueDescriptorProto to JSON. + * @function toJSON + * @memberof google.protobuf.EnumValueDescriptorProto + * @instance + * @returns {Object.} JSON object + */ + EnumValueDescriptorProto.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for EnumValueDescriptorProto + * @function getTypeUrl + * @memberof google.protobuf.EnumValueDescriptorProto + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + EnumValueDescriptorProto.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.EnumValueDescriptorProto"; + }; + + return EnumValueDescriptorProto; + })(); + + protobuf.ServiceDescriptorProto = (function() { + + /** + * Properties of a ServiceDescriptorProto. + * @memberof google.protobuf + * @interface IServiceDescriptorProto + * @property {string|null} [name] ServiceDescriptorProto name + * @property {Array.|null} [method] ServiceDescriptorProto method + * @property {google.protobuf.IServiceOptions|null} [options] ServiceDescriptorProto options + */ + + /** + * Constructs a new ServiceDescriptorProto. + * @memberof google.protobuf + * @classdesc Represents a ServiceDescriptorProto. + * @implements IServiceDescriptorProto + * @constructor + * @param {google.protobuf.IServiceDescriptorProto=} [properties] Properties to set + */ + function ServiceDescriptorProto(properties) { + this.method = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ServiceDescriptorProto name. + * @member {string} name + * @memberof google.protobuf.ServiceDescriptorProto + * @instance + */ + ServiceDescriptorProto.prototype.name = ""; + + /** + * ServiceDescriptorProto method. + * @member {Array.} method + * @memberof google.protobuf.ServiceDescriptorProto + * @instance + */ + ServiceDescriptorProto.prototype.method = $util.emptyArray; + + /** + * ServiceDescriptorProto options. + * @member {google.protobuf.IServiceOptions|null|undefined} options + * @memberof google.protobuf.ServiceDescriptorProto + * @instance + */ + ServiceDescriptorProto.prototype.options = null; + + /** + * Creates a new ServiceDescriptorProto instance using the specified properties. + * @function create + * @memberof google.protobuf.ServiceDescriptorProto + * @static + * @param {google.protobuf.IServiceDescriptorProto=} [properties] Properties to set + * @returns {google.protobuf.ServiceDescriptorProto} ServiceDescriptorProto instance + */ + ServiceDescriptorProto.create = function create(properties) { + return new ServiceDescriptorProto(properties); + }; + + /** + * Encodes the specified ServiceDescriptorProto message. Does not implicitly {@link google.protobuf.ServiceDescriptorProto.verify|verify} messages. + * @function encode + * @memberof google.protobuf.ServiceDescriptorProto + * @static + * @param {google.protobuf.IServiceDescriptorProto} message ServiceDescriptorProto message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ServiceDescriptorProto.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.method != null && message.method.length) + for (var i = 0; i < message.method.length; ++i) + $root.google.protobuf.MethodDescriptorProto.encode(message.method[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.options != null && Object.hasOwnProperty.call(message, "options")) + $root.google.protobuf.ServiceOptions.encode(message.options, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified ServiceDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.ServiceDescriptorProto.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.ServiceDescriptorProto + * @static + * @param {google.protobuf.IServiceDescriptorProto} message ServiceDescriptorProto message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ServiceDescriptorProto.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ServiceDescriptorProto message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.ServiceDescriptorProto + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.ServiceDescriptorProto} ServiceDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ServiceDescriptorProto.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.ServiceDescriptorProto(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + if (!(message.method && message.method.length)) + message.method = []; + message.method.push($root.google.protobuf.MethodDescriptorProto.decode(reader, reader.uint32())); + break; + } + case 3: { + message.options = $root.google.protobuf.ServiceOptions.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ServiceDescriptorProto message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.ServiceDescriptorProto + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.ServiceDescriptorProto} ServiceDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ServiceDescriptorProto.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ServiceDescriptorProto message. + * @function verify + * @memberof google.protobuf.ServiceDescriptorProto + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ServiceDescriptorProto.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.method != null && message.hasOwnProperty("method")) { + if (!Array.isArray(message.method)) + return "method: array expected"; + for (var i = 0; i < message.method.length; ++i) { + var error = $root.google.protobuf.MethodDescriptorProto.verify(message.method[i]); + if (error) + return "method." + error; + } + } + if (message.options != null && message.hasOwnProperty("options")) { + var error = $root.google.protobuf.ServiceOptions.verify(message.options); + if (error) + return "options." + error; + } + return null; + }; + + /** + * Creates a ServiceDescriptorProto message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.ServiceDescriptorProto + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.ServiceDescriptorProto} ServiceDescriptorProto + */ + ServiceDescriptorProto.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.ServiceDescriptorProto) + return object; + var message = new $root.google.protobuf.ServiceDescriptorProto(); + if (object.name != null) + message.name = String(object.name); + if (object.method) { + if (!Array.isArray(object.method)) + throw TypeError(".google.protobuf.ServiceDescriptorProto.method: array expected"); + message.method = []; + for (var i = 0; i < object.method.length; ++i) { + if (typeof object.method[i] !== "object") + throw TypeError(".google.protobuf.ServiceDescriptorProto.method: object expected"); + message.method[i] = $root.google.protobuf.MethodDescriptorProto.fromObject(object.method[i]); + } + } + if (object.options != null) { + if (typeof object.options !== "object") + throw TypeError(".google.protobuf.ServiceDescriptorProto.options: object expected"); + message.options = $root.google.protobuf.ServiceOptions.fromObject(object.options); + } + return message; + }; + + /** + * Creates a plain object from a ServiceDescriptorProto message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.ServiceDescriptorProto + * @static + * @param {google.protobuf.ServiceDescriptorProto} message ServiceDescriptorProto + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ServiceDescriptorProto.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.method = []; + if (options.defaults) { + object.name = ""; + object.options = null; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.method && message.method.length) { + object.method = []; + for (var j = 0; j < message.method.length; ++j) + object.method[j] = $root.google.protobuf.MethodDescriptorProto.toObject(message.method[j], options); + } + if (message.options != null && message.hasOwnProperty("options")) + object.options = $root.google.protobuf.ServiceOptions.toObject(message.options, options); + return object; + }; + + /** + * Converts this ServiceDescriptorProto to JSON. + * @function toJSON + * @memberof google.protobuf.ServiceDescriptorProto + * @instance + * @returns {Object.} JSON object + */ + ServiceDescriptorProto.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ServiceDescriptorProto + * @function getTypeUrl + * @memberof google.protobuf.ServiceDescriptorProto + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ServiceDescriptorProto.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.ServiceDescriptorProto"; + }; + + return ServiceDescriptorProto; + })(); + + protobuf.MethodDescriptorProto = (function() { + + /** + * Properties of a MethodDescriptorProto. + * @memberof google.protobuf + * @interface IMethodDescriptorProto + * @property {string|null} [name] MethodDescriptorProto name + * @property {string|null} [inputType] MethodDescriptorProto inputType + * @property {string|null} [outputType] MethodDescriptorProto outputType + * @property {google.protobuf.IMethodOptions|null} [options] MethodDescriptorProto options + * @property {boolean|null} [clientStreaming] MethodDescriptorProto clientStreaming + * @property {boolean|null} [serverStreaming] MethodDescriptorProto serverStreaming + */ + + /** + * Constructs a new MethodDescriptorProto. + * @memberof google.protobuf + * @classdesc Represents a MethodDescriptorProto. + * @implements IMethodDescriptorProto + * @constructor + * @param {google.protobuf.IMethodDescriptorProto=} [properties] Properties to set + */ + function MethodDescriptorProto(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * MethodDescriptorProto name. + * @member {string} name + * @memberof google.protobuf.MethodDescriptorProto + * @instance + */ + MethodDescriptorProto.prototype.name = ""; + + /** + * MethodDescriptorProto inputType. + * @member {string} inputType + * @memberof google.protobuf.MethodDescriptorProto + * @instance + */ + MethodDescriptorProto.prototype.inputType = ""; + + /** + * MethodDescriptorProto outputType. + * @member {string} outputType + * @memberof google.protobuf.MethodDescriptorProto + * @instance + */ + MethodDescriptorProto.prototype.outputType = ""; + + /** + * MethodDescriptorProto options. + * @member {google.protobuf.IMethodOptions|null|undefined} options + * @memberof google.protobuf.MethodDescriptorProto + * @instance + */ + MethodDescriptorProto.prototype.options = null; + + /** + * MethodDescriptorProto clientStreaming. + * @member {boolean} clientStreaming + * @memberof google.protobuf.MethodDescriptorProto + * @instance + */ + MethodDescriptorProto.prototype.clientStreaming = false; + + /** + * MethodDescriptorProto serverStreaming. + * @member {boolean} serverStreaming + * @memberof google.protobuf.MethodDescriptorProto + * @instance + */ + MethodDescriptorProto.prototype.serverStreaming = false; + + /** + * Creates a new MethodDescriptorProto instance using the specified properties. + * @function create + * @memberof google.protobuf.MethodDescriptorProto + * @static + * @param {google.protobuf.IMethodDescriptorProto=} [properties] Properties to set + * @returns {google.protobuf.MethodDescriptorProto} MethodDescriptorProto instance + */ + MethodDescriptorProto.create = function create(properties) { + return new MethodDescriptorProto(properties); + }; + + /** + * Encodes the specified MethodDescriptorProto message. Does not implicitly {@link google.protobuf.MethodDescriptorProto.verify|verify} messages. + * @function encode + * @memberof google.protobuf.MethodDescriptorProto + * @static + * @param {google.protobuf.IMethodDescriptorProto} message MethodDescriptorProto message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MethodDescriptorProto.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.inputType != null && Object.hasOwnProperty.call(message, "inputType")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.inputType); + if (message.outputType != null && Object.hasOwnProperty.call(message, "outputType")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.outputType); + if (message.options != null && Object.hasOwnProperty.call(message, "options")) + $root.google.protobuf.MethodOptions.encode(message.options, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.clientStreaming != null && Object.hasOwnProperty.call(message, "clientStreaming")) + writer.uint32(/* id 5, wireType 0 =*/40).bool(message.clientStreaming); + if (message.serverStreaming != null && Object.hasOwnProperty.call(message, "serverStreaming")) + writer.uint32(/* id 6, wireType 0 =*/48).bool(message.serverStreaming); + return writer; + }; + + /** + * Encodes the specified MethodDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.MethodDescriptorProto.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.MethodDescriptorProto + * @static + * @param {google.protobuf.IMethodDescriptorProto} message MethodDescriptorProto message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MethodDescriptorProto.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a MethodDescriptorProto message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.MethodDescriptorProto + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.MethodDescriptorProto} MethodDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MethodDescriptorProto.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.MethodDescriptorProto(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.inputType = reader.string(); + break; + } + case 3: { + message.outputType = reader.string(); + break; + } + case 4: { + message.options = $root.google.protobuf.MethodOptions.decode(reader, reader.uint32()); + break; + } + case 5: { + message.clientStreaming = reader.bool(); + break; + } + case 6: { + message.serverStreaming = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a MethodDescriptorProto message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.MethodDescriptorProto + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.MethodDescriptorProto} MethodDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MethodDescriptorProto.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a MethodDescriptorProto message. + * @function verify + * @memberof google.protobuf.MethodDescriptorProto + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + MethodDescriptorProto.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.inputType != null && message.hasOwnProperty("inputType")) + if (!$util.isString(message.inputType)) + return "inputType: string expected"; + if (message.outputType != null && message.hasOwnProperty("outputType")) + if (!$util.isString(message.outputType)) + return "outputType: string expected"; + if (message.options != null && message.hasOwnProperty("options")) { + var error = $root.google.protobuf.MethodOptions.verify(message.options); + if (error) + return "options." + error; + } + if (message.clientStreaming != null && message.hasOwnProperty("clientStreaming")) + if (typeof message.clientStreaming !== "boolean") + return "clientStreaming: boolean expected"; + if (message.serverStreaming != null && message.hasOwnProperty("serverStreaming")) + if (typeof message.serverStreaming !== "boolean") + return "serverStreaming: boolean expected"; + return null; + }; + + /** + * Creates a MethodDescriptorProto message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.MethodDescriptorProto + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.MethodDescriptorProto} MethodDescriptorProto + */ + MethodDescriptorProto.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.MethodDescriptorProto) + return object; + var message = new $root.google.protobuf.MethodDescriptorProto(); + if (object.name != null) + message.name = String(object.name); + if (object.inputType != null) + message.inputType = String(object.inputType); + if (object.outputType != null) + message.outputType = String(object.outputType); + if (object.options != null) { + if (typeof object.options !== "object") + throw TypeError(".google.protobuf.MethodDescriptorProto.options: object expected"); + message.options = $root.google.protobuf.MethodOptions.fromObject(object.options); + } + if (object.clientStreaming != null) + message.clientStreaming = Boolean(object.clientStreaming); + if (object.serverStreaming != null) + message.serverStreaming = Boolean(object.serverStreaming); + return message; + }; + + /** + * Creates a plain object from a MethodDescriptorProto message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.MethodDescriptorProto + * @static + * @param {google.protobuf.MethodDescriptorProto} message MethodDescriptorProto + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + MethodDescriptorProto.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.inputType = ""; + object.outputType = ""; + object.options = null; + object.clientStreaming = false; + object.serverStreaming = false; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.inputType != null && message.hasOwnProperty("inputType")) + object.inputType = message.inputType; + if (message.outputType != null && message.hasOwnProperty("outputType")) + object.outputType = message.outputType; + if (message.options != null && message.hasOwnProperty("options")) + object.options = $root.google.protobuf.MethodOptions.toObject(message.options, options); + if (message.clientStreaming != null && message.hasOwnProperty("clientStreaming")) + object.clientStreaming = message.clientStreaming; + if (message.serverStreaming != null && message.hasOwnProperty("serverStreaming")) + object.serverStreaming = message.serverStreaming; + return object; + }; + + /** + * Converts this MethodDescriptorProto to JSON. + * @function toJSON + * @memberof google.protobuf.MethodDescriptorProto + * @instance + * @returns {Object.} JSON object + */ + MethodDescriptorProto.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for MethodDescriptorProto + * @function getTypeUrl + * @memberof google.protobuf.MethodDescriptorProto + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + MethodDescriptorProto.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.MethodDescriptorProto"; + }; + + return MethodDescriptorProto; + })(); + + protobuf.FileOptions = (function() { + + /** + * Properties of a FileOptions. + * @memberof google.protobuf + * @interface IFileOptions + * @property {string|null} [javaPackage] FileOptions javaPackage + * @property {string|null} [javaOuterClassname] FileOptions javaOuterClassname + * @property {boolean|null} [javaMultipleFiles] FileOptions javaMultipleFiles + * @property {boolean|null} [javaGenerateEqualsAndHash] FileOptions javaGenerateEqualsAndHash + * @property {boolean|null} [javaStringCheckUtf8] FileOptions javaStringCheckUtf8 + * @property {google.protobuf.FileOptions.OptimizeMode|null} [optimizeFor] FileOptions optimizeFor + * @property {string|null} [goPackage] FileOptions goPackage + * @property {boolean|null} [ccGenericServices] FileOptions ccGenericServices + * @property {boolean|null} [javaGenericServices] FileOptions javaGenericServices + * @property {boolean|null} [pyGenericServices] FileOptions pyGenericServices + * @property {boolean|null} [phpGenericServices] FileOptions phpGenericServices + * @property {boolean|null} [deprecated] FileOptions deprecated + * @property {boolean|null} [ccEnableArenas] FileOptions ccEnableArenas + * @property {string|null} [objcClassPrefix] FileOptions objcClassPrefix + * @property {string|null} [csharpNamespace] FileOptions csharpNamespace + * @property {string|null} [swiftPrefix] FileOptions swiftPrefix + * @property {string|null} [phpClassPrefix] FileOptions phpClassPrefix + * @property {string|null} [phpNamespace] FileOptions phpNamespace + * @property {string|null} [phpMetadataNamespace] FileOptions phpMetadataNamespace + * @property {string|null} [rubyPackage] FileOptions rubyPackage + * @property {Array.|null} [uninterpretedOption] FileOptions uninterpretedOption + * @property {Array.|null} [".google.api.resourceDefinition"] FileOptions .google.api.resourceDefinition + */ + + /** + * Constructs a new FileOptions. + * @memberof google.protobuf + * @classdesc Represents a FileOptions. + * @implements IFileOptions + * @constructor + * @param {google.protobuf.IFileOptions=} [properties] Properties to set + */ + function FileOptions(properties) { + this.uninterpretedOption = []; + this[".google.api.resourceDefinition"] = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * FileOptions javaPackage. + * @member {string} javaPackage + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.javaPackage = ""; + + /** + * FileOptions javaOuterClassname. + * @member {string} javaOuterClassname + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.javaOuterClassname = ""; + + /** + * FileOptions javaMultipleFiles. + * @member {boolean} javaMultipleFiles + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.javaMultipleFiles = false; + + /** + * FileOptions javaGenerateEqualsAndHash. + * @member {boolean} javaGenerateEqualsAndHash + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.javaGenerateEqualsAndHash = false; + + /** + * FileOptions javaStringCheckUtf8. + * @member {boolean} javaStringCheckUtf8 + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.javaStringCheckUtf8 = false; + + /** + * FileOptions optimizeFor. + * @member {google.protobuf.FileOptions.OptimizeMode} optimizeFor + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.optimizeFor = 1; + + /** + * FileOptions goPackage. + * @member {string} goPackage + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.goPackage = ""; + + /** + * FileOptions ccGenericServices. + * @member {boolean} ccGenericServices + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.ccGenericServices = false; + + /** + * FileOptions javaGenericServices. + * @member {boolean} javaGenericServices + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.javaGenericServices = false; + + /** + * FileOptions pyGenericServices. + * @member {boolean} pyGenericServices + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.pyGenericServices = false; + + /** + * FileOptions phpGenericServices. + * @member {boolean} phpGenericServices + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.phpGenericServices = false; + + /** + * FileOptions deprecated. + * @member {boolean} deprecated + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.deprecated = false; + + /** + * FileOptions ccEnableArenas. + * @member {boolean} ccEnableArenas + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.ccEnableArenas = true; + + /** + * FileOptions objcClassPrefix. + * @member {string} objcClassPrefix + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.objcClassPrefix = ""; + + /** + * FileOptions csharpNamespace. + * @member {string} csharpNamespace + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.csharpNamespace = ""; + + /** + * FileOptions swiftPrefix. + * @member {string} swiftPrefix + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.swiftPrefix = ""; + + /** + * FileOptions phpClassPrefix. + * @member {string} phpClassPrefix + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.phpClassPrefix = ""; + + /** + * FileOptions phpNamespace. + * @member {string} phpNamespace + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.phpNamespace = ""; + + /** + * FileOptions phpMetadataNamespace. + * @member {string} phpMetadataNamespace + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.phpMetadataNamespace = ""; + + /** + * FileOptions rubyPackage. + * @member {string} rubyPackage + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.rubyPackage = ""; + + /** + * FileOptions uninterpretedOption. + * @member {Array.} uninterpretedOption + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.uninterpretedOption = $util.emptyArray; + + /** + * FileOptions .google.api.resourceDefinition. + * @member {Array.} .google.api.resourceDefinition + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype[".google.api.resourceDefinition"] = $util.emptyArray; + + /** + * Creates a new FileOptions instance using the specified properties. + * @function create + * @memberof google.protobuf.FileOptions + * @static + * @param {google.protobuf.IFileOptions=} [properties] Properties to set + * @returns {google.protobuf.FileOptions} FileOptions instance + */ + FileOptions.create = function create(properties) { + return new FileOptions(properties); + }; + + /** + * Encodes the specified FileOptions message. Does not implicitly {@link google.protobuf.FileOptions.verify|verify} messages. + * @function encode + * @memberof google.protobuf.FileOptions + * @static + * @param {google.protobuf.IFileOptions} message FileOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FileOptions.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.javaPackage != null && Object.hasOwnProperty.call(message, "javaPackage")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.javaPackage); + if (message.javaOuterClassname != null && Object.hasOwnProperty.call(message, "javaOuterClassname")) + writer.uint32(/* id 8, wireType 2 =*/66).string(message.javaOuterClassname); + if (message.optimizeFor != null && Object.hasOwnProperty.call(message, "optimizeFor")) + writer.uint32(/* id 9, wireType 0 =*/72).int32(message.optimizeFor); + if (message.javaMultipleFiles != null && Object.hasOwnProperty.call(message, "javaMultipleFiles")) + writer.uint32(/* id 10, wireType 0 =*/80).bool(message.javaMultipleFiles); + if (message.goPackage != null && Object.hasOwnProperty.call(message, "goPackage")) + writer.uint32(/* id 11, wireType 2 =*/90).string(message.goPackage); + if (message.ccGenericServices != null && Object.hasOwnProperty.call(message, "ccGenericServices")) + writer.uint32(/* id 16, wireType 0 =*/128).bool(message.ccGenericServices); + if (message.javaGenericServices != null && Object.hasOwnProperty.call(message, "javaGenericServices")) + writer.uint32(/* id 17, wireType 0 =*/136).bool(message.javaGenericServices); + if (message.pyGenericServices != null && Object.hasOwnProperty.call(message, "pyGenericServices")) + writer.uint32(/* id 18, wireType 0 =*/144).bool(message.pyGenericServices); + if (message.javaGenerateEqualsAndHash != null && Object.hasOwnProperty.call(message, "javaGenerateEqualsAndHash")) + writer.uint32(/* id 20, wireType 0 =*/160).bool(message.javaGenerateEqualsAndHash); + if (message.deprecated != null && Object.hasOwnProperty.call(message, "deprecated")) + writer.uint32(/* id 23, wireType 0 =*/184).bool(message.deprecated); + if (message.javaStringCheckUtf8 != null && Object.hasOwnProperty.call(message, "javaStringCheckUtf8")) + writer.uint32(/* id 27, wireType 0 =*/216).bool(message.javaStringCheckUtf8); + if (message.ccEnableArenas != null && Object.hasOwnProperty.call(message, "ccEnableArenas")) + writer.uint32(/* id 31, wireType 0 =*/248).bool(message.ccEnableArenas); + if (message.objcClassPrefix != null && Object.hasOwnProperty.call(message, "objcClassPrefix")) + writer.uint32(/* id 36, wireType 2 =*/290).string(message.objcClassPrefix); + if (message.csharpNamespace != null && Object.hasOwnProperty.call(message, "csharpNamespace")) + writer.uint32(/* id 37, wireType 2 =*/298).string(message.csharpNamespace); + if (message.swiftPrefix != null && Object.hasOwnProperty.call(message, "swiftPrefix")) + writer.uint32(/* id 39, wireType 2 =*/314).string(message.swiftPrefix); + if (message.phpClassPrefix != null && Object.hasOwnProperty.call(message, "phpClassPrefix")) + writer.uint32(/* id 40, wireType 2 =*/322).string(message.phpClassPrefix); + if (message.phpNamespace != null && Object.hasOwnProperty.call(message, "phpNamespace")) + writer.uint32(/* id 41, wireType 2 =*/330).string(message.phpNamespace); + if (message.phpGenericServices != null && Object.hasOwnProperty.call(message, "phpGenericServices")) + writer.uint32(/* id 42, wireType 0 =*/336).bool(message.phpGenericServices); + if (message.phpMetadataNamespace != null && Object.hasOwnProperty.call(message, "phpMetadataNamespace")) + writer.uint32(/* id 44, wireType 2 =*/354).string(message.phpMetadataNamespace); + if (message.rubyPackage != null && Object.hasOwnProperty.call(message, "rubyPackage")) + writer.uint32(/* id 45, wireType 2 =*/362).string(message.rubyPackage); + if (message.uninterpretedOption != null && message.uninterpretedOption.length) + for (var i = 0; i < message.uninterpretedOption.length; ++i) + $root.google.protobuf.UninterpretedOption.encode(message.uninterpretedOption[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork()).ldelim(); + if (message[".google.api.resourceDefinition"] != null && message[".google.api.resourceDefinition"].length) + for (var i = 0; i < message[".google.api.resourceDefinition"].length; ++i) + $root.google.api.ResourceDescriptor.encode(message[".google.api.resourceDefinition"][i], writer.uint32(/* id 1053, wireType 2 =*/8426).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified FileOptions message, length delimited. Does not implicitly {@link google.protobuf.FileOptions.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.FileOptions + * @static + * @param {google.protobuf.IFileOptions} message FileOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FileOptions.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a FileOptions message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.FileOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.FileOptions} FileOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FileOptions.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.FileOptions(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.javaPackage = reader.string(); + break; + } + case 8: { + message.javaOuterClassname = reader.string(); + break; + } + case 10: { + message.javaMultipleFiles = reader.bool(); + break; + } + case 20: { + message.javaGenerateEqualsAndHash = reader.bool(); + break; + } + case 27: { + message.javaStringCheckUtf8 = reader.bool(); + break; + } + case 9: { + message.optimizeFor = reader.int32(); + break; + } + case 11: { + message.goPackage = reader.string(); + break; + } + case 16: { + message.ccGenericServices = reader.bool(); + break; + } + case 17: { + message.javaGenericServices = reader.bool(); + break; + } + case 18: { + message.pyGenericServices = reader.bool(); + break; + } + case 42: { + message.phpGenericServices = reader.bool(); + break; + } + case 23: { + message.deprecated = reader.bool(); + break; + } + case 31: { + message.ccEnableArenas = reader.bool(); + break; + } + case 36: { + message.objcClassPrefix = reader.string(); + break; + } + case 37: { + message.csharpNamespace = reader.string(); + break; + } + case 39: { + message.swiftPrefix = reader.string(); + break; + } + case 40: { + message.phpClassPrefix = reader.string(); + break; + } + case 41: { + message.phpNamespace = reader.string(); + break; + } + case 44: { + message.phpMetadataNamespace = reader.string(); + break; + } + case 45: { + message.rubyPackage = reader.string(); + break; + } + case 999: { + if (!(message.uninterpretedOption && message.uninterpretedOption.length)) + message.uninterpretedOption = []; + message.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32())); + break; + } + case 1053: { + if (!(message[".google.api.resourceDefinition"] && message[".google.api.resourceDefinition"].length)) + message[".google.api.resourceDefinition"] = []; + message[".google.api.resourceDefinition"].push($root.google.api.ResourceDescriptor.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a FileOptions message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.FileOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.FileOptions} FileOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FileOptions.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a FileOptions message. + * @function verify + * @memberof google.protobuf.FileOptions + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + FileOptions.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.javaPackage != null && message.hasOwnProperty("javaPackage")) + if (!$util.isString(message.javaPackage)) + return "javaPackage: string expected"; + if (message.javaOuterClassname != null && message.hasOwnProperty("javaOuterClassname")) + if (!$util.isString(message.javaOuterClassname)) + return "javaOuterClassname: string expected"; + if (message.javaMultipleFiles != null && message.hasOwnProperty("javaMultipleFiles")) + if (typeof message.javaMultipleFiles !== "boolean") + return "javaMultipleFiles: boolean expected"; + if (message.javaGenerateEqualsAndHash != null && message.hasOwnProperty("javaGenerateEqualsAndHash")) + if (typeof message.javaGenerateEqualsAndHash !== "boolean") + return "javaGenerateEqualsAndHash: boolean expected"; + if (message.javaStringCheckUtf8 != null && message.hasOwnProperty("javaStringCheckUtf8")) + if (typeof message.javaStringCheckUtf8 !== "boolean") + return "javaStringCheckUtf8: boolean expected"; + if (message.optimizeFor != null && message.hasOwnProperty("optimizeFor")) + switch (message.optimizeFor) { + default: + return "optimizeFor: enum value expected"; + case 1: + case 2: + case 3: + break; + } + if (message.goPackage != null && message.hasOwnProperty("goPackage")) + if (!$util.isString(message.goPackage)) + return "goPackage: string expected"; + if (message.ccGenericServices != null && message.hasOwnProperty("ccGenericServices")) + if (typeof message.ccGenericServices !== "boolean") + return "ccGenericServices: boolean expected"; + if (message.javaGenericServices != null && message.hasOwnProperty("javaGenericServices")) + if (typeof message.javaGenericServices !== "boolean") + return "javaGenericServices: boolean expected"; + if (message.pyGenericServices != null && message.hasOwnProperty("pyGenericServices")) + if (typeof message.pyGenericServices !== "boolean") + return "pyGenericServices: boolean expected"; + if (message.phpGenericServices != null && message.hasOwnProperty("phpGenericServices")) + if (typeof message.phpGenericServices !== "boolean") + return "phpGenericServices: boolean expected"; + if (message.deprecated != null && message.hasOwnProperty("deprecated")) + if (typeof message.deprecated !== "boolean") + return "deprecated: boolean expected"; + if (message.ccEnableArenas != null && message.hasOwnProperty("ccEnableArenas")) + if (typeof message.ccEnableArenas !== "boolean") + return "ccEnableArenas: boolean expected"; + if (message.objcClassPrefix != null && message.hasOwnProperty("objcClassPrefix")) + if (!$util.isString(message.objcClassPrefix)) + return "objcClassPrefix: string expected"; + if (message.csharpNamespace != null && message.hasOwnProperty("csharpNamespace")) + if (!$util.isString(message.csharpNamespace)) + return "csharpNamespace: string expected"; + if (message.swiftPrefix != null && message.hasOwnProperty("swiftPrefix")) + if (!$util.isString(message.swiftPrefix)) + return "swiftPrefix: string expected"; + if (message.phpClassPrefix != null && message.hasOwnProperty("phpClassPrefix")) + if (!$util.isString(message.phpClassPrefix)) + return "phpClassPrefix: string expected"; + if (message.phpNamespace != null && message.hasOwnProperty("phpNamespace")) + if (!$util.isString(message.phpNamespace)) + return "phpNamespace: string expected"; + if (message.phpMetadataNamespace != null && message.hasOwnProperty("phpMetadataNamespace")) + if (!$util.isString(message.phpMetadataNamespace)) + return "phpMetadataNamespace: string expected"; + if (message.rubyPackage != null && message.hasOwnProperty("rubyPackage")) + if (!$util.isString(message.rubyPackage)) + return "rubyPackage: string expected"; + if (message.uninterpretedOption != null && message.hasOwnProperty("uninterpretedOption")) { + if (!Array.isArray(message.uninterpretedOption)) + return "uninterpretedOption: array expected"; + for (var i = 0; i < message.uninterpretedOption.length; ++i) { + var error = $root.google.protobuf.UninterpretedOption.verify(message.uninterpretedOption[i]); + if (error) + return "uninterpretedOption." + error; + } + } + if (message[".google.api.resourceDefinition"] != null && message.hasOwnProperty(".google.api.resourceDefinition")) { + if (!Array.isArray(message[".google.api.resourceDefinition"])) + return ".google.api.resourceDefinition: array expected"; + for (var i = 0; i < message[".google.api.resourceDefinition"].length; ++i) { + var error = $root.google.api.ResourceDescriptor.verify(message[".google.api.resourceDefinition"][i]); + if (error) + return ".google.api.resourceDefinition." + error; + } + } + return null; + }; + + /** + * Creates a FileOptions message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.FileOptions + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.FileOptions} FileOptions + */ + FileOptions.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.FileOptions) + return object; + var message = new $root.google.protobuf.FileOptions(); + if (object.javaPackage != null) + message.javaPackage = String(object.javaPackage); + if (object.javaOuterClassname != null) + message.javaOuterClassname = String(object.javaOuterClassname); + if (object.javaMultipleFiles != null) + message.javaMultipleFiles = Boolean(object.javaMultipleFiles); + if (object.javaGenerateEqualsAndHash != null) + message.javaGenerateEqualsAndHash = Boolean(object.javaGenerateEqualsAndHash); + if (object.javaStringCheckUtf8 != null) + message.javaStringCheckUtf8 = Boolean(object.javaStringCheckUtf8); + switch (object.optimizeFor) { + default: + if (typeof object.optimizeFor === "number") { + message.optimizeFor = object.optimizeFor; + break; + } + break; + case "SPEED": + case 1: + message.optimizeFor = 1; + break; + case "CODE_SIZE": + case 2: + message.optimizeFor = 2; + break; + case "LITE_RUNTIME": + case 3: + message.optimizeFor = 3; + break; + } + if (object.goPackage != null) + message.goPackage = String(object.goPackage); + if (object.ccGenericServices != null) + message.ccGenericServices = Boolean(object.ccGenericServices); + if (object.javaGenericServices != null) + message.javaGenericServices = Boolean(object.javaGenericServices); + if (object.pyGenericServices != null) + message.pyGenericServices = Boolean(object.pyGenericServices); + if (object.phpGenericServices != null) + message.phpGenericServices = Boolean(object.phpGenericServices); + if (object.deprecated != null) + message.deprecated = Boolean(object.deprecated); + if (object.ccEnableArenas != null) + message.ccEnableArenas = Boolean(object.ccEnableArenas); + if (object.objcClassPrefix != null) + message.objcClassPrefix = String(object.objcClassPrefix); + if (object.csharpNamespace != null) + message.csharpNamespace = String(object.csharpNamespace); + if (object.swiftPrefix != null) + message.swiftPrefix = String(object.swiftPrefix); + if (object.phpClassPrefix != null) + message.phpClassPrefix = String(object.phpClassPrefix); + if (object.phpNamespace != null) + message.phpNamespace = String(object.phpNamespace); + if (object.phpMetadataNamespace != null) + message.phpMetadataNamespace = String(object.phpMetadataNamespace); + if (object.rubyPackage != null) + message.rubyPackage = String(object.rubyPackage); + if (object.uninterpretedOption) { + if (!Array.isArray(object.uninterpretedOption)) + throw TypeError(".google.protobuf.FileOptions.uninterpretedOption: array expected"); + message.uninterpretedOption = []; + for (var i = 0; i < object.uninterpretedOption.length; ++i) { + if (typeof object.uninterpretedOption[i] !== "object") + throw TypeError(".google.protobuf.FileOptions.uninterpretedOption: object expected"); + message.uninterpretedOption[i] = $root.google.protobuf.UninterpretedOption.fromObject(object.uninterpretedOption[i]); + } + } + if (object[".google.api.resourceDefinition"]) { + if (!Array.isArray(object[".google.api.resourceDefinition"])) + throw TypeError(".google.protobuf.FileOptions..google.api.resourceDefinition: array expected"); + message[".google.api.resourceDefinition"] = []; + for (var i = 0; i < object[".google.api.resourceDefinition"].length; ++i) { + if (typeof object[".google.api.resourceDefinition"][i] !== "object") + throw TypeError(".google.protobuf.FileOptions..google.api.resourceDefinition: object expected"); + message[".google.api.resourceDefinition"][i] = $root.google.api.ResourceDescriptor.fromObject(object[".google.api.resourceDefinition"][i]); + } + } + return message; + }; + + /** + * Creates a plain object from a FileOptions message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.FileOptions + * @static + * @param {google.protobuf.FileOptions} message FileOptions + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + FileOptions.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.uninterpretedOption = []; + object[".google.api.resourceDefinition"] = []; + } + if (options.defaults) { + object.javaPackage = ""; + object.javaOuterClassname = ""; + object.optimizeFor = options.enums === String ? "SPEED" : 1; + object.javaMultipleFiles = false; + object.goPackage = ""; + object.ccGenericServices = false; + object.javaGenericServices = false; + object.pyGenericServices = false; + object.javaGenerateEqualsAndHash = false; + object.deprecated = false; + object.javaStringCheckUtf8 = false; + object.ccEnableArenas = true; + object.objcClassPrefix = ""; + object.csharpNamespace = ""; + object.swiftPrefix = ""; + object.phpClassPrefix = ""; + object.phpNamespace = ""; + object.phpGenericServices = false; + object.phpMetadataNamespace = ""; + object.rubyPackage = ""; + } + if (message.javaPackage != null && message.hasOwnProperty("javaPackage")) + object.javaPackage = message.javaPackage; + if (message.javaOuterClassname != null && message.hasOwnProperty("javaOuterClassname")) + object.javaOuterClassname = message.javaOuterClassname; + if (message.optimizeFor != null && message.hasOwnProperty("optimizeFor")) + object.optimizeFor = options.enums === String ? $root.google.protobuf.FileOptions.OptimizeMode[message.optimizeFor] === undefined ? message.optimizeFor : $root.google.protobuf.FileOptions.OptimizeMode[message.optimizeFor] : message.optimizeFor; + if (message.javaMultipleFiles != null && message.hasOwnProperty("javaMultipleFiles")) + object.javaMultipleFiles = message.javaMultipleFiles; + if (message.goPackage != null && message.hasOwnProperty("goPackage")) + object.goPackage = message.goPackage; + if (message.ccGenericServices != null && message.hasOwnProperty("ccGenericServices")) + object.ccGenericServices = message.ccGenericServices; + if (message.javaGenericServices != null && message.hasOwnProperty("javaGenericServices")) + object.javaGenericServices = message.javaGenericServices; + if (message.pyGenericServices != null && message.hasOwnProperty("pyGenericServices")) + object.pyGenericServices = message.pyGenericServices; + if (message.javaGenerateEqualsAndHash != null && message.hasOwnProperty("javaGenerateEqualsAndHash")) + object.javaGenerateEqualsAndHash = message.javaGenerateEqualsAndHash; + if (message.deprecated != null && message.hasOwnProperty("deprecated")) + object.deprecated = message.deprecated; + if (message.javaStringCheckUtf8 != null && message.hasOwnProperty("javaStringCheckUtf8")) + object.javaStringCheckUtf8 = message.javaStringCheckUtf8; + if (message.ccEnableArenas != null && message.hasOwnProperty("ccEnableArenas")) + object.ccEnableArenas = message.ccEnableArenas; + if (message.objcClassPrefix != null && message.hasOwnProperty("objcClassPrefix")) + object.objcClassPrefix = message.objcClassPrefix; + if (message.csharpNamespace != null && message.hasOwnProperty("csharpNamespace")) + object.csharpNamespace = message.csharpNamespace; + if (message.swiftPrefix != null && message.hasOwnProperty("swiftPrefix")) + object.swiftPrefix = message.swiftPrefix; + if (message.phpClassPrefix != null && message.hasOwnProperty("phpClassPrefix")) + object.phpClassPrefix = message.phpClassPrefix; + if (message.phpNamespace != null && message.hasOwnProperty("phpNamespace")) + object.phpNamespace = message.phpNamespace; + if (message.phpGenericServices != null && message.hasOwnProperty("phpGenericServices")) + object.phpGenericServices = message.phpGenericServices; + if (message.phpMetadataNamespace != null && message.hasOwnProperty("phpMetadataNamespace")) + object.phpMetadataNamespace = message.phpMetadataNamespace; + if (message.rubyPackage != null && message.hasOwnProperty("rubyPackage")) + object.rubyPackage = message.rubyPackage; + if (message.uninterpretedOption && message.uninterpretedOption.length) { + object.uninterpretedOption = []; + for (var j = 0; j < message.uninterpretedOption.length; ++j) + object.uninterpretedOption[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpretedOption[j], options); + } + if (message[".google.api.resourceDefinition"] && message[".google.api.resourceDefinition"].length) { + object[".google.api.resourceDefinition"] = []; + for (var j = 0; j < message[".google.api.resourceDefinition"].length; ++j) + object[".google.api.resourceDefinition"][j] = $root.google.api.ResourceDescriptor.toObject(message[".google.api.resourceDefinition"][j], options); + } + return object; + }; + + /** + * Converts this FileOptions to JSON. + * @function toJSON + * @memberof google.protobuf.FileOptions + * @instance + * @returns {Object.} JSON object + */ + FileOptions.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for FileOptions + * @function getTypeUrl + * @memberof google.protobuf.FileOptions + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FileOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.FileOptions"; + }; + + /** + * OptimizeMode enum. + * @name google.protobuf.FileOptions.OptimizeMode + * @enum {number} + * @property {number} SPEED=1 SPEED value + * @property {number} CODE_SIZE=2 CODE_SIZE value + * @property {number} LITE_RUNTIME=3 LITE_RUNTIME value + */ + FileOptions.OptimizeMode = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[1] = "SPEED"] = 1; + values[valuesById[2] = "CODE_SIZE"] = 2; + values[valuesById[3] = "LITE_RUNTIME"] = 3; + return values; + })(); + + return FileOptions; + })(); + + protobuf.MessageOptions = (function() { + + /** + * Properties of a MessageOptions. + * @memberof google.protobuf + * @interface IMessageOptions + * @property {boolean|null} [messageSetWireFormat] MessageOptions messageSetWireFormat + * @property {boolean|null} [noStandardDescriptorAccessor] MessageOptions noStandardDescriptorAccessor + * @property {boolean|null} [deprecated] MessageOptions deprecated + * @property {boolean|null} [mapEntry] MessageOptions mapEntry + * @property {Array.|null} [uninterpretedOption] MessageOptions uninterpretedOption + * @property {google.api.IResourceDescriptor|null} [".google.api.resource"] MessageOptions .google.api.resource + */ + + /** + * Constructs a new MessageOptions. + * @memberof google.protobuf + * @classdesc Represents a MessageOptions. + * @implements IMessageOptions + * @constructor + * @param {google.protobuf.IMessageOptions=} [properties] Properties to set + */ + function MessageOptions(properties) { + this.uninterpretedOption = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * MessageOptions messageSetWireFormat. + * @member {boolean} messageSetWireFormat + * @memberof google.protobuf.MessageOptions + * @instance + */ + MessageOptions.prototype.messageSetWireFormat = false; + + /** + * MessageOptions noStandardDescriptorAccessor. + * @member {boolean} noStandardDescriptorAccessor + * @memberof google.protobuf.MessageOptions + * @instance + */ + MessageOptions.prototype.noStandardDescriptorAccessor = false; + + /** + * MessageOptions deprecated. + * @member {boolean} deprecated + * @memberof google.protobuf.MessageOptions + * @instance + */ + MessageOptions.prototype.deprecated = false; + + /** + * MessageOptions mapEntry. + * @member {boolean} mapEntry + * @memberof google.protobuf.MessageOptions + * @instance + */ + MessageOptions.prototype.mapEntry = false; + + /** + * MessageOptions uninterpretedOption. + * @member {Array.} uninterpretedOption + * @memberof google.protobuf.MessageOptions + * @instance + */ + MessageOptions.prototype.uninterpretedOption = $util.emptyArray; + + /** + * MessageOptions .google.api.resource. + * @member {google.api.IResourceDescriptor|null|undefined} .google.api.resource + * @memberof google.protobuf.MessageOptions + * @instance + */ + MessageOptions.prototype[".google.api.resource"] = null; + + /** + * Creates a new MessageOptions instance using the specified properties. + * @function create + * @memberof google.protobuf.MessageOptions + * @static + * @param {google.protobuf.IMessageOptions=} [properties] Properties to set + * @returns {google.protobuf.MessageOptions} MessageOptions instance + */ + MessageOptions.create = function create(properties) { + return new MessageOptions(properties); + }; + + /** + * Encodes the specified MessageOptions message. Does not implicitly {@link google.protobuf.MessageOptions.verify|verify} messages. + * @function encode + * @memberof google.protobuf.MessageOptions + * @static + * @param {google.protobuf.IMessageOptions} message MessageOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MessageOptions.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.messageSetWireFormat != null && Object.hasOwnProperty.call(message, "messageSetWireFormat")) + writer.uint32(/* id 1, wireType 0 =*/8).bool(message.messageSetWireFormat); + if (message.noStandardDescriptorAccessor != null && Object.hasOwnProperty.call(message, "noStandardDescriptorAccessor")) + writer.uint32(/* id 2, wireType 0 =*/16).bool(message.noStandardDescriptorAccessor); + if (message.deprecated != null && Object.hasOwnProperty.call(message, "deprecated")) + writer.uint32(/* id 3, wireType 0 =*/24).bool(message.deprecated); + if (message.mapEntry != null && Object.hasOwnProperty.call(message, "mapEntry")) + writer.uint32(/* id 7, wireType 0 =*/56).bool(message.mapEntry); + if (message.uninterpretedOption != null && message.uninterpretedOption.length) + for (var i = 0; i < message.uninterpretedOption.length; ++i) + $root.google.protobuf.UninterpretedOption.encode(message.uninterpretedOption[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork()).ldelim(); + if (message[".google.api.resource"] != null && Object.hasOwnProperty.call(message, ".google.api.resource")) + $root.google.api.ResourceDescriptor.encode(message[".google.api.resource"], writer.uint32(/* id 1053, wireType 2 =*/8426).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified MessageOptions message, length delimited. Does not implicitly {@link google.protobuf.MessageOptions.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.MessageOptions + * @static + * @param {google.protobuf.IMessageOptions} message MessageOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MessageOptions.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a MessageOptions message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.MessageOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.MessageOptions} MessageOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MessageOptions.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.MessageOptions(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.messageSetWireFormat = reader.bool(); + break; + } + case 2: { + message.noStandardDescriptorAccessor = reader.bool(); + break; + } + case 3: { + message.deprecated = reader.bool(); + break; + } + case 7: { + message.mapEntry = reader.bool(); + break; + } + case 999: { + if (!(message.uninterpretedOption && message.uninterpretedOption.length)) + message.uninterpretedOption = []; + message.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32())); + break; + } + case 1053: { + message[".google.api.resource"] = $root.google.api.ResourceDescriptor.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a MessageOptions message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.MessageOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.MessageOptions} MessageOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MessageOptions.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a MessageOptions message. + * @function verify + * @memberof google.protobuf.MessageOptions + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + MessageOptions.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.messageSetWireFormat != null && message.hasOwnProperty("messageSetWireFormat")) + if (typeof message.messageSetWireFormat !== "boolean") + return "messageSetWireFormat: boolean expected"; + if (message.noStandardDescriptorAccessor != null && message.hasOwnProperty("noStandardDescriptorAccessor")) + if (typeof message.noStandardDescriptorAccessor !== "boolean") + return "noStandardDescriptorAccessor: boolean expected"; + if (message.deprecated != null && message.hasOwnProperty("deprecated")) + if (typeof message.deprecated !== "boolean") + return "deprecated: boolean expected"; + if (message.mapEntry != null && message.hasOwnProperty("mapEntry")) + if (typeof message.mapEntry !== "boolean") + return "mapEntry: boolean expected"; + if (message.uninterpretedOption != null && message.hasOwnProperty("uninterpretedOption")) { + if (!Array.isArray(message.uninterpretedOption)) + return "uninterpretedOption: array expected"; + for (var i = 0; i < message.uninterpretedOption.length; ++i) { + var error = $root.google.protobuf.UninterpretedOption.verify(message.uninterpretedOption[i]); + if (error) + return "uninterpretedOption." + error; + } + } + if (message[".google.api.resource"] != null && message.hasOwnProperty(".google.api.resource")) { + var error = $root.google.api.ResourceDescriptor.verify(message[".google.api.resource"]); + if (error) + return ".google.api.resource." + error; + } + return null; + }; + + /** + * Creates a MessageOptions message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.MessageOptions + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.MessageOptions} MessageOptions + */ + MessageOptions.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.MessageOptions) + return object; + var message = new $root.google.protobuf.MessageOptions(); + if (object.messageSetWireFormat != null) + message.messageSetWireFormat = Boolean(object.messageSetWireFormat); + if (object.noStandardDescriptorAccessor != null) + message.noStandardDescriptorAccessor = Boolean(object.noStandardDescriptorAccessor); + if (object.deprecated != null) + message.deprecated = Boolean(object.deprecated); + if (object.mapEntry != null) + message.mapEntry = Boolean(object.mapEntry); + if (object.uninterpretedOption) { + if (!Array.isArray(object.uninterpretedOption)) + throw TypeError(".google.protobuf.MessageOptions.uninterpretedOption: array expected"); + message.uninterpretedOption = []; + for (var i = 0; i < object.uninterpretedOption.length; ++i) { + if (typeof object.uninterpretedOption[i] !== "object") + throw TypeError(".google.protobuf.MessageOptions.uninterpretedOption: object expected"); + message.uninterpretedOption[i] = $root.google.protobuf.UninterpretedOption.fromObject(object.uninterpretedOption[i]); + } + } + if (object[".google.api.resource"] != null) { + if (typeof object[".google.api.resource"] !== "object") + throw TypeError(".google.protobuf.MessageOptions..google.api.resource: object expected"); + message[".google.api.resource"] = $root.google.api.ResourceDescriptor.fromObject(object[".google.api.resource"]); + } + return message; + }; + + /** + * Creates a plain object from a MessageOptions message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.MessageOptions + * @static + * @param {google.protobuf.MessageOptions} message MessageOptions + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + MessageOptions.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.uninterpretedOption = []; + if (options.defaults) { + object.messageSetWireFormat = false; + object.noStandardDescriptorAccessor = false; + object.deprecated = false; + object.mapEntry = false; + object[".google.api.resource"] = null; + } + if (message.messageSetWireFormat != null && message.hasOwnProperty("messageSetWireFormat")) + object.messageSetWireFormat = message.messageSetWireFormat; + if (message.noStandardDescriptorAccessor != null && message.hasOwnProperty("noStandardDescriptorAccessor")) + object.noStandardDescriptorAccessor = message.noStandardDescriptorAccessor; + if (message.deprecated != null && message.hasOwnProperty("deprecated")) + object.deprecated = message.deprecated; + if (message.mapEntry != null && message.hasOwnProperty("mapEntry")) + object.mapEntry = message.mapEntry; + if (message.uninterpretedOption && message.uninterpretedOption.length) { + object.uninterpretedOption = []; + for (var j = 0; j < message.uninterpretedOption.length; ++j) + object.uninterpretedOption[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpretedOption[j], options); + } + if (message[".google.api.resource"] != null && message.hasOwnProperty(".google.api.resource")) + object[".google.api.resource"] = $root.google.api.ResourceDescriptor.toObject(message[".google.api.resource"], options); + return object; + }; + + /** + * Converts this MessageOptions to JSON. + * @function toJSON + * @memberof google.protobuf.MessageOptions + * @instance + * @returns {Object.} JSON object + */ + MessageOptions.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for MessageOptions + * @function getTypeUrl + * @memberof google.protobuf.MessageOptions + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + MessageOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.MessageOptions"; + }; + + return MessageOptions; + })(); + + protobuf.FieldOptions = (function() { + + /** + * Properties of a FieldOptions. + * @memberof google.protobuf + * @interface IFieldOptions + * @property {google.protobuf.FieldOptions.CType|null} [ctype] FieldOptions ctype + * @property {boolean|null} [packed] FieldOptions packed + * @property {google.protobuf.FieldOptions.JSType|null} [jstype] FieldOptions jstype + * @property {boolean|null} [lazy] FieldOptions lazy + * @property {boolean|null} [unverifiedLazy] FieldOptions unverifiedLazy + * @property {boolean|null} [deprecated] FieldOptions deprecated + * @property {boolean|null} [weak] FieldOptions weak + * @property {Array.|null} [uninterpretedOption] FieldOptions uninterpretedOption + * @property {Array.|null} [".google.api.fieldBehavior"] FieldOptions .google.api.fieldBehavior + * @property {google.api.IResourceReference|null} [".google.api.resourceReference"] FieldOptions .google.api.resourceReference + */ + + /** + * Constructs a new FieldOptions. + * @memberof google.protobuf + * @classdesc Represents a FieldOptions. + * @implements IFieldOptions + * @constructor + * @param {google.protobuf.IFieldOptions=} [properties] Properties to set + */ + function FieldOptions(properties) { + this.uninterpretedOption = []; + this[".google.api.fieldBehavior"] = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * FieldOptions ctype. + * @member {google.protobuf.FieldOptions.CType} ctype + * @memberof google.protobuf.FieldOptions + * @instance + */ + FieldOptions.prototype.ctype = 0; + + /** + * FieldOptions packed. + * @member {boolean} packed + * @memberof google.protobuf.FieldOptions + * @instance + */ + FieldOptions.prototype.packed = false; + + /** + * FieldOptions jstype. + * @member {google.protobuf.FieldOptions.JSType} jstype + * @memberof google.protobuf.FieldOptions + * @instance + */ + FieldOptions.prototype.jstype = 0; + + /** + * FieldOptions lazy. + * @member {boolean} lazy + * @memberof google.protobuf.FieldOptions + * @instance + */ + FieldOptions.prototype.lazy = false; + + /** + * FieldOptions unverifiedLazy. + * @member {boolean} unverifiedLazy + * @memberof google.protobuf.FieldOptions + * @instance + */ + FieldOptions.prototype.unverifiedLazy = false; + + /** + * FieldOptions deprecated. + * @member {boolean} deprecated + * @memberof google.protobuf.FieldOptions + * @instance + */ + FieldOptions.prototype.deprecated = false; + + /** + * FieldOptions weak. + * @member {boolean} weak + * @memberof google.protobuf.FieldOptions + * @instance + */ + FieldOptions.prototype.weak = false; + + /** + * FieldOptions uninterpretedOption. + * @member {Array.} uninterpretedOption + * @memberof google.protobuf.FieldOptions + * @instance + */ + FieldOptions.prototype.uninterpretedOption = $util.emptyArray; + + /** + * FieldOptions .google.api.fieldBehavior. + * @member {Array.} .google.api.fieldBehavior + * @memberof google.protobuf.FieldOptions + * @instance + */ + FieldOptions.prototype[".google.api.fieldBehavior"] = $util.emptyArray; + + /** + * FieldOptions .google.api.resourceReference. + * @member {google.api.IResourceReference|null|undefined} .google.api.resourceReference + * @memberof google.protobuf.FieldOptions + * @instance + */ + FieldOptions.prototype[".google.api.resourceReference"] = null; + + /** + * Creates a new FieldOptions instance using the specified properties. + * @function create + * @memberof google.protobuf.FieldOptions + * @static + * @param {google.protobuf.IFieldOptions=} [properties] Properties to set + * @returns {google.protobuf.FieldOptions} FieldOptions instance + */ + FieldOptions.create = function create(properties) { + return new FieldOptions(properties); + }; + + /** + * Encodes the specified FieldOptions message. Does not implicitly {@link google.protobuf.FieldOptions.verify|verify} messages. + * @function encode + * @memberof google.protobuf.FieldOptions + * @static + * @param {google.protobuf.IFieldOptions} message FieldOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FieldOptions.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.ctype != null && Object.hasOwnProperty.call(message, "ctype")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.ctype); + if (message.packed != null && Object.hasOwnProperty.call(message, "packed")) + writer.uint32(/* id 2, wireType 0 =*/16).bool(message.packed); + if (message.deprecated != null && Object.hasOwnProperty.call(message, "deprecated")) + writer.uint32(/* id 3, wireType 0 =*/24).bool(message.deprecated); + if (message.lazy != null && Object.hasOwnProperty.call(message, "lazy")) + writer.uint32(/* id 5, wireType 0 =*/40).bool(message.lazy); + if (message.jstype != null && Object.hasOwnProperty.call(message, "jstype")) + writer.uint32(/* id 6, wireType 0 =*/48).int32(message.jstype); + if (message.weak != null && Object.hasOwnProperty.call(message, "weak")) + writer.uint32(/* id 10, wireType 0 =*/80).bool(message.weak); + if (message.unverifiedLazy != null && Object.hasOwnProperty.call(message, "unverifiedLazy")) + writer.uint32(/* id 15, wireType 0 =*/120).bool(message.unverifiedLazy); + if (message.uninterpretedOption != null && message.uninterpretedOption.length) + for (var i = 0; i < message.uninterpretedOption.length; ++i) + $root.google.protobuf.UninterpretedOption.encode(message.uninterpretedOption[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork()).ldelim(); + if (message[".google.api.fieldBehavior"] != null && message[".google.api.fieldBehavior"].length) { + writer.uint32(/* id 1052, wireType 2 =*/8418).fork(); + for (var i = 0; i < message[".google.api.fieldBehavior"].length; ++i) + writer.int32(message[".google.api.fieldBehavior"][i]); + writer.ldelim(); + } + if (message[".google.api.resourceReference"] != null && Object.hasOwnProperty.call(message, ".google.api.resourceReference")) + $root.google.api.ResourceReference.encode(message[".google.api.resourceReference"], writer.uint32(/* id 1055, wireType 2 =*/8442).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified FieldOptions message, length delimited. Does not implicitly {@link google.protobuf.FieldOptions.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.FieldOptions + * @static + * @param {google.protobuf.IFieldOptions} message FieldOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FieldOptions.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a FieldOptions message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.FieldOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.FieldOptions} FieldOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FieldOptions.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.FieldOptions(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.ctype = reader.int32(); + break; + } + case 2: { + message.packed = reader.bool(); + break; + } + case 6: { + message.jstype = reader.int32(); + break; + } + case 5: { + message.lazy = reader.bool(); + break; + } + case 15: { + message.unverifiedLazy = reader.bool(); + break; + } + case 3: { + message.deprecated = reader.bool(); + break; + } + case 10: { + message.weak = reader.bool(); + break; + } + case 999: { + if (!(message.uninterpretedOption && message.uninterpretedOption.length)) + message.uninterpretedOption = []; + message.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32())); + break; + } + case 1052: { + if (!(message[".google.api.fieldBehavior"] && message[".google.api.fieldBehavior"].length)) + message[".google.api.fieldBehavior"] = []; + if ((tag & 7) === 2) { + var end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) + message[".google.api.fieldBehavior"].push(reader.int32()); + } else + message[".google.api.fieldBehavior"].push(reader.int32()); + break; + } + case 1055: { + message[".google.api.resourceReference"] = $root.google.api.ResourceReference.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a FieldOptions message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.FieldOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.FieldOptions} FieldOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FieldOptions.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a FieldOptions message. + * @function verify + * @memberof google.protobuf.FieldOptions + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + FieldOptions.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.ctype != null && message.hasOwnProperty("ctype")) + switch (message.ctype) { + default: + return "ctype: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.packed != null && message.hasOwnProperty("packed")) + if (typeof message.packed !== "boolean") + return "packed: boolean expected"; + if (message.jstype != null && message.hasOwnProperty("jstype")) + switch (message.jstype) { + default: + return "jstype: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.lazy != null && message.hasOwnProperty("lazy")) + if (typeof message.lazy !== "boolean") + return "lazy: boolean expected"; + if (message.unverifiedLazy != null && message.hasOwnProperty("unverifiedLazy")) + if (typeof message.unverifiedLazy !== "boolean") + return "unverifiedLazy: boolean expected"; + if (message.deprecated != null && message.hasOwnProperty("deprecated")) + if (typeof message.deprecated !== "boolean") + return "deprecated: boolean expected"; + if (message.weak != null && message.hasOwnProperty("weak")) + if (typeof message.weak !== "boolean") + return "weak: boolean expected"; + if (message.uninterpretedOption != null && message.hasOwnProperty("uninterpretedOption")) { + if (!Array.isArray(message.uninterpretedOption)) + return "uninterpretedOption: array expected"; + for (var i = 0; i < message.uninterpretedOption.length; ++i) { + var error = $root.google.protobuf.UninterpretedOption.verify(message.uninterpretedOption[i]); + if (error) + return "uninterpretedOption." + error; + } + } + if (message[".google.api.fieldBehavior"] != null && message.hasOwnProperty(".google.api.fieldBehavior")) { + if (!Array.isArray(message[".google.api.fieldBehavior"])) + return ".google.api.fieldBehavior: array expected"; + for (var i = 0; i < message[".google.api.fieldBehavior"].length; ++i) + switch (message[".google.api.fieldBehavior"][i]) { + default: + return ".google.api.fieldBehavior: enum value[] expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + case 5: + case 6: + case 7: + break; + } + } + if (message[".google.api.resourceReference"] != null && message.hasOwnProperty(".google.api.resourceReference")) { + var error = $root.google.api.ResourceReference.verify(message[".google.api.resourceReference"]); + if (error) + return ".google.api.resourceReference." + error; + } + return null; + }; + + /** + * Creates a FieldOptions message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.FieldOptions + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.FieldOptions} FieldOptions + */ + FieldOptions.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.FieldOptions) + return object; + var message = new $root.google.protobuf.FieldOptions(); + switch (object.ctype) { + default: + if (typeof object.ctype === "number") { + message.ctype = object.ctype; + break; + } + break; + case "STRING": + case 0: + message.ctype = 0; + break; + case "CORD": + case 1: + message.ctype = 1; + break; + case "STRING_PIECE": + case 2: + message.ctype = 2; + break; + } + if (object.packed != null) + message.packed = Boolean(object.packed); + switch (object.jstype) { + default: + if (typeof object.jstype === "number") { + message.jstype = object.jstype; + break; + } + break; + case "JS_NORMAL": + case 0: + message.jstype = 0; + break; + case "JS_STRING": + case 1: + message.jstype = 1; + break; + case "JS_NUMBER": + case 2: + message.jstype = 2; + break; + } + if (object.lazy != null) + message.lazy = Boolean(object.lazy); + if (object.unverifiedLazy != null) + message.unverifiedLazy = Boolean(object.unverifiedLazy); + if (object.deprecated != null) + message.deprecated = Boolean(object.deprecated); + if (object.weak != null) + message.weak = Boolean(object.weak); + if (object.uninterpretedOption) { + if (!Array.isArray(object.uninterpretedOption)) + throw TypeError(".google.protobuf.FieldOptions.uninterpretedOption: array expected"); + message.uninterpretedOption = []; + for (var i = 0; i < object.uninterpretedOption.length; ++i) { + if (typeof object.uninterpretedOption[i] !== "object") + throw TypeError(".google.protobuf.FieldOptions.uninterpretedOption: object expected"); + message.uninterpretedOption[i] = $root.google.protobuf.UninterpretedOption.fromObject(object.uninterpretedOption[i]); + } + } + if (object[".google.api.fieldBehavior"]) { + if (!Array.isArray(object[".google.api.fieldBehavior"])) + throw TypeError(".google.protobuf.FieldOptions..google.api.fieldBehavior: array expected"); + message[".google.api.fieldBehavior"] = []; + for (var i = 0; i < object[".google.api.fieldBehavior"].length; ++i) + switch (object[".google.api.fieldBehavior"][i]) { + default: + if (typeof object[".google.api.fieldBehavior"][i] === "number") { + message[".google.api.fieldBehavior"][i] = object[".google.api.fieldBehavior"][i]; + break; + } + case "FIELD_BEHAVIOR_UNSPECIFIED": + case 0: + message[".google.api.fieldBehavior"][i] = 0; + break; + case "OPTIONAL": + case 1: + message[".google.api.fieldBehavior"][i] = 1; + break; + case "REQUIRED": + case 2: + message[".google.api.fieldBehavior"][i] = 2; + break; + case "OUTPUT_ONLY": + case 3: + message[".google.api.fieldBehavior"][i] = 3; + break; + case "INPUT_ONLY": + case 4: + message[".google.api.fieldBehavior"][i] = 4; + break; + case "IMMUTABLE": + case 5: + message[".google.api.fieldBehavior"][i] = 5; + break; + case "UNORDERED_LIST": + case 6: + message[".google.api.fieldBehavior"][i] = 6; + break; + case "NON_EMPTY_DEFAULT": + case 7: + message[".google.api.fieldBehavior"][i] = 7; + break; + } + } + if (object[".google.api.resourceReference"] != null) { + if (typeof object[".google.api.resourceReference"] !== "object") + throw TypeError(".google.protobuf.FieldOptions..google.api.resourceReference: object expected"); + message[".google.api.resourceReference"] = $root.google.api.ResourceReference.fromObject(object[".google.api.resourceReference"]); + } + return message; + }; + + /** + * Creates a plain object from a FieldOptions message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.FieldOptions + * @static + * @param {google.protobuf.FieldOptions} message FieldOptions + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + FieldOptions.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.uninterpretedOption = []; + object[".google.api.fieldBehavior"] = []; + } + if (options.defaults) { + object.ctype = options.enums === String ? "STRING" : 0; + object.packed = false; + object.deprecated = false; + object.lazy = false; + object.jstype = options.enums === String ? "JS_NORMAL" : 0; + object.weak = false; + object.unverifiedLazy = false; + object[".google.api.resourceReference"] = null; + } + if (message.ctype != null && message.hasOwnProperty("ctype")) + object.ctype = options.enums === String ? $root.google.protobuf.FieldOptions.CType[message.ctype] === undefined ? message.ctype : $root.google.protobuf.FieldOptions.CType[message.ctype] : message.ctype; + if (message.packed != null && message.hasOwnProperty("packed")) + object.packed = message.packed; + if (message.deprecated != null && message.hasOwnProperty("deprecated")) + object.deprecated = message.deprecated; + if (message.lazy != null && message.hasOwnProperty("lazy")) + object.lazy = message.lazy; + if (message.jstype != null && message.hasOwnProperty("jstype")) + object.jstype = options.enums === String ? $root.google.protobuf.FieldOptions.JSType[message.jstype] === undefined ? message.jstype : $root.google.protobuf.FieldOptions.JSType[message.jstype] : message.jstype; + if (message.weak != null && message.hasOwnProperty("weak")) + object.weak = message.weak; + if (message.unverifiedLazy != null && message.hasOwnProperty("unverifiedLazy")) + object.unverifiedLazy = message.unverifiedLazy; + if (message.uninterpretedOption && message.uninterpretedOption.length) { + object.uninterpretedOption = []; + for (var j = 0; j < message.uninterpretedOption.length; ++j) + object.uninterpretedOption[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpretedOption[j], options); + } + if (message[".google.api.fieldBehavior"] && message[".google.api.fieldBehavior"].length) { + object[".google.api.fieldBehavior"] = []; + for (var j = 0; j < message[".google.api.fieldBehavior"].length; ++j) + object[".google.api.fieldBehavior"][j] = options.enums === String ? $root.google.api.FieldBehavior[message[".google.api.fieldBehavior"][j]] === undefined ? message[".google.api.fieldBehavior"][j] : $root.google.api.FieldBehavior[message[".google.api.fieldBehavior"][j]] : message[".google.api.fieldBehavior"][j]; + } + if (message[".google.api.resourceReference"] != null && message.hasOwnProperty(".google.api.resourceReference")) + object[".google.api.resourceReference"] = $root.google.api.ResourceReference.toObject(message[".google.api.resourceReference"], options); + return object; + }; + + /** + * Converts this FieldOptions to JSON. + * @function toJSON + * @memberof google.protobuf.FieldOptions + * @instance + * @returns {Object.} JSON object + */ + FieldOptions.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for FieldOptions + * @function getTypeUrl + * @memberof google.protobuf.FieldOptions + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FieldOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.FieldOptions"; + }; + + /** + * CType enum. + * @name google.protobuf.FieldOptions.CType + * @enum {number} + * @property {number} STRING=0 STRING value + * @property {number} CORD=1 CORD value + * @property {number} STRING_PIECE=2 STRING_PIECE value + */ + FieldOptions.CType = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "STRING"] = 0; + values[valuesById[1] = "CORD"] = 1; + values[valuesById[2] = "STRING_PIECE"] = 2; + return values; + })(); + + /** + * JSType enum. + * @name google.protobuf.FieldOptions.JSType + * @enum {number} + * @property {number} JS_NORMAL=0 JS_NORMAL value + * @property {number} JS_STRING=1 JS_STRING value + * @property {number} JS_NUMBER=2 JS_NUMBER value + */ + FieldOptions.JSType = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "JS_NORMAL"] = 0; + values[valuesById[1] = "JS_STRING"] = 1; + values[valuesById[2] = "JS_NUMBER"] = 2; + return values; + })(); + + return FieldOptions; + })(); + + protobuf.OneofOptions = (function() { + + /** + * Properties of an OneofOptions. + * @memberof google.protobuf + * @interface IOneofOptions + * @property {Array.|null} [uninterpretedOption] OneofOptions uninterpretedOption + */ + + /** + * Constructs a new OneofOptions. + * @memberof google.protobuf + * @classdesc Represents an OneofOptions. + * @implements IOneofOptions + * @constructor + * @param {google.protobuf.IOneofOptions=} [properties] Properties to set + */ + function OneofOptions(properties) { + this.uninterpretedOption = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * OneofOptions uninterpretedOption. + * @member {Array.} uninterpretedOption + * @memberof google.protobuf.OneofOptions + * @instance + */ + OneofOptions.prototype.uninterpretedOption = $util.emptyArray; + + /** + * Creates a new OneofOptions instance using the specified properties. + * @function create + * @memberof google.protobuf.OneofOptions + * @static + * @param {google.protobuf.IOneofOptions=} [properties] Properties to set + * @returns {google.protobuf.OneofOptions} OneofOptions instance + */ + OneofOptions.create = function create(properties) { + return new OneofOptions(properties); + }; + + /** + * Encodes the specified OneofOptions message. Does not implicitly {@link google.protobuf.OneofOptions.verify|verify} messages. + * @function encode + * @memberof google.protobuf.OneofOptions + * @static + * @param {google.protobuf.IOneofOptions} message OneofOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + OneofOptions.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.uninterpretedOption != null && message.uninterpretedOption.length) + for (var i = 0; i < message.uninterpretedOption.length; ++i) + $root.google.protobuf.UninterpretedOption.encode(message.uninterpretedOption[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified OneofOptions message, length delimited. Does not implicitly {@link google.protobuf.OneofOptions.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.OneofOptions + * @static + * @param {google.protobuf.IOneofOptions} message OneofOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + OneofOptions.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an OneofOptions message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.OneofOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.OneofOptions} OneofOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + OneofOptions.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.OneofOptions(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 999: { + if (!(message.uninterpretedOption && message.uninterpretedOption.length)) + message.uninterpretedOption = []; + message.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an OneofOptions message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.OneofOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.OneofOptions} OneofOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + OneofOptions.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an OneofOptions message. + * @function verify + * @memberof google.protobuf.OneofOptions + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + OneofOptions.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.uninterpretedOption != null && message.hasOwnProperty("uninterpretedOption")) { + if (!Array.isArray(message.uninterpretedOption)) + return "uninterpretedOption: array expected"; + for (var i = 0; i < message.uninterpretedOption.length; ++i) { + var error = $root.google.protobuf.UninterpretedOption.verify(message.uninterpretedOption[i]); + if (error) + return "uninterpretedOption." + error; + } + } + return null; + }; + + /** + * Creates an OneofOptions message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.OneofOptions + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.OneofOptions} OneofOptions + */ + OneofOptions.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.OneofOptions) + return object; + var message = new $root.google.protobuf.OneofOptions(); + if (object.uninterpretedOption) { + if (!Array.isArray(object.uninterpretedOption)) + throw TypeError(".google.protobuf.OneofOptions.uninterpretedOption: array expected"); + message.uninterpretedOption = []; + for (var i = 0; i < object.uninterpretedOption.length; ++i) { + if (typeof object.uninterpretedOption[i] !== "object") + throw TypeError(".google.protobuf.OneofOptions.uninterpretedOption: object expected"); + message.uninterpretedOption[i] = $root.google.protobuf.UninterpretedOption.fromObject(object.uninterpretedOption[i]); + } + } + return message; + }; + + /** + * Creates a plain object from an OneofOptions message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.OneofOptions + * @static + * @param {google.protobuf.OneofOptions} message OneofOptions + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + OneofOptions.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.uninterpretedOption = []; + if (message.uninterpretedOption && message.uninterpretedOption.length) { + object.uninterpretedOption = []; + for (var j = 0; j < message.uninterpretedOption.length; ++j) + object.uninterpretedOption[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpretedOption[j], options); + } + return object; + }; + + /** + * Converts this OneofOptions to JSON. + * @function toJSON + * @memberof google.protobuf.OneofOptions + * @instance + * @returns {Object.} JSON object + */ + OneofOptions.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for OneofOptions + * @function getTypeUrl + * @memberof google.protobuf.OneofOptions + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + OneofOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.OneofOptions"; + }; + + return OneofOptions; + })(); + + protobuf.EnumOptions = (function() { + + /** + * Properties of an EnumOptions. + * @memberof google.protobuf + * @interface IEnumOptions + * @property {boolean|null} [allowAlias] EnumOptions allowAlias + * @property {boolean|null} [deprecated] EnumOptions deprecated + * @property {Array.|null} [uninterpretedOption] EnumOptions uninterpretedOption + */ + + /** + * Constructs a new EnumOptions. + * @memberof google.protobuf + * @classdesc Represents an EnumOptions. + * @implements IEnumOptions + * @constructor + * @param {google.protobuf.IEnumOptions=} [properties] Properties to set + */ + function EnumOptions(properties) { + this.uninterpretedOption = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * EnumOptions allowAlias. + * @member {boolean} allowAlias + * @memberof google.protobuf.EnumOptions + * @instance + */ + EnumOptions.prototype.allowAlias = false; + + /** + * EnumOptions deprecated. + * @member {boolean} deprecated + * @memberof google.protobuf.EnumOptions + * @instance + */ + EnumOptions.prototype.deprecated = false; + + /** + * EnumOptions uninterpretedOption. + * @member {Array.} uninterpretedOption + * @memberof google.protobuf.EnumOptions + * @instance + */ + EnumOptions.prototype.uninterpretedOption = $util.emptyArray; + + /** + * Creates a new EnumOptions instance using the specified properties. + * @function create + * @memberof google.protobuf.EnumOptions + * @static + * @param {google.protobuf.IEnumOptions=} [properties] Properties to set + * @returns {google.protobuf.EnumOptions} EnumOptions instance + */ + EnumOptions.create = function create(properties) { + return new EnumOptions(properties); + }; + + /** + * Encodes the specified EnumOptions message. Does not implicitly {@link google.protobuf.EnumOptions.verify|verify} messages. + * @function encode + * @memberof google.protobuf.EnumOptions + * @static + * @param {google.protobuf.IEnumOptions} message EnumOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EnumOptions.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.allowAlias != null && Object.hasOwnProperty.call(message, "allowAlias")) + writer.uint32(/* id 2, wireType 0 =*/16).bool(message.allowAlias); + if (message.deprecated != null && Object.hasOwnProperty.call(message, "deprecated")) + writer.uint32(/* id 3, wireType 0 =*/24).bool(message.deprecated); + if (message.uninterpretedOption != null && message.uninterpretedOption.length) + for (var i = 0; i < message.uninterpretedOption.length; ++i) + $root.google.protobuf.UninterpretedOption.encode(message.uninterpretedOption[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified EnumOptions message, length delimited. Does not implicitly {@link google.protobuf.EnumOptions.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.EnumOptions + * @static + * @param {google.protobuf.IEnumOptions} message EnumOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EnumOptions.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an EnumOptions message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.EnumOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.EnumOptions} EnumOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EnumOptions.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.EnumOptions(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 2: { + message.allowAlias = reader.bool(); + break; + } + case 3: { + message.deprecated = reader.bool(); + break; + } + case 999: { + if (!(message.uninterpretedOption && message.uninterpretedOption.length)) + message.uninterpretedOption = []; + message.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an EnumOptions message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.EnumOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.EnumOptions} EnumOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EnumOptions.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an EnumOptions message. + * @function verify + * @memberof google.protobuf.EnumOptions + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + EnumOptions.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.allowAlias != null && message.hasOwnProperty("allowAlias")) + if (typeof message.allowAlias !== "boolean") + return "allowAlias: boolean expected"; + if (message.deprecated != null && message.hasOwnProperty("deprecated")) + if (typeof message.deprecated !== "boolean") + return "deprecated: boolean expected"; + if (message.uninterpretedOption != null && message.hasOwnProperty("uninterpretedOption")) { + if (!Array.isArray(message.uninterpretedOption)) + return "uninterpretedOption: array expected"; + for (var i = 0; i < message.uninterpretedOption.length; ++i) { + var error = $root.google.protobuf.UninterpretedOption.verify(message.uninterpretedOption[i]); + if (error) + return "uninterpretedOption." + error; + } + } + return null; + }; + + /** + * Creates an EnumOptions message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.EnumOptions + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.EnumOptions} EnumOptions + */ + EnumOptions.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.EnumOptions) + return object; + var message = new $root.google.protobuf.EnumOptions(); + if (object.allowAlias != null) + message.allowAlias = Boolean(object.allowAlias); + if (object.deprecated != null) + message.deprecated = Boolean(object.deprecated); + if (object.uninterpretedOption) { + if (!Array.isArray(object.uninterpretedOption)) + throw TypeError(".google.protobuf.EnumOptions.uninterpretedOption: array expected"); + message.uninterpretedOption = []; + for (var i = 0; i < object.uninterpretedOption.length; ++i) { + if (typeof object.uninterpretedOption[i] !== "object") + throw TypeError(".google.protobuf.EnumOptions.uninterpretedOption: object expected"); + message.uninterpretedOption[i] = $root.google.protobuf.UninterpretedOption.fromObject(object.uninterpretedOption[i]); + } + } + return message; + }; + + /** + * Creates a plain object from an EnumOptions message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.EnumOptions + * @static + * @param {google.protobuf.EnumOptions} message EnumOptions + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + EnumOptions.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.uninterpretedOption = []; + if (options.defaults) { + object.allowAlias = false; + object.deprecated = false; + } + if (message.allowAlias != null && message.hasOwnProperty("allowAlias")) + object.allowAlias = message.allowAlias; + if (message.deprecated != null && message.hasOwnProperty("deprecated")) + object.deprecated = message.deprecated; + if (message.uninterpretedOption && message.uninterpretedOption.length) { + object.uninterpretedOption = []; + for (var j = 0; j < message.uninterpretedOption.length; ++j) + object.uninterpretedOption[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpretedOption[j], options); + } + return object; + }; + + /** + * Converts this EnumOptions to JSON. + * @function toJSON + * @memberof google.protobuf.EnumOptions + * @instance + * @returns {Object.} JSON object + */ + EnumOptions.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for EnumOptions + * @function getTypeUrl + * @memberof google.protobuf.EnumOptions + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + EnumOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.EnumOptions"; + }; + + return EnumOptions; + })(); + + protobuf.EnumValueOptions = (function() { + + /** + * Properties of an EnumValueOptions. + * @memberof google.protobuf + * @interface IEnumValueOptions + * @property {boolean|null} [deprecated] EnumValueOptions deprecated + * @property {Array.|null} [uninterpretedOption] EnumValueOptions uninterpretedOption + */ + + /** + * Constructs a new EnumValueOptions. + * @memberof google.protobuf + * @classdesc Represents an EnumValueOptions. + * @implements IEnumValueOptions + * @constructor + * @param {google.protobuf.IEnumValueOptions=} [properties] Properties to set + */ + function EnumValueOptions(properties) { + this.uninterpretedOption = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * EnumValueOptions deprecated. + * @member {boolean} deprecated + * @memberof google.protobuf.EnumValueOptions + * @instance + */ + EnumValueOptions.prototype.deprecated = false; + + /** + * EnumValueOptions uninterpretedOption. + * @member {Array.} uninterpretedOption + * @memberof google.protobuf.EnumValueOptions + * @instance + */ + EnumValueOptions.prototype.uninterpretedOption = $util.emptyArray; + + /** + * Creates a new EnumValueOptions instance using the specified properties. + * @function create + * @memberof google.protobuf.EnumValueOptions + * @static + * @param {google.protobuf.IEnumValueOptions=} [properties] Properties to set + * @returns {google.protobuf.EnumValueOptions} EnumValueOptions instance + */ + EnumValueOptions.create = function create(properties) { + return new EnumValueOptions(properties); + }; + + /** + * Encodes the specified EnumValueOptions message. Does not implicitly {@link google.protobuf.EnumValueOptions.verify|verify} messages. + * @function encode + * @memberof google.protobuf.EnumValueOptions + * @static + * @param {google.protobuf.IEnumValueOptions} message EnumValueOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EnumValueOptions.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.deprecated != null && Object.hasOwnProperty.call(message, "deprecated")) + writer.uint32(/* id 1, wireType 0 =*/8).bool(message.deprecated); + if (message.uninterpretedOption != null && message.uninterpretedOption.length) + for (var i = 0; i < message.uninterpretedOption.length; ++i) + $root.google.protobuf.UninterpretedOption.encode(message.uninterpretedOption[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified EnumValueOptions message, length delimited. Does not implicitly {@link google.protobuf.EnumValueOptions.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.EnumValueOptions + * @static + * @param {google.protobuf.IEnumValueOptions} message EnumValueOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EnumValueOptions.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an EnumValueOptions message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.EnumValueOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.EnumValueOptions} EnumValueOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EnumValueOptions.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.EnumValueOptions(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.deprecated = reader.bool(); + break; + } + case 999: { + if (!(message.uninterpretedOption && message.uninterpretedOption.length)) + message.uninterpretedOption = []; + message.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an EnumValueOptions message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.EnumValueOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.EnumValueOptions} EnumValueOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EnumValueOptions.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an EnumValueOptions message. + * @function verify + * @memberof google.protobuf.EnumValueOptions + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + EnumValueOptions.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.deprecated != null && message.hasOwnProperty("deprecated")) + if (typeof message.deprecated !== "boolean") + return "deprecated: boolean expected"; + if (message.uninterpretedOption != null && message.hasOwnProperty("uninterpretedOption")) { + if (!Array.isArray(message.uninterpretedOption)) + return "uninterpretedOption: array expected"; + for (var i = 0; i < message.uninterpretedOption.length; ++i) { + var error = $root.google.protobuf.UninterpretedOption.verify(message.uninterpretedOption[i]); + if (error) + return "uninterpretedOption." + error; + } + } + return null; + }; + + /** + * Creates an EnumValueOptions message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.EnumValueOptions + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.EnumValueOptions} EnumValueOptions + */ + EnumValueOptions.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.EnumValueOptions) + return object; + var message = new $root.google.protobuf.EnumValueOptions(); + if (object.deprecated != null) + message.deprecated = Boolean(object.deprecated); + if (object.uninterpretedOption) { + if (!Array.isArray(object.uninterpretedOption)) + throw TypeError(".google.protobuf.EnumValueOptions.uninterpretedOption: array expected"); + message.uninterpretedOption = []; + for (var i = 0; i < object.uninterpretedOption.length; ++i) { + if (typeof object.uninterpretedOption[i] !== "object") + throw TypeError(".google.protobuf.EnumValueOptions.uninterpretedOption: object expected"); + message.uninterpretedOption[i] = $root.google.protobuf.UninterpretedOption.fromObject(object.uninterpretedOption[i]); + } + } + return message; + }; + + /** + * Creates a plain object from an EnumValueOptions message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.EnumValueOptions + * @static + * @param {google.protobuf.EnumValueOptions} message EnumValueOptions + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + EnumValueOptions.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.uninterpretedOption = []; + if (options.defaults) + object.deprecated = false; + if (message.deprecated != null && message.hasOwnProperty("deprecated")) + object.deprecated = message.deprecated; + if (message.uninterpretedOption && message.uninterpretedOption.length) { + object.uninterpretedOption = []; + for (var j = 0; j < message.uninterpretedOption.length; ++j) + object.uninterpretedOption[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpretedOption[j], options); + } + return object; + }; + + /** + * Converts this EnumValueOptions to JSON. + * @function toJSON + * @memberof google.protobuf.EnumValueOptions + * @instance + * @returns {Object.} JSON object + */ + EnumValueOptions.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for EnumValueOptions + * @function getTypeUrl + * @memberof google.protobuf.EnumValueOptions + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + EnumValueOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.EnumValueOptions"; + }; + + return EnumValueOptions; + })(); + + protobuf.ServiceOptions = (function() { + + /** + * Properties of a ServiceOptions. + * @memberof google.protobuf + * @interface IServiceOptions + * @property {boolean|null} [deprecated] ServiceOptions deprecated + * @property {Array.|null} [uninterpretedOption] ServiceOptions uninterpretedOption + * @property {string|null} [".google.api.defaultHost"] ServiceOptions .google.api.defaultHost + * @property {string|null} [".google.api.oauthScopes"] ServiceOptions .google.api.oauthScopes + */ + + /** + * Constructs a new ServiceOptions. + * @memberof google.protobuf + * @classdesc Represents a ServiceOptions. + * @implements IServiceOptions + * @constructor + * @param {google.protobuf.IServiceOptions=} [properties] Properties to set + */ + function ServiceOptions(properties) { + this.uninterpretedOption = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ServiceOptions deprecated. + * @member {boolean} deprecated + * @memberof google.protobuf.ServiceOptions + * @instance + */ + ServiceOptions.prototype.deprecated = false; + + /** + * ServiceOptions uninterpretedOption. + * @member {Array.} uninterpretedOption + * @memberof google.protobuf.ServiceOptions + * @instance + */ + ServiceOptions.prototype.uninterpretedOption = $util.emptyArray; + + /** + * ServiceOptions .google.api.defaultHost. + * @member {string} .google.api.defaultHost + * @memberof google.protobuf.ServiceOptions + * @instance + */ + ServiceOptions.prototype[".google.api.defaultHost"] = ""; + + /** + * ServiceOptions .google.api.oauthScopes. + * @member {string} .google.api.oauthScopes + * @memberof google.protobuf.ServiceOptions + * @instance + */ + ServiceOptions.prototype[".google.api.oauthScopes"] = ""; + + /** + * Creates a new ServiceOptions instance using the specified properties. + * @function create + * @memberof google.protobuf.ServiceOptions + * @static + * @param {google.protobuf.IServiceOptions=} [properties] Properties to set + * @returns {google.protobuf.ServiceOptions} ServiceOptions instance + */ + ServiceOptions.create = function create(properties) { + return new ServiceOptions(properties); + }; + + /** + * Encodes the specified ServiceOptions message. Does not implicitly {@link google.protobuf.ServiceOptions.verify|verify} messages. + * @function encode + * @memberof google.protobuf.ServiceOptions + * @static + * @param {google.protobuf.IServiceOptions} message ServiceOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ServiceOptions.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.deprecated != null && Object.hasOwnProperty.call(message, "deprecated")) + writer.uint32(/* id 33, wireType 0 =*/264).bool(message.deprecated); + if (message.uninterpretedOption != null && message.uninterpretedOption.length) + for (var i = 0; i < message.uninterpretedOption.length; ++i) + $root.google.protobuf.UninterpretedOption.encode(message.uninterpretedOption[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork()).ldelim(); + if (message[".google.api.defaultHost"] != null && Object.hasOwnProperty.call(message, ".google.api.defaultHost")) + writer.uint32(/* id 1049, wireType 2 =*/8394).string(message[".google.api.defaultHost"]); + if (message[".google.api.oauthScopes"] != null && Object.hasOwnProperty.call(message, ".google.api.oauthScopes")) + writer.uint32(/* id 1050, wireType 2 =*/8402).string(message[".google.api.oauthScopes"]); + return writer; + }; + + /** + * Encodes the specified ServiceOptions message, length delimited. Does not implicitly {@link google.protobuf.ServiceOptions.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.ServiceOptions + * @static + * @param {google.protobuf.IServiceOptions} message ServiceOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ServiceOptions.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ServiceOptions message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.ServiceOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.ServiceOptions} ServiceOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ServiceOptions.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.ServiceOptions(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 33: { + message.deprecated = reader.bool(); + break; + } + case 999: { + if (!(message.uninterpretedOption && message.uninterpretedOption.length)) + message.uninterpretedOption = []; + message.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32())); + break; + } + case 1049: { + message[".google.api.defaultHost"] = reader.string(); + break; + } + case 1050: { + message[".google.api.oauthScopes"] = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ServiceOptions message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.ServiceOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.ServiceOptions} ServiceOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ServiceOptions.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ServiceOptions message. + * @function verify + * @memberof google.protobuf.ServiceOptions + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ServiceOptions.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.deprecated != null && message.hasOwnProperty("deprecated")) + if (typeof message.deprecated !== "boolean") + return "deprecated: boolean expected"; + if (message.uninterpretedOption != null && message.hasOwnProperty("uninterpretedOption")) { + if (!Array.isArray(message.uninterpretedOption)) + return "uninterpretedOption: array expected"; + for (var i = 0; i < message.uninterpretedOption.length; ++i) { + var error = $root.google.protobuf.UninterpretedOption.verify(message.uninterpretedOption[i]); + if (error) + return "uninterpretedOption." + error; + } + } + if (message[".google.api.defaultHost"] != null && message.hasOwnProperty(".google.api.defaultHost")) + if (!$util.isString(message[".google.api.defaultHost"])) + return ".google.api.defaultHost: string expected"; + if (message[".google.api.oauthScopes"] != null && message.hasOwnProperty(".google.api.oauthScopes")) + if (!$util.isString(message[".google.api.oauthScopes"])) + return ".google.api.oauthScopes: string expected"; + return null; + }; + + /** + * Creates a ServiceOptions message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.ServiceOptions + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.ServiceOptions} ServiceOptions + */ + ServiceOptions.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.ServiceOptions) + return object; + var message = new $root.google.protobuf.ServiceOptions(); + if (object.deprecated != null) + message.deprecated = Boolean(object.deprecated); + if (object.uninterpretedOption) { + if (!Array.isArray(object.uninterpretedOption)) + throw TypeError(".google.protobuf.ServiceOptions.uninterpretedOption: array expected"); + message.uninterpretedOption = []; + for (var i = 0; i < object.uninterpretedOption.length; ++i) { + if (typeof object.uninterpretedOption[i] !== "object") + throw TypeError(".google.protobuf.ServiceOptions.uninterpretedOption: object expected"); + message.uninterpretedOption[i] = $root.google.protobuf.UninterpretedOption.fromObject(object.uninterpretedOption[i]); + } + } + if (object[".google.api.defaultHost"] != null) + message[".google.api.defaultHost"] = String(object[".google.api.defaultHost"]); + if (object[".google.api.oauthScopes"] != null) + message[".google.api.oauthScopes"] = String(object[".google.api.oauthScopes"]); + return message; + }; + + /** + * Creates a plain object from a ServiceOptions message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.ServiceOptions + * @static + * @param {google.protobuf.ServiceOptions} message ServiceOptions + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ServiceOptions.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.uninterpretedOption = []; + if (options.defaults) { + object.deprecated = false; + object[".google.api.defaultHost"] = ""; + object[".google.api.oauthScopes"] = ""; + } + if (message.deprecated != null && message.hasOwnProperty("deprecated")) + object.deprecated = message.deprecated; + if (message.uninterpretedOption && message.uninterpretedOption.length) { + object.uninterpretedOption = []; + for (var j = 0; j < message.uninterpretedOption.length; ++j) + object.uninterpretedOption[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpretedOption[j], options); + } + if (message[".google.api.defaultHost"] != null && message.hasOwnProperty(".google.api.defaultHost")) + object[".google.api.defaultHost"] = message[".google.api.defaultHost"]; + if (message[".google.api.oauthScopes"] != null && message.hasOwnProperty(".google.api.oauthScopes")) + object[".google.api.oauthScopes"] = message[".google.api.oauthScopes"]; + return object; + }; + + /** + * Converts this ServiceOptions to JSON. + * @function toJSON + * @memberof google.protobuf.ServiceOptions + * @instance + * @returns {Object.} JSON object + */ + ServiceOptions.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ServiceOptions + * @function getTypeUrl + * @memberof google.protobuf.ServiceOptions + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ServiceOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.ServiceOptions"; + }; + + return ServiceOptions; + })(); + + protobuf.MethodOptions = (function() { + + /** + * Properties of a MethodOptions. + * @memberof google.protobuf + * @interface IMethodOptions + * @property {boolean|null} [deprecated] MethodOptions deprecated + * @property {google.protobuf.MethodOptions.IdempotencyLevel|null} [idempotencyLevel] MethodOptions idempotencyLevel + * @property {Array.|null} [uninterpretedOption] MethodOptions uninterpretedOption + * @property {google.api.IHttpRule|null} [".google.api.http"] MethodOptions .google.api.http + * @property {Array.|null} [".google.api.methodSignature"] MethodOptions .google.api.methodSignature + */ + + /** + * Constructs a new MethodOptions. + * @memberof google.protobuf + * @classdesc Represents a MethodOptions. + * @implements IMethodOptions + * @constructor + * @param {google.protobuf.IMethodOptions=} [properties] Properties to set + */ + function MethodOptions(properties) { + this.uninterpretedOption = []; + this[".google.api.methodSignature"] = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * MethodOptions deprecated. + * @member {boolean} deprecated + * @memberof google.protobuf.MethodOptions + * @instance + */ + MethodOptions.prototype.deprecated = false; + + /** + * MethodOptions idempotencyLevel. + * @member {google.protobuf.MethodOptions.IdempotencyLevel} idempotencyLevel + * @memberof google.protobuf.MethodOptions + * @instance + */ + MethodOptions.prototype.idempotencyLevel = 0; + + /** + * MethodOptions uninterpretedOption. + * @member {Array.} uninterpretedOption + * @memberof google.protobuf.MethodOptions + * @instance + */ + MethodOptions.prototype.uninterpretedOption = $util.emptyArray; + + /** + * MethodOptions .google.api.http. + * @member {google.api.IHttpRule|null|undefined} .google.api.http + * @memberof google.protobuf.MethodOptions + * @instance + */ + MethodOptions.prototype[".google.api.http"] = null; + + /** + * MethodOptions .google.api.methodSignature. + * @member {Array.} .google.api.methodSignature + * @memberof google.protobuf.MethodOptions + * @instance + */ + MethodOptions.prototype[".google.api.methodSignature"] = $util.emptyArray; + + /** + * Creates a new MethodOptions instance using the specified properties. + * @function create + * @memberof google.protobuf.MethodOptions + * @static + * @param {google.protobuf.IMethodOptions=} [properties] Properties to set + * @returns {google.protobuf.MethodOptions} MethodOptions instance + */ + MethodOptions.create = function create(properties) { + return new MethodOptions(properties); + }; + + /** + * Encodes the specified MethodOptions message. Does not implicitly {@link google.protobuf.MethodOptions.verify|verify} messages. + * @function encode + * @memberof google.protobuf.MethodOptions + * @static + * @param {google.protobuf.IMethodOptions} message MethodOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MethodOptions.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.deprecated != null && Object.hasOwnProperty.call(message, "deprecated")) + writer.uint32(/* id 33, wireType 0 =*/264).bool(message.deprecated); + if (message.idempotencyLevel != null && Object.hasOwnProperty.call(message, "idempotencyLevel")) + writer.uint32(/* id 34, wireType 0 =*/272).int32(message.idempotencyLevel); + if (message.uninterpretedOption != null && message.uninterpretedOption.length) + for (var i = 0; i < message.uninterpretedOption.length; ++i) + $root.google.protobuf.UninterpretedOption.encode(message.uninterpretedOption[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork()).ldelim(); + if (message[".google.api.methodSignature"] != null && message[".google.api.methodSignature"].length) + for (var i = 0; i < message[".google.api.methodSignature"].length; ++i) + writer.uint32(/* id 1051, wireType 2 =*/8410).string(message[".google.api.methodSignature"][i]); + if (message[".google.api.http"] != null && Object.hasOwnProperty.call(message, ".google.api.http")) + $root.google.api.HttpRule.encode(message[".google.api.http"], writer.uint32(/* id 72295728, wireType 2 =*/578365826).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified MethodOptions message, length delimited. Does not implicitly {@link google.protobuf.MethodOptions.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.MethodOptions + * @static + * @param {google.protobuf.IMethodOptions} message MethodOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MethodOptions.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a MethodOptions message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.MethodOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.MethodOptions} MethodOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MethodOptions.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.MethodOptions(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 33: { + message.deprecated = reader.bool(); + break; + } + case 34: { + message.idempotencyLevel = reader.int32(); + break; + } + case 999: { + if (!(message.uninterpretedOption && message.uninterpretedOption.length)) + message.uninterpretedOption = []; + message.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32())); + break; + } + case 72295728: { + message[".google.api.http"] = $root.google.api.HttpRule.decode(reader, reader.uint32()); + break; + } + case 1051: { + if (!(message[".google.api.methodSignature"] && message[".google.api.methodSignature"].length)) + message[".google.api.methodSignature"] = []; + message[".google.api.methodSignature"].push(reader.string()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a MethodOptions message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.MethodOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.MethodOptions} MethodOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MethodOptions.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a MethodOptions message. + * @function verify + * @memberof google.protobuf.MethodOptions + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + MethodOptions.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.deprecated != null && message.hasOwnProperty("deprecated")) + if (typeof message.deprecated !== "boolean") + return "deprecated: boolean expected"; + if (message.idempotencyLevel != null && message.hasOwnProperty("idempotencyLevel")) + switch (message.idempotencyLevel) { + default: + return "idempotencyLevel: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.uninterpretedOption != null && message.hasOwnProperty("uninterpretedOption")) { + if (!Array.isArray(message.uninterpretedOption)) + return "uninterpretedOption: array expected"; + for (var i = 0; i < message.uninterpretedOption.length; ++i) { + var error = $root.google.protobuf.UninterpretedOption.verify(message.uninterpretedOption[i]); + if (error) + return "uninterpretedOption." + error; + } + } + if (message[".google.api.http"] != null && message.hasOwnProperty(".google.api.http")) { + var error = $root.google.api.HttpRule.verify(message[".google.api.http"]); + if (error) + return ".google.api.http." + error; + } + if (message[".google.api.methodSignature"] != null && message.hasOwnProperty(".google.api.methodSignature")) { + if (!Array.isArray(message[".google.api.methodSignature"])) + return ".google.api.methodSignature: array expected"; + for (var i = 0; i < message[".google.api.methodSignature"].length; ++i) + if (!$util.isString(message[".google.api.methodSignature"][i])) + return ".google.api.methodSignature: string[] expected"; + } + return null; + }; + + /** + * Creates a MethodOptions message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.MethodOptions + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.MethodOptions} MethodOptions + */ + MethodOptions.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.MethodOptions) + return object; + var message = new $root.google.protobuf.MethodOptions(); + if (object.deprecated != null) + message.deprecated = Boolean(object.deprecated); + switch (object.idempotencyLevel) { + default: + if (typeof object.idempotencyLevel === "number") { + message.idempotencyLevel = object.idempotencyLevel; + break; + } + break; + case "IDEMPOTENCY_UNKNOWN": + case 0: + message.idempotencyLevel = 0; + break; + case "NO_SIDE_EFFECTS": + case 1: + message.idempotencyLevel = 1; + break; + case "IDEMPOTENT": + case 2: + message.idempotencyLevel = 2; + break; + } + if (object.uninterpretedOption) { + if (!Array.isArray(object.uninterpretedOption)) + throw TypeError(".google.protobuf.MethodOptions.uninterpretedOption: array expected"); + message.uninterpretedOption = []; + for (var i = 0; i < object.uninterpretedOption.length; ++i) { + if (typeof object.uninterpretedOption[i] !== "object") + throw TypeError(".google.protobuf.MethodOptions.uninterpretedOption: object expected"); + message.uninterpretedOption[i] = $root.google.protobuf.UninterpretedOption.fromObject(object.uninterpretedOption[i]); + } + } + if (object[".google.api.http"] != null) { + if (typeof object[".google.api.http"] !== "object") + throw TypeError(".google.protobuf.MethodOptions..google.api.http: object expected"); + message[".google.api.http"] = $root.google.api.HttpRule.fromObject(object[".google.api.http"]); + } + if (object[".google.api.methodSignature"]) { + if (!Array.isArray(object[".google.api.methodSignature"])) + throw TypeError(".google.protobuf.MethodOptions..google.api.methodSignature: array expected"); + message[".google.api.methodSignature"] = []; + for (var i = 0; i < object[".google.api.methodSignature"].length; ++i) + message[".google.api.methodSignature"][i] = String(object[".google.api.methodSignature"][i]); + } + return message; + }; + + /** + * Creates a plain object from a MethodOptions message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.MethodOptions + * @static + * @param {google.protobuf.MethodOptions} message MethodOptions + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + MethodOptions.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.uninterpretedOption = []; + object[".google.api.methodSignature"] = []; + } + if (options.defaults) { + object.deprecated = false; + object.idempotencyLevel = options.enums === String ? "IDEMPOTENCY_UNKNOWN" : 0; + object[".google.api.http"] = null; + } + if (message.deprecated != null && message.hasOwnProperty("deprecated")) + object.deprecated = message.deprecated; + if (message.idempotencyLevel != null && message.hasOwnProperty("idempotencyLevel")) + object.idempotencyLevel = options.enums === String ? $root.google.protobuf.MethodOptions.IdempotencyLevel[message.idempotencyLevel] === undefined ? message.idempotencyLevel : $root.google.protobuf.MethodOptions.IdempotencyLevel[message.idempotencyLevel] : message.idempotencyLevel; + if (message.uninterpretedOption && message.uninterpretedOption.length) { + object.uninterpretedOption = []; + for (var j = 0; j < message.uninterpretedOption.length; ++j) + object.uninterpretedOption[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpretedOption[j], options); + } + if (message[".google.api.methodSignature"] && message[".google.api.methodSignature"].length) { + object[".google.api.methodSignature"] = []; + for (var j = 0; j < message[".google.api.methodSignature"].length; ++j) + object[".google.api.methodSignature"][j] = message[".google.api.methodSignature"][j]; + } + if (message[".google.api.http"] != null && message.hasOwnProperty(".google.api.http")) + object[".google.api.http"] = $root.google.api.HttpRule.toObject(message[".google.api.http"], options); + return object; + }; + + /** + * Converts this MethodOptions to JSON. + * @function toJSON + * @memberof google.protobuf.MethodOptions + * @instance + * @returns {Object.} JSON object + */ + MethodOptions.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for MethodOptions + * @function getTypeUrl + * @memberof google.protobuf.MethodOptions + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + MethodOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.MethodOptions"; + }; + + /** + * IdempotencyLevel enum. + * @name google.protobuf.MethodOptions.IdempotencyLevel + * @enum {number} + * @property {number} IDEMPOTENCY_UNKNOWN=0 IDEMPOTENCY_UNKNOWN value + * @property {number} NO_SIDE_EFFECTS=1 NO_SIDE_EFFECTS value + * @property {number} IDEMPOTENT=2 IDEMPOTENT value + */ + MethodOptions.IdempotencyLevel = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "IDEMPOTENCY_UNKNOWN"] = 0; + values[valuesById[1] = "NO_SIDE_EFFECTS"] = 1; + values[valuesById[2] = "IDEMPOTENT"] = 2; + return values; + })(); + + return MethodOptions; + })(); + + protobuf.UninterpretedOption = (function() { + + /** + * Properties of an UninterpretedOption. + * @memberof google.protobuf + * @interface IUninterpretedOption + * @property {Array.|null} [name] UninterpretedOption name + * @property {string|null} [identifierValue] UninterpretedOption identifierValue + * @property {number|Long|null} [positiveIntValue] UninterpretedOption positiveIntValue + * @property {number|Long|null} [negativeIntValue] UninterpretedOption negativeIntValue + * @property {number|null} [doubleValue] UninterpretedOption doubleValue + * @property {Uint8Array|null} [stringValue] UninterpretedOption stringValue + * @property {string|null} [aggregateValue] UninterpretedOption aggregateValue + */ + + /** + * Constructs a new UninterpretedOption. + * @memberof google.protobuf + * @classdesc Represents an UninterpretedOption. + * @implements IUninterpretedOption + * @constructor + * @param {google.protobuf.IUninterpretedOption=} [properties] Properties to set + */ + function UninterpretedOption(properties) { + this.name = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * UninterpretedOption name. + * @member {Array.} name + * @memberof google.protobuf.UninterpretedOption + * @instance + */ + UninterpretedOption.prototype.name = $util.emptyArray; + + /** + * UninterpretedOption identifierValue. + * @member {string} identifierValue + * @memberof google.protobuf.UninterpretedOption + * @instance + */ + UninterpretedOption.prototype.identifierValue = ""; + + /** + * UninterpretedOption positiveIntValue. + * @member {number|Long} positiveIntValue + * @memberof google.protobuf.UninterpretedOption + * @instance + */ + UninterpretedOption.prototype.positiveIntValue = $util.Long ? $util.Long.fromBits(0,0,true) : 0; + + /** + * UninterpretedOption negativeIntValue. + * @member {number|Long} negativeIntValue + * @memberof google.protobuf.UninterpretedOption + * @instance + */ + UninterpretedOption.prototype.negativeIntValue = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * UninterpretedOption doubleValue. + * @member {number} doubleValue + * @memberof google.protobuf.UninterpretedOption + * @instance + */ + UninterpretedOption.prototype.doubleValue = 0; + + /** + * UninterpretedOption stringValue. + * @member {Uint8Array} stringValue + * @memberof google.protobuf.UninterpretedOption + * @instance + */ + UninterpretedOption.prototype.stringValue = $util.newBuffer([]); + + /** + * UninterpretedOption aggregateValue. + * @member {string} aggregateValue + * @memberof google.protobuf.UninterpretedOption + * @instance + */ + UninterpretedOption.prototype.aggregateValue = ""; + + /** + * Creates a new UninterpretedOption instance using the specified properties. + * @function create + * @memberof google.protobuf.UninterpretedOption + * @static + * @param {google.protobuf.IUninterpretedOption=} [properties] Properties to set + * @returns {google.protobuf.UninterpretedOption} UninterpretedOption instance + */ + UninterpretedOption.create = function create(properties) { + return new UninterpretedOption(properties); + }; + + /** + * Encodes the specified UninterpretedOption message. Does not implicitly {@link google.protobuf.UninterpretedOption.verify|verify} messages. + * @function encode + * @memberof google.protobuf.UninterpretedOption + * @static + * @param {google.protobuf.IUninterpretedOption} message UninterpretedOption message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UninterpretedOption.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && message.name.length) + for (var i = 0; i < message.name.length; ++i) + $root.google.protobuf.UninterpretedOption.NamePart.encode(message.name[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.identifierValue != null && Object.hasOwnProperty.call(message, "identifierValue")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.identifierValue); + if (message.positiveIntValue != null && Object.hasOwnProperty.call(message, "positiveIntValue")) + writer.uint32(/* id 4, wireType 0 =*/32).uint64(message.positiveIntValue); + if (message.negativeIntValue != null && Object.hasOwnProperty.call(message, "negativeIntValue")) + writer.uint32(/* id 5, wireType 0 =*/40).int64(message.negativeIntValue); + if (message.doubleValue != null && Object.hasOwnProperty.call(message, "doubleValue")) + writer.uint32(/* id 6, wireType 1 =*/49).double(message.doubleValue); + if (message.stringValue != null && Object.hasOwnProperty.call(message, "stringValue")) + writer.uint32(/* id 7, wireType 2 =*/58).bytes(message.stringValue); + if (message.aggregateValue != null && Object.hasOwnProperty.call(message, "aggregateValue")) + writer.uint32(/* id 8, wireType 2 =*/66).string(message.aggregateValue); + return writer; + }; + + /** + * Encodes the specified UninterpretedOption message, length delimited. Does not implicitly {@link google.protobuf.UninterpretedOption.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.UninterpretedOption + * @static + * @param {google.protobuf.IUninterpretedOption} message UninterpretedOption message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UninterpretedOption.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an UninterpretedOption message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.UninterpretedOption + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.UninterpretedOption} UninterpretedOption + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UninterpretedOption.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.UninterpretedOption(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 2: { + if (!(message.name && message.name.length)) + message.name = []; + message.name.push($root.google.protobuf.UninterpretedOption.NamePart.decode(reader, reader.uint32())); + break; + } + case 3: { + message.identifierValue = reader.string(); + break; + } + case 4: { + message.positiveIntValue = reader.uint64(); + break; + } + case 5: { + message.negativeIntValue = reader.int64(); + break; + } + case 6: { + message.doubleValue = reader.double(); + break; + } + case 7: { + message.stringValue = reader.bytes(); + break; + } + case 8: { + message.aggregateValue = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an UninterpretedOption message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.UninterpretedOption + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.UninterpretedOption} UninterpretedOption + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UninterpretedOption.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an UninterpretedOption message. + * @function verify + * @memberof google.protobuf.UninterpretedOption + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + UninterpretedOption.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) { + if (!Array.isArray(message.name)) + return "name: array expected"; + for (var i = 0; i < message.name.length; ++i) { + var error = $root.google.protobuf.UninterpretedOption.NamePart.verify(message.name[i]); + if (error) + return "name." + error; + } + } + if (message.identifierValue != null && message.hasOwnProperty("identifierValue")) + if (!$util.isString(message.identifierValue)) + return "identifierValue: string expected"; + if (message.positiveIntValue != null && message.hasOwnProperty("positiveIntValue")) + if (!$util.isInteger(message.positiveIntValue) && !(message.positiveIntValue && $util.isInteger(message.positiveIntValue.low) && $util.isInteger(message.positiveIntValue.high))) + return "positiveIntValue: integer|Long expected"; + if (message.negativeIntValue != null && message.hasOwnProperty("negativeIntValue")) + if (!$util.isInteger(message.negativeIntValue) && !(message.negativeIntValue && $util.isInteger(message.negativeIntValue.low) && $util.isInteger(message.negativeIntValue.high))) + return "negativeIntValue: integer|Long expected"; + if (message.doubleValue != null && message.hasOwnProperty("doubleValue")) + if (typeof message.doubleValue !== "number") + return "doubleValue: number expected"; + if (message.stringValue != null && message.hasOwnProperty("stringValue")) + if (!(message.stringValue && typeof message.stringValue.length === "number" || $util.isString(message.stringValue))) + return "stringValue: buffer expected"; + if (message.aggregateValue != null && message.hasOwnProperty("aggregateValue")) + if (!$util.isString(message.aggregateValue)) + return "aggregateValue: string expected"; + return null; + }; + + /** + * Creates an UninterpretedOption message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.UninterpretedOption + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.UninterpretedOption} UninterpretedOption + */ + UninterpretedOption.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.UninterpretedOption) + return object; + var message = new $root.google.protobuf.UninterpretedOption(); + if (object.name) { + if (!Array.isArray(object.name)) + throw TypeError(".google.protobuf.UninterpretedOption.name: array expected"); + message.name = []; + for (var i = 0; i < object.name.length; ++i) { + if (typeof object.name[i] !== "object") + throw TypeError(".google.protobuf.UninterpretedOption.name: object expected"); + message.name[i] = $root.google.protobuf.UninterpretedOption.NamePart.fromObject(object.name[i]); + } + } + if (object.identifierValue != null) + message.identifierValue = String(object.identifierValue); + if (object.positiveIntValue != null) + if ($util.Long) + (message.positiveIntValue = $util.Long.fromValue(object.positiveIntValue)).unsigned = true; + else if (typeof object.positiveIntValue === "string") + message.positiveIntValue = parseInt(object.positiveIntValue, 10); + else if (typeof object.positiveIntValue === "number") + message.positiveIntValue = object.positiveIntValue; + else if (typeof object.positiveIntValue === "object") + message.positiveIntValue = new $util.LongBits(object.positiveIntValue.low >>> 0, object.positiveIntValue.high >>> 0).toNumber(true); + if (object.negativeIntValue != null) + if ($util.Long) + (message.negativeIntValue = $util.Long.fromValue(object.negativeIntValue)).unsigned = false; + else if (typeof object.negativeIntValue === "string") + message.negativeIntValue = parseInt(object.negativeIntValue, 10); + else if (typeof object.negativeIntValue === "number") + message.negativeIntValue = object.negativeIntValue; + else if (typeof object.negativeIntValue === "object") + message.negativeIntValue = new $util.LongBits(object.negativeIntValue.low >>> 0, object.negativeIntValue.high >>> 0).toNumber(); + if (object.doubleValue != null) + message.doubleValue = Number(object.doubleValue); + if (object.stringValue != null) + if (typeof object.stringValue === "string") + $util.base64.decode(object.stringValue, message.stringValue = $util.newBuffer($util.base64.length(object.stringValue)), 0); + else if (object.stringValue.length >= 0) + message.stringValue = object.stringValue; + if (object.aggregateValue != null) + message.aggregateValue = String(object.aggregateValue); + return message; + }; + + /** + * Creates a plain object from an UninterpretedOption message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.UninterpretedOption + * @static + * @param {google.protobuf.UninterpretedOption} message UninterpretedOption + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + UninterpretedOption.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.name = []; + if (options.defaults) { + object.identifierValue = ""; + if ($util.Long) { + var long = new $util.Long(0, 0, true); + object.positiveIntValue = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.positiveIntValue = options.longs === String ? "0" : 0; + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.negativeIntValue = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.negativeIntValue = options.longs === String ? "0" : 0; + object.doubleValue = 0; + if (options.bytes === String) + object.stringValue = ""; + else { + object.stringValue = []; + if (options.bytes !== Array) + object.stringValue = $util.newBuffer(object.stringValue); + } + object.aggregateValue = ""; + } + if (message.name && message.name.length) { + object.name = []; + for (var j = 0; j < message.name.length; ++j) + object.name[j] = $root.google.protobuf.UninterpretedOption.NamePart.toObject(message.name[j], options); + } + if (message.identifierValue != null && message.hasOwnProperty("identifierValue")) + object.identifierValue = message.identifierValue; + if (message.positiveIntValue != null && message.hasOwnProperty("positiveIntValue")) + if (typeof message.positiveIntValue === "number") + object.positiveIntValue = options.longs === String ? String(message.positiveIntValue) : message.positiveIntValue; + else + object.positiveIntValue = options.longs === String ? $util.Long.prototype.toString.call(message.positiveIntValue) : options.longs === Number ? new $util.LongBits(message.positiveIntValue.low >>> 0, message.positiveIntValue.high >>> 0).toNumber(true) : message.positiveIntValue; + if (message.negativeIntValue != null && message.hasOwnProperty("negativeIntValue")) + if (typeof message.negativeIntValue === "number") + object.negativeIntValue = options.longs === String ? String(message.negativeIntValue) : message.negativeIntValue; + else + object.negativeIntValue = options.longs === String ? $util.Long.prototype.toString.call(message.negativeIntValue) : options.longs === Number ? new $util.LongBits(message.negativeIntValue.low >>> 0, message.negativeIntValue.high >>> 0).toNumber() : message.negativeIntValue; + if (message.doubleValue != null && message.hasOwnProperty("doubleValue")) + object.doubleValue = options.json && !isFinite(message.doubleValue) ? String(message.doubleValue) : message.doubleValue; + if (message.stringValue != null && message.hasOwnProperty("stringValue")) + object.stringValue = options.bytes === String ? $util.base64.encode(message.stringValue, 0, message.stringValue.length) : options.bytes === Array ? Array.prototype.slice.call(message.stringValue) : message.stringValue; + if (message.aggregateValue != null && message.hasOwnProperty("aggregateValue")) + object.aggregateValue = message.aggregateValue; + return object; + }; + + /** + * Converts this UninterpretedOption to JSON. + * @function toJSON + * @memberof google.protobuf.UninterpretedOption + * @instance + * @returns {Object.} JSON object + */ + UninterpretedOption.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for UninterpretedOption + * @function getTypeUrl + * @memberof google.protobuf.UninterpretedOption + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + UninterpretedOption.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.UninterpretedOption"; + }; + + UninterpretedOption.NamePart = (function() { + + /** + * Properties of a NamePart. + * @memberof google.protobuf.UninterpretedOption + * @interface INamePart + * @property {string} namePart NamePart namePart + * @property {boolean} isExtension NamePart isExtension + */ + + /** + * Constructs a new NamePart. + * @memberof google.protobuf.UninterpretedOption + * @classdesc Represents a NamePart. + * @implements INamePart + * @constructor + * @param {google.protobuf.UninterpretedOption.INamePart=} [properties] Properties to set + */ + function NamePart(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * NamePart namePart. + * @member {string} namePart + * @memberof google.protobuf.UninterpretedOption.NamePart + * @instance + */ + NamePart.prototype.namePart = ""; + + /** + * NamePart isExtension. + * @member {boolean} isExtension + * @memberof google.protobuf.UninterpretedOption.NamePart + * @instance + */ + NamePart.prototype.isExtension = false; + + /** + * Creates a new NamePart instance using the specified properties. + * @function create + * @memberof google.protobuf.UninterpretedOption.NamePart + * @static + * @param {google.protobuf.UninterpretedOption.INamePart=} [properties] Properties to set + * @returns {google.protobuf.UninterpretedOption.NamePart} NamePart instance + */ + NamePart.create = function create(properties) { + return new NamePart(properties); + }; + + /** + * Encodes the specified NamePart message. Does not implicitly {@link google.protobuf.UninterpretedOption.NamePart.verify|verify} messages. + * @function encode + * @memberof google.protobuf.UninterpretedOption.NamePart + * @static + * @param {google.protobuf.UninterpretedOption.INamePart} message NamePart message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + NamePart.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + writer.uint32(/* id 1, wireType 2 =*/10).string(message.namePart); + writer.uint32(/* id 2, wireType 0 =*/16).bool(message.isExtension); + return writer; + }; + + /** + * Encodes the specified NamePart message, length delimited. Does not implicitly {@link google.protobuf.UninterpretedOption.NamePart.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.UninterpretedOption.NamePart + * @static + * @param {google.protobuf.UninterpretedOption.INamePart} message NamePart message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + NamePart.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a NamePart message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.UninterpretedOption.NamePart + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.UninterpretedOption.NamePart} NamePart + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + NamePart.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.UninterpretedOption.NamePart(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.namePart = reader.string(); + break; + } + case 2: { + message.isExtension = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + if (!message.hasOwnProperty("namePart")) + throw $util.ProtocolError("missing required 'namePart'", { instance: message }); + if (!message.hasOwnProperty("isExtension")) + throw $util.ProtocolError("missing required 'isExtension'", { instance: message }); + return message; + }; + + /** + * Decodes a NamePart message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.UninterpretedOption.NamePart + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.UninterpretedOption.NamePart} NamePart + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + NamePart.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a NamePart message. + * @function verify + * @memberof google.protobuf.UninterpretedOption.NamePart + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + NamePart.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (!$util.isString(message.namePart)) + return "namePart: string expected"; + if (typeof message.isExtension !== "boolean") + return "isExtension: boolean expected"; + return null; + }; + + /** + * Creates a NamePart message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.UninterpretedOption.NamePart + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.UninterpretedOption.NamePart} NamePart + */ + NamePart.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.UninterpretedOption.NamePart) + return object; + var message = new $root.google.protobuf.UninterpretedOption.NamePart(); + if (object.namePart != null) + message.namePart = String(object.namePart); + if (object.isExtension != null) + message.isExtension = Boolean(object.isExtension); + return message; + }; + + /** + * Creates a plain object from a NamePart message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.UninterpretedOption.NamePart + * @static + * @param {google.protobuf.UninterpretedOption.NamePart} message NamePart + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + NamePart.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.namePart = ""; + object.isExtension = false; + } + if (message.namePart != null && message.hasOwnProperty("namePart")) + object.namePart = message.namePart; + if (message.isExtension != null && message.hasOwnProperty("isExtension")) + object.isExtension = message.isExtension; + return object; + }; + + /** + * Converts this NamePart to JSON. + * @function toJSON + * @memberof google.protobuf.UninterpretedOption.NamePart + * @instance + * @returns {Object.} JSON object + */ + NamePart.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for NamePart + * @function getTypeUrl + * @memberof google.protobuf.UninterpretedOption.NamePart + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + NamePart.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.UninterpretedOption.NamePart"; + }; + + return NamePart; + })(); + + return UninterpretedOption; + })(); + + protobuf.SourceCodeInfo = (function() { + + /** + * Properties of a SourceCodeInfo. + * @memberof google.protobuf + * @interface ISourceCodeInfo + * @property {Array.|null} [location] SourceCodeInfo location + */ + + /** + * Constructs a new SourceCodeInfo. + * @memberof google.protobuf + * @classdesc Represents a SourceCodeInfo. + * @implements ISourceCodeInfo + * @constructor + * @param {google.protobuf.ISourceCodeInfo=} [properties] Properties to set + */ + function SourceCodeInfo(properties) { + this.location = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * SourceCodeInfo location. + * @member {Array.} location + * @memberof google.protobuf.SourceCodeInfo + * @instance + */ + SourceCodeInfo.prototype.location = $util.emptyArray; + + /** + * Creates a new SourceCodeInfo instance using the specified properties. + * @function create + * @memberof google.protobuf.SourceCodeInfo + * @static + * @param {google.protobuf.ISourceCodeInfo=} [properties] Properties to set + * @returns {google.protobuf.SourceCodeInfo} SourceCodeInfo instance + */ + SourceCodeInfo.create = function create(properties) { + return new SourceCodeInfo(properties); + }; + + /** + * Encodes the specified SourceCodeInfo message. Does not implicitly {@link google.protobuf.SourceCodeInfo.verify|verify} messages. + * @function encode + * @memberof google.protobuf.SourceCodeInfo + * @static + * @param {google.protobuf.ISourceCodeInfo} message SourceCodeInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SourceCodeInfo.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.location != null && message.location.length) + for (var i = 0; i < message.location.length; ++i) + $root.google.protobuf.SourceCodeInfo.Location.encode(message.location[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified SourceCodeInfo message, length delimited. Does not implicitly {@link google.protobuf.SourceCodeInfo.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.SourceCodeInfo + * @static + * @param {google.protobuf.ISourceCodeInfo} message SourceCodeInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SourceCodeInfo.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a SourceCodeInfo message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.SourceCodeInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.SourceCodeInfo} SourceCodeInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SourceCodeInfo.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.SourceCodeInfo(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.location && message.location.length)) + message.location = []; + message.location.push($root.google.protobuf.SourceCodeInfo.Location.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a SourceCodeInfo message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.SourceCodeInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.SourceCodeInfo} SourceCodeInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SourceCodeInfo.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a SourceCodeInfo message. + * @function verify + * @memberof google.protobuf.SourceCodeInfo + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + SourceCodeInfo.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.location != null && message.hasOwnProperty("location")) { + if (!Array.isArray(message.location)) + return "location: array expected"; + for (var i = 0; i < message.location.length; ++i) { + var error = $root.google.protobuf.SourceCodeInfo.Location.verify(message.location[i]); + if (error) + return "location." + error; + } + } + return null; + }; + + /** + * Creates a SourceCodeInfo message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.SourceCodeInfo + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.SourceCodeInfo} SourceCodeInfo + */ + SourceCodeInfo.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.SourceCodeInfo) + return object; + var message = new $root.google.protobuf.SourceCodeInfo(); + if (object.location) { + if (!Array.isArray(object.location)) + throw TypeError(".google.protobuf.SourceCodeInfo.location: array expected"); + message.location = []; + for (var i = 0; i < object.location.length; ++i) { + if (typeof object.location[i] !== "object") + throw TypeError(".google.protobuf.SourceCodeInfo.location: object expected"); + message.location[i] = $root.google.protobuf.SourceCodeInfo.Location.fromObject(object.location[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a SourceCodeInfo message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.SourceCodeInfo + * @static + * @param {google.protobuf.SourceCodeInfo} message SourceCodeInfo + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + SourceCodeInfo.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.location = []; + if (message.location && message.location.length) { + object.location = []; + for (var j = 0; j < message.location.length; ++j) + object.location[j] = $root.google.protobuf.SourceCodeInfo.Location.toObject(message.location[j], options); + } + return object; + }; + + /** + * Converts this SourceCodeInfo to JSON. + * @function toJSON + * @memberof google.protobuf.SourceCodeInfo + * @instance + * @returns {Object.} JSON object + */ + SourceCodeInfo.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for SourceCodeInfo + * @function getTypeUrl + * @memberof google.protobuf.SourceCodeInfo + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + SourceCodeInfo.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.SourceCodeInfo"; + }; + + SourceCodeInfo.Location = (function() { + + /** + * Properties of a Location. + * @memberof google.protobuf.SourceCodeInfo + * @interface ILocation + * @property {Array.|null} [path] Location path + * @property {Array.|null} [span] Location span + * @property {string|null} [leadingComments] Location leadingComments + * @property {string|null} [trailingComments] Location trailingComments + * @property {Array.|null} [leadingDetachedComments] Location leadingDetachedComments + */ + + /** + * Constructs a new Location. + * @memberof google.protobuf.SourceCodeInfo + * @classdesc Represents a Location. + * @implements ILocation + * @constructor + * @param {google.protobuf.SourceCodeInfo.ILocation=} [properties] Properties to set + */ + function Location(properties) { + this.path = []; + this.span = []; + this.leadingDetachedComments = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Location path. + * @member {Array.} path + * @memberof google.protobuf.SourceCodeInfo.Location + * @instance + */ + Location.prototype.path = $util.emptyArray; + + /** + * Location span. + * @member {Array.} span + * @memberof google.protobuf.SourceCodeInfo.Location + * @instance + */ + Location.prototype.span = $util.emptyArray; + + /** + * Location leadingComments. + * @member {string} leadingComments + * @memberof google.protobuf.SourceCodeInfo.Location + * @instance + */ + Location.prototype.leadingComments = ""; + + /** + * Location trailingComments. + * @member {string} trailingComments + * @memberof google.protobuf.SourceCodeInfo.Location + * @instance + */ + Location.prototype.trailingComments = ""; + + /** + * Location leadingDetachedComments. + * @member {Array.} leadingDetachedComments + * @memberof google.protobuf.SourceCodeInfo.Location + * @instance + */ + Location.prototype.leadingDetachedComments = $util.emptyArray; + + /** + * Creates a new Location instance using the specified properties. + * @function create + * @memberof google.protobuf.SourceCodeInfo.Location + * @static + * @param {google.protobuf.SourceCodeInfo.ILocation=} [properties] Properties to set + * @returns {google.protobuf.SourceCodeInfo.Location} Location instance + */ + Location.create = function create(properties) { + return new Location(properties); + }; + + /** + * Encodes the specified Location message. Does not implicitly {@link google.protobuf.SourceCodeInfo.Location.verify|verify} messages. + * @function encode + * @memberof google.protobuf.SourceCodeInfo.Location + * @static + * @param {google.protobuf.SourceCodeInfo.ILocation} message Location message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Location.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.path != null && message.path.length) { + writer.uint32(/* id 1, wireType 2 =*/10).fork(); + for (var i = 0; i < message.path.length; ++i) + writer.int32(message.path[i]); + writer.ldelim(); + } + if (message.span != null && message.span.length) { + writer.uint32(/* id 2, wireType 2 =*/18).fork(); + for (var i = 0; i < message.span.length; ++i) + writer.int32(message.span[i]); + writer.ldelim(); + } + if (message.leadingComments != null && Object.hasOwnProperty.call(message, "leadingComments")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.leadingComments); + if (message.trailingComments != null && Object.hasOwnProperty.call(message, "trailingComments")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.trailingComments); + if (message.leadingDetachedComments != null && message.leadingDetachedComments.length) + for (var i = 0; i < message.leadingDetachedComments.length; ++i) + writer.uint32(/* id 6, wireType 2 =*/50).string(message.leadingDetachedComments[i]); + return writer; + }; + + /** + * Encodes the specified Location message, length delimited. Does not implicitly {@link google.protobuf.SourceCodeInfo.Location.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.SourceCodeInfo.Location + * @static + * @param {google.protobuf.SourceCodeInfo.ILocation} message Location message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Location.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Location message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.SourceCodeInfo.Location + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.SourceCodeInfo.Location} Location + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Location.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.SourceCodeInfo.Location(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.path && message.path.length)) + message.path = []; + if ((tag & 7) === 2) { + var end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) + message.path.push(reader.int32()); + } else + message.path.push(reader.int32()); + break; + } + case 2: { + if (!(message.span && message.span.length)) + message.span = []; + if ((tag & 7) === 2) { + var end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) + message.span.push(reader.int32()); + } else + message.span.push(reader.int32()); + break; + } + case 3: { + message.leadingComments = reader.string(); + break; + } + case 4: { + message.trailingComments = reader.string(); + break; + } + case 6: { + if (!(message.leadingDetachedComments && message.leadingDetachedComments.length)) + message.leadingDetachedComments = []; + message.leadingDetachedComments.push(reader.string()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Location message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.SourceCodeInfo.Location + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.SourceCodeInfo.Location} Location + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Location.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Location message. + * @function verify + * @memberof google.protobuf.SourceCodeInfo.Location + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Location.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.path != null && message.hasOwnProperty("path")) { + if (!Array.isArray(message.path)) + return "path: array expected"; + for (var i = 0; i < message.path.length; ++i) + if (!$util.isInteger(message.path[i])) + return "path: integer[] expected"; + } + if (message.span != null && message.hasOwnProperty("span")) { + if (!Array.isArray(message.span)) + return "span: array expected"; + for (var i = 0; i < message.span.length; ++i) + if (!$util.isInteger(message.span[i])) + return "span: integer[] expected"; + } + if (message.leadingComments != null && message.hasOwnProperty("leadingComments")) + if (!$util.isString(message.leadingComments)) + return "leadingComments: string expected"; + if (message.trailingComments != null && message.hasOwnProperty("trailingComments")) + if (!$util.isString(message.trailingComments)) + return "trailingComments: string expected"; + if (message.leadingDetachedComments != null && message.hasOwnProperty("leadingDetachedComments")) { + if (!Array.isArray(message.leadingDetachedComments)) + return "leadingDetachedComments: array expected"; + for (var i = 0; i < message.leadingDetachedComments.length; ++i) + if (!$util.isString(message.leadingDetachedComments[i])) + return "leadingDetachedComments: string[] expected"; + } + return null; + }; + + /** + * Creates a Location message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.SourceCodeInfo.Location + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.SourceCodeInfo.Location} Location + */ + Location.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.SourceCodeInfo.Location) + return object; + var message = new $root.google.protobuf.SourceCodeInfo.Location(); + if (object.path) { + if (!Array.isArray(object.path)) + throw TypeError(".google.protobuf.SourceCodeInfo.Location.path: array expected"); + message.path = []; + for (var i = 0; i < object.path.length; ++i) + message.path[i] = object.path[i] | 0; + } + if (object.span) { + if (!Array.isArray(object.span)) + throw TypeError(".google.protobuf.SourceCodeInfo.Location.span: array expected"); + message.span = []; + for (var i = 0; i < object.span.length; ++i) + message.span[i] = object.span[i] | 0; + } + if (object.leadingComments != null) + message.leadingComments = String(object.leadingComments); + if (object.trailingComments != null) + message.trailingComments = String(object.trailingComments); + if (object.leadingDetachedComments) { + if (!Array.isArray(object.leadingDetachedComments)) + throw TypeError(".google.protobuf.SourceCodeInfo.Location.leadingDetachedComments: array expected"); + message.leadingDetachedComments = []; + for (var i = 0; i < object.leadingDetachedComments.length; ++i) + message.leadingDetachedComments[i] = String(object.leadingDetachedComments[i]); + } + return message; + }; + + /** + * Creates a plain object from a Location message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.SourceCodeInfo.Location + * @static + * @param {google.protobuf.SourceCodeInfo.Location} message Location + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Location.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.path = []; + object.span = []; + object.leadingDetachedComments = []; + } + if (options.defaults) { + object.leadingComments = ""; + object.trailingComments = ""; + } + if (message.path && message.path.length) { + object.path = []; + for (var j = 0; j < message.path.length; ++j) + object.path[j] = message.path[j]; + } + if (message.span && message.span.length) { + object.span = []; + for (var j = 0; j < message.span.length; ++j) + object.span[j] = message.span[j]; + } + if (message.leadingComments != null && message.hasOwnProperty("leadingComments")) + object.leadingComments = message.leadingComments; + if (message.trailingComments != null && message.hasOwnProperty("trailingComments")) + object.trailingComments = message.trailingComments; + if (message.leadingDetachedComments && message.leadingDetachedComments.length) { + object.leadingDetachedComments = []; + for (var j = 0; j < message.leadingDetachedComments.length; ++j) + object.leadingDetachedComments[j] = message.leadingDetachedComments[j]; + } + return object; + }; + + /** + * Converts this Location to JSON. + * @function toJSON + * @memberof google.protobuf.SourceCodeInfo.Location + * @instance + * @returns {Object.} JSON object + */ + Location.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Location + * @function getTypeUrl + * @memberof google.protobuf.SourceCodeInfo.Location + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Location.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.SourceCodeInfo.Location"; + }; + + return Location; + })(); + + return SourceCodeInfo; + })(); + + protobuf.GeneratedCodeInfo = (function() { + + /** + * Properties of a GeneratedCodeInfo. + * @memberof google.protobuf + * @interface IGeneratedCodeInfo + * @property {Array.|null} [annotation] GeneratedCodeInfo annotation + */ + + /** + * Constructs a new GeneratedCodeInfo. + * @memberof google.protobuf + * @classdesc Represents a GeneratedCodeInfo. + * @implements IGeneratedCodeInfo + * @constructor + * @param {google.protobuf.IGeneratedCodeInfo=} [properties] Properties to set + */ + function GeneratedCodeInfo(properties) { + this.annotation = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GeneratedCodeInfo annotation. + * @member {Array.} annotation + * @memberof google.protobuf.GeneratedCodeInfo + * @instance + */ + GeneratedCodeInfo.prototype.annotation = $util.emptyArray; + + /** + * Creates a new GeneratedCodeInfo instance using the specified properties. + * @function create + * @memberof google.protobuf.GeneratedCodeInfo + * @static + * @param {google.protobuf.IGeneratedCodeInfo=} [properties] Properties to set + * @returns {google.protobuf.GeneratedCodeInfo} GeneratedCodeInfo instance + */ + GeneratedCodeInfo.create = function create(properties) { + return new GeneratedCodeInfo(properties); + }; + + /** + * Encodes the specified GeneratedCodeInfo message. Does not implicitly {@link google.protobuf.GeneratedCodeInfo.verify|verify} messages. + * @function encode + * @memberof google.protobuf.GeneratedCodeInfo + * @static + * @param {google.protobuf.IGeneratedCodeInfo} message GeneratedCodeInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GeneratedCodeInfo.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.annotation != null && message.annotation.length) + for (var i = 0; i < message.annotation.length; ++i) + $root.google.protobuf.GeneratedCodeInfo.Annotation.encode(message.annotation[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified GeneratedCodeInfo message, length delimited. Does not implicitly {@link google.protobuf.GeneratedCodeInfo.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.GeneratedCodeInfo + * @static + * @param {google.protobuf.IGeneratedCodeInfo} message GeneratedCodeInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GeneratedCodeInfo.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GeneratedCodeInfo message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.GeneratedCodeInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.GeneratedCodeInfo} GeneratedCodeInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GeneratedCodeInfo.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.GeneratedCodeInfo(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.annotation && message.annotation.length)) + message.annotation = []; + message.annotation.push($root.google.protobuf.GeneratedCodeInfo.Annotation.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GeneratedCodeInfo message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.GeneratedCodeInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.GeneratedCodeInfo} GeneratedCodeInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GeneratedCodeInfo.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GeneratedCodeInfo message. + * @function verify + * @memberof google.protobuf.GeneratedCodeInfo + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GeneratedCodeInfo.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.annotation != null && message.hasOwnProperty("annotation")) { + if (!Array.isArray(message.annotation)) + return "annotation: array expected"; + for (var i = 0; i < message.annotation.length; ++i) { + var error = $root.google.protobuf.GeneratedCodeInfo.Annotation.verify(message.annotation[i]); + if (error) + return "annotation." + error; + } + } + return null; + }; + + /** + * Creates a GeneratedCodeInfo message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.GeneratedCodeInfo + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.GeneratedCodeInfo} GeneratedCodeInfo + */ + GeneratedCodeInfo.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.GeneratedCodeInfo) + return object; + var message = new $root.google.protobuf.GeneratedCodeInfo(); + if (object.annotation) { + if (!Array.isArray(object.annotation)) + throw TypeError(".google.protobuf.GeneratedCodeInfo.annotation: array expected"); + message.annotation = []; + for (var i = 0; i < object.annotation.length; ++i) { + if (typeof object.annotation[i] !== "object") + throw TypeError(".google.protobuf.GeneratedCodeInfo.annotation: object expected"); + message.annotation[i] = $root.google.protobuf.GeneratedCodeInfo.Annotation.fromObject(object.annotation[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a GeneratedCodeInfo message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.GeneratedCodeInfo + * @static + * @param {google.protobuf.GeneratedCodeInfo} message GeneratedCodeInfo + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GeneratedCodeInfo.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.annotation = []; + if (message.annotation && message.annotation.length) { + object.annotation = []; + for (var j = 0; j < message.annotation.length; ++j) + object.annotation[j] = $root.google.protobuf.GeneratedCodeInfo.Annotation.toObject(message.annotation[j], options); + } + return object; + }; + + /** + * Converts this GeneratedCodeInfo to JSON. + * @function toJSON + * @memberof google.protobuf.GeneratedCodeInfo + * @instance + * @returns {Object.} JSON object + */ + GeneratedCodeInfo.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GeneratedCodeInfo + * @function getTypeUrl + * @memberof google.protobuf.GeneratedCodeInfo + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GeneratedCodeInfo.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.GeneratedCodeInfo"; + }; + + GeneratedCodeInfo.Annotation = (function() { + + /** + * Properties of an Annotation. + * @memberof google.protobuf.GeneratedCodeInfo + * @interface IAnnotation + * @property {Array.|null} [path] Annotation path + * @property {string|null} [sourceFile] Annotation sourceFile + * @property {number|null} [begin] Annotation begin + * @property {number|null} [end] Annotation end + * @property {google.protobuf.GeneratedCodeInfo.Annotation.Semantic|null} [semantic] Annotation semantic + */ + + /** + * Constructs a new Annotation. + * @memberof google.protobuf.GeneratedCodeInfo + * @classdesc Represents an Annotation. + * @implements IAnnotation + * @constructor + * @param {google.protobuf.GeneratedCodeInfo.IAnnotation=} [properties] Properties to set + */ + function Annotation(properties) { + this.path = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Annotation path. + * @member {Array.} path + * @memberof google.protobuf.GeneratedCodeInfo.Annotation + * @instance + */ + Annotation.prototype.path = $util.emptyArray; + + /** + * Annotation sourceFile. + * @member {string} sourceFile + * @memberof google.protobuf.GeneratedCodeInfo.Annotation + * @instance + */ + Annotation.prototype.sourceFile = ""; + + /** + * Annotation begin. + * @member {number} begin + * @memberof google.protobuf.GeneratedCodeInfo.Annotation + * @instance + */ + Annotation.prototype.begin = 0; + + /** + * Annotation end. + * @member {number} end + * @memberof google.protobuf.GeneratedCodeInfo.Annotation + * @instance + */ + Annotation.prototype.end = 0; + + /** + * Annotation semantic. + * @member {google.protobuf.GeneratedCodeInfo.Annotation.Semantic} semantic + * @memberof google.protobuf.GeneratedCodeInfo.Annotation + * @instance + */ + Annotation.prototype.semantic = 0; + + /** + * Creates a new Annotation instance using the specified properties. + * @function create + * @memberof google.protobuf.GeneratedCodeInfo.Annotation + * @static + * @param {google.protobuf.GeneratedCodeInfo.IAnnotation=} [properties] Properties to set + * @returns {google.protobuf.GeneratedCodeInfo.Annotation} Annotation instance + */ + Annotation.create = function create(properties) { + return new Annotation(properties); + }; + + /** + * Encodes the specified Annotation message. Does not implicitly {@link google.protobuf.GeneratedCodeInfo.Annotation.verify|verify} messages. + * @function encode + * @memberof google.protobuf.GeneratedCodeInfo.Annotation + * @static + * @param {google.protobuf.GeneratedCodeInfo.IAnnotation} message Annotation message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Annotation.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.path != null && message.path.length) { + writer.uint32(/* id 1, wireType 2 =*/10).fork(); + for (var i = 0; i < message.path.length; ++i) + writer.int32(message.path[i]); + writer.ldelim(); + } + if (message.sourceFile != null && Object.hasOwnProperty.call(message, "sourceFile")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.sourceFile); + if (message.begin != null && Object.hasOwnProperty.call(message, "begin")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.begin); + if (message.end != null && Object.hasOwnProperty.call(message, "end")) + writer.uint32(/* id 4, wireType 0 =*/32).int32(message.end); + if (message.semantic != null && Object.hasOwnProperty.call(message, "semantic")) + writer.uint32(/* id 5, wireType 0 =*/40).int32(message.semantic); + return writer; + }; + + /** + * Encodes the specified Annotation message, length delimited. Does not implicitly {@link google.protobuf.GeneratedCodeInfo.Annotation.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.GeneratedCodeInfo.Annotation + * @static + * @param {google.protobuf.GeneratedCodeInfo.IAnnotation} message Annotation message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Annotation.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an Annotation message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.GeneratedCodeInfo.Annotation + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.GeneratedCodeInfo.Annotation} Annotation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Annotation.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.GeneratedCodeInfo.Annotation(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.path && message.path.length)) + message.path = []; + if ((tag & 7) === 2) { + var end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) + message.path.push(reader.int32()); + } else + message.path.push(reader.int32()); + break; + } + case 2: { + message.sourceFile = reader.string(); + break; + } + case 3: { + message.begin = reader.int32(); + break; + } + case 4: { + message.end = reader.int32(); + break; + } + case 5: { + message.semantic = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an Annotation message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.GeneratedCodeInfo.Annotation + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.GeneratedCodeInfo.Annotation} Annotation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Annotation.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an Annotation message. + * @function verify + * @memberof google.protobuf.GeneratedCodeInfo.Annotation + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Annotation.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.path != null && message.hasOwnProperty("path")) { + if (!Array.isArray(message.path)) + return "path: array expected"; + for (var i = 0; i < message.path.length; ++i) + if (!$util.isInteger(message.path[i])) + return "path: integer[] expected"; + } + if (message.sourceFile != null && message.hasOwnProperty("sourceFile")) + if (!$util.isString(message.sourceFile)) + return "sourceFile: string expected"; + if (message.begin != null && message.hasOwnProperty("begin")) + if (!$util.isInteger(message.begin)) + return "begin: integer expected"; + if (message.end != null && message.hasOwnProperty("end")) + if (!$util.isInteger(message.end)) + return "end: integer expected"; + if (message.semantic != null && message.hasOwnProperty("semantic")) + switch (message.semantic) { + default: + return "semantic: enum value expected"; + case 0: + case 1: + case 2: + break; + } + return null; + }; + + /** + * Creates an Annotation message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.GeneratedCodeInfo.Annotation + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.GeneratedCodeInfo.Annotation} Annotation + */ + Annotation.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.GeneratedCodeInfo.Annotation) + return object; + var message = new $root.google.protobuf.GeneratedCodeInfo.Annotation(); + if (object.path) { + if (!Array.isArray(object.path)) + throw TypeError(".google.protobuf.GeneratedCodeInfo.Annotation.path: array expected"); + message.path = []; + for (var i = 0; i < object.path.length; ++i) + message.path[i] = object.path[i] | 0; + } + if (object.sourceFile != null) + message.sourceFile = String(object.sourceFile); + if (object.begin != null) + message.begin = object.begin | 0; + if (object.end != null) + message.end = object.end | 0; + switch (object.semantic) { + default: + if (typeof object.semantic === "number") { + message.semantic = object.semantic; + break; + } + break; + case "NONE": + case 0: + message.semantic = 0; + break; + case "SET": + case 1: + message.semantic = 1; + break; + case "ALIAS": + case 2: + message.semantic = 2; + break; + } + return message; + }; + + /** + * Creates a plain object from an Annotation message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.GeneratedCodeInfo.Annotation + * @static + * @param {google.protobuf.GeneratedCodeInfo.Annotation} message Annotation + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Annotation.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.path = []; + if (options.defaults) { + object.sourceFile = ""; + object.begin = 0; + object.end = 0; + object.semantic = options.enums === String ? "NONE" : 0; + } + if (message.path && message.path.length) { + object.path = []; + for (var j = 0; j < message.path.length; ++j) + object.path[j] = message.path[j]; + } + if (message.sourceFile != null && message.hasOwnProperty("sourceFile")) + object.sourceFile = message.sourceFile; + if (message.begin != null && message.hasOwnProperty("begin")) + object.begin = message.begin; + if (message.end != null && message.hasOwnProperty("end")) + object.end = message.end; + if (message.semantic != null && message.hasOwnProperty("semantic")) + object.semantic = options.enums === String ? $root.google.protobuf.GeneratedCodeInfo.Annotation.Semantic[message.semantic] === undefined ? message.semantic : $root.google.protobuf.GeneratedCodeInfo.Annotation.Semantic[message.semantic] : message.semantic; + return object; + }; + + /** + * Converts this Annotation to JSON. + * @function toJSON + * @memberof google.protobuf.GeneratedCodeInfo.Annotation + * @instance + * @returns {Object.} JSON object + */ + Annotation.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Annotation + * @function getTypeUrl + * @memberof google.protobuf.GeneratedCodeInfo.Annotation + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Annotation.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.GeneratedCodeInfo.Annotation"; + }; + + /** + * Semantic enum. + * @name google.protobuf.GeneratedCodeInfo.Annotation.Semantic + * @enum {number} + * @property {number} NONE=0 NONE value + * @property {number} SET=1 SET value + * @property {number} ALIAS=2 ALIAS value + */ + Annotation.Semantic = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "NONE"] = 0; + values[valuesById[1] = "SET"] = 1; + values[valuesById[2] = "ALIAS"] = 2; + return values; + })(); + + return Annotation; + })(); + + return GeneratedCodeInfo; + })(); + + protobuf.Timestamp = (function() { + + /** + * Properties of a Timestamp. + * @memberof google.protobuf + * @interface ITimestamp + * @property {number|Long|null} [seconds] Timestamp seconds + * @property {number|null} [nanos] Timestamp nanos + */ + + /** + * Constructs a new Timestamp. + * @memberof google.protobuf + * @classdesc Represents a Timestamp. + * @implements ITimestamp + * @constructor + * @param {google.protobuf.ITimestamp=} [properties] Properties to set + */ + function Timestamp(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Timestamp seconds. + * @member {number|Long} seconds + * @memberof google.protobuf.Timestamp + * @instance + */ + Timestamp.prototype.seconds = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Timestamp nanos. + * @member {number} nanos + * @memberof google.protobuf.Timestamp + * @instance + */ + Timestamp.prototype.nanos = 0; + + /** + * Creates a new Timestamp instance using the specified properties. + * @function create + * @memberof google.protobuf.Timestamp + * @static + * @param {google.protobuf.ITimestamp=} [properties] Properties to set + * @returns {google.protobuf.Timestamp} Timestamp instance + */ + Timestamp.create = function create(properties) { + return new Timestamp(properties); + }; + + /** + * Encodes the specified Timestamp message. Does not implicitly {@link google.protobuf.Timestamp.verify|verify} messages. + * @function encode + * @memberof google.protobuf.Timestamp + * @static + * @param {google.protobuf.ITimestamp} message Timestamp message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Timestamp.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.seconds != null && Object.hasOwnProperty.call(message, "seconds")) + writer.uint32(/* id 1, wireType 0 =*/8).int64(message.seconds); + if (message.nanos != null && Object.hasOwnProperty.call(message, "nanos")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.nanos); + return writer; + }; + + /** + * Encodes the specified Timestamp message, length delimited. Does not implicitly {@link google.protobuf.Timestamp.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.Timestamp + * @static + * @param {google.protobuf.ITimestamp} message Timestamp message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Timestamp.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Timestamp message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.Timestamp + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.Timestamp} Timestamp + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Timestamp.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.Timestamp(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.seconds = reader.int64(); + break; + } + case 2: { + message.nanos = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Timestamp message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.Timestamp + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.Timestamp} Timestamp + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Timestamp.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Timestamp message. + * @function verify + * @memberof google.protobuf.Timestamp + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Timestamp.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.seconds != null && message.hasOwnProperty("seconds")) + if (!$util.isInteger(message.seconds) && !(message.seconds && $util.isInteger(message.seconds.low) && $util.isInteger(message.seconds.high))) + return "seconds: integer|Long expected"; + if (message.nanos != null && message.hasOwnProperty("nanos")) + if (!$util.isInteger(message.nanos)) + return "nanos: integer expected"; + return null; + }; + + /** + * Creates a Timestamp message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.Timestamp + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.Timestamp} Timestamp + */ + Timestamp.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.Timestamp) + return object; + var message = new $root.google.protobuf.Timestamp(); + if (object.seconds != null) + if ($util.Long) + (message.seconds = $util.Long.fromValue(object.seconds)).unsigned = false; + else if (typeof object.seconds === "string") + message.seconds = parseInt(object.seconds, 10); + else if (typeof object.seconds === "number") + message.seconds = object.seconds; + else if (typeof object.seconds === "object") + message.seconds = new $util.LongBits(object.seconds.low >>> 0, object.seconds.high >>> 0).toNumber(); + if (object.nanos != null) + message.nanos = object.nanos | 0; + return message; + }; + + /** + * Creates a plain object from a Timestamp message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.Timestamp + * @static + * @param {google.protobuf.Timestamp} message Timestamp + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Timestamp.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.seconds = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.seconds = options.longs === String ? "0" : 0; + object.nanos = 0; + } + if (message.seconds != null && message.hasOwnProperty("seconds")) + if (typeof message.seconds === "number") + object.seconds = options.longs === String ? String(message.seconds) : message.seconds; + else + object.seconds = options.longs === String ? $util.Long.prototype.toString.call(message.seconds) : options.longs === Number ? new $util.LongBits(message.seconds.low >>> 0, message.seconds.high >>> 0).toNumber() : message.seconds; + if (message.nanos != null && message.hasOwnProperty("nanos")) + object.nanos = message.nanos; + return object; + }; + + /** + * Converts this Timestamp to JSON. + * @function toJSON + * @memberof google.protobuf.Timestamp + * @instance + * @returns {Object.} JSON object + */ + Timestamp.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Timestamp + * @function getTypeUrl + * @memberof google.protobuf.Timestamp + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Timestamp.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.Timestamp"; + }; + + return Timestamp; + })(); + + protobuf.Empty = (function() { + + /** + * Properties of an Empty. + * @memberof google.protobuf + * @interface IEmpty + */ + + /** + * Constructs a new Empty. + * @memberof google.protobuf + * @classdesc Represents an Empty. + * @implements IEmpty + * @constructor + * @param {google.protobuf.IEmpty=} [properties] Properties to set + */ + function Empty(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Creates a new Empty instance using the specified properties. + * @function create + * @memberof google.protobuf.Empty + * @static + * @param {google.protobuf.IEmpty=} [properties] Properties to set + * @returns {google.protobuf.Empty} Empty instance + */ + Empty.create = function create(properties) { + return new Empty(properties); + }; + + /** + * Encodes the specified Empty message. Does not implicitly {@link google.protobuf.Empty.verify|verify} messages. + * @function encode + * @memberof google.protobuf.Empty + * @static + * @param {google.protobuf.IEmpty} message Empty message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Empty.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + return writer; + }; + + /** + * Encodes the specified Empty message, length delimited. Does not implicitly {@link google.protobuf.Empty.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.Empty + * @static + * @param {google.protobuf.IEmpty} message Empty message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Empty.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an Empty message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.Empty + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.Empty} Empty + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Empty.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.Empty(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an Empty message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.Empty + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.Empty} Empty + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Empty.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an Empty message. + * @function verify + * @memberof google.protobuf.Empty + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Empty.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + return null; + }; + + /** + * Creates an Empty message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.Empty + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.Empty} Empty + */ + Empty.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.Empty) + return object; + return new $root.google.protobuf.Empty(); + }; + + /** + * Creates a plain object from an Empty message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.Empty + * @static + * @param {google.protobuf.Empty} message Empty + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Empty.toObject = function toObject() { + return {}; + }; + + /** + * Converts this Empty to JSON. + * @function toJSON + * @memberof google.protobuf.Empty + * @instance + * @returns {Object.} JSON object + */ + Empty.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Empty + * @function getTypeUrl + * @memberof google.protobuf.Empty + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Empty.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.Empty"; + }; + + return Empty; + })(); + + protobuf.FieldMask = (function() { + + /** + * Properties of a FieldMask. + * @memberof google.protobuf + * @interface IFieldMask + * @property {Array.|null} [paths] FieldMask paths + */ + + /** + * Constructs a new FieldMask. + * @memberof google.protobuf + * @classdesc Represents a FieldMask. + * @implements IFieldMask + * @constructor + * @param {google.protobuf.IFieldMask=} [properties] Properties to set + */ + function FieldMask(properties) { + this.paths = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * FieldMask paths. + * @member {Array.} paths + * @memberof google.protobuf.FieldMask + * @instance + */ + FieldMask.prototype.paths = $util.emptyArray; + + /** + * Creates a new FieldMask instance using the specified properties. + * @function create + * @memberof google.protobuf.FieldMask + * @static + * @param {google.protobuf.IFieldMask=} [properties] Properties to set + * @returns {google.protobuf.FieldMask} FieldMask instance + */ + FieldMask.create = function create(properties) { + return new FieldMask(properties); + }; + + /** + * Encodes the specified FieldMask message. Does not implicitly {@link google.protobuf.FieldMask.verify|verify} messages. + * @function encode + * @memberof google.protobuf.FieldMask + * @static + * @param {google.protobuf.IFieldMask} message FieldMask message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FieldMask.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.paths != null && message.paths.length) + for (var i = 0; i < message.paths.length; ++i) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.paths[i]); + return writer; + }; + + /** + * Encodes the specified FieldMask message, length delimited. Does not implicitly {@link google.protobuf.FieldMask.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.FieldMask + * @static + * @param {google.protobuf.IFieldMask} message FieldMask message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FieldMask.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a FieldMask message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.FieldMask + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.FieldMask} FieldMask + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FieldMask.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.FieldMask(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.paths && message.paths.length)) + message.paths = []; + message.paths.push(reader.string()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a FieldMask message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.FieldMask + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.FieldMask} FieldMask + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FieldMask.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a FieldMask message. + * @function verify + * @memberof google.protobuf.FieldMask + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + FieldMask.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.paths != null && message.hasOwnProperty("paths")) { + if (!Array.isArray(message.paths)) + return "paths: array expected"; + for (var i = 0; i < message.paths.length; ++i) + if (!$util.isString(message.paths[i])) + return "paths: string[] expected"; + } + return null; + }; + + /** + * Creates a FieldMask message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.FieldMask + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.FieldMask} FieldMask + */ + FieldMask.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.FieldMask) + return object; + var message = new $root.google.protobuf.FieldMask(); + if (object.paths) { + if (!Array.isArray(object.paths)) + throw TypeError(".google.protobuf.FieldMask.paths: array expected"); + message.paths = []; + for (var i = 0; i < object.paths.length; ++i) + message.paths[i] = String(object.paths[i]); + } + return message; + }; + + /** + * Creates a plain object from a FieldMask message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.FieldMask + * @static + * @param {google.protobuf.FieldMask} message FieldMask + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + FieldMask.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.paths = []; + if (message.paths && message.paths.length) { + object.paths = []; + for (var j = 0; j < message.paths.length; ++j) + object.paths[j] = message.paths[j]; + } + return object; + }; + + /** + * Converts this FieldMask to JSON. + * @function toJSON + * @memberof google.protobuf.FieldMask + * @instance + * @returns {Object.} JSON object + */ + FieldMask.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for FieldMask + * @function getTypeUrl + * @memberof google.protobuf.FieldMask + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FieldMask.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.FieldMask"; + }; + + return FieldMask; + })(); + + return protobuf; + })(); + + return google; + })(); + + return $root; +}); diff --git a/packages/google-cloud-websecurityscanner/protos/protos.json b/packages/google-cloud-websecurityscanner/protos/protos.json new file mode 100644 index 00000000000..1aff34bb3d0 --- /dev/null +++ b/packages/google-cloud-websecurityscanner/protos/protos.json @@ -0,0 +1,4288 @@ +{ + "nested": { + "google": { + "nested": { + "cloud": { + "nested": { + "websecurityscanner": { + "nested": { + "v1": { + "options": { + "csharp_namespace": "Google.Cloud.WebSecurityScanner.V1", + "go_package": "google.golang.org/genproto/googleapis/cloud/websecurityscanner/v1;websecurityscanner", + "java_multiple_files": true, + "java_outer_classname": "WebSecurityScannerProto", + "java_package": "com.google.cloud.websecurityscanner.v1", + "php_namespace": "Google\\Cloud\\WebSecurityScanner\\V1", + "ruby_package": "Google::Cloud::WebSecurityScanner::V1" + }, + "nested": { + "CrawledUrl": { + "fields": { + "httpMethod": { + "type": "string", + "id": 1 + }, + "url": { + "type": "string", + "id": 2 + }, + "body": { + "type": "string", + "id": 3 + } + } + }, + "Finding": { + "options": { + "(google.api.resource).type": "websecurityscanner.googleapis.com/Finding", + "(google.api.resource).pattern": "projects/{project}/scanConfigs/{scan_config}/scanRuns/{scan_run}/findings/{finding}" + }, + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "findingType": { + "type": "string", + "id": 2 + }, + "severity": { + "type": "Severity", + "id": 17, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "httpMethod": { + "type": "string", + "id": 3 + }, + "fuzzedUrl": { + "type": "string", + "id": 4 + }, + "body": { + "type": "string", + "id": 5 + }, + "description": { + "type": "string", + "id": 6 + }, + "reproductionUrl": { + "type": "string", + "id": 7 + }, + "frameUrl": { + "type": "string", + "id": 8 + }, + "finalUrl": { + "type": "string", + "id": 9 + }, + "trackingId": { + "type": "string", + "id": 10 + }, + "form": { + "type": "Form", + "id": 16 + }, + "outdatedLibrary": { + "type": "OutdatedLibrary", + "id": 11 + }, + "violatingResource": { + "type": "ViolatingResource", + "id": 12 + }, + "vulnerableHeaders": { + "type": "VulnerableHeaders", + "id": 15 + }, + "vulnerableParameters": { + "type": "VulnerableParameters", + "id": 13 + }, + "xss": { + "type": "Xss", + "id": 14 + }, + "xxe": { + "type": "Xxe", + "id": 18, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + } + }, + "nested": { + "Severity": { + "values": { + "SEVERITY_UNSPECIFIED": 0, + "CRITICAL": 1, + "HIGH": 2, + "MEDIUM": 3, + "LOW": 4 + } + } + } + }, + "Form": { + "fields": { + "actionUri": { + "type": "string", + "id": 1 + }, + "fields": { + "rule": "repeated", + "type": "string", + "id": 2 + } + } + }, + "OutdatedLibrary": { + "fields": { + "libraryName": { + "type": "string", + "id": 1 + }, + "version": { + "type": "string", + "id": 2 + }, + "learnMoreUrls": { + "rule": "repeated", + "type": "string", + "id": 3 + } + } + }, + "ViolatingResource": { + "fields": { + "contentType": { + "type": "string", + "id": 1 + }, + "resourceUrl": { + "type": "string", + "id": 2 + } + } + }, + "VulnerableParameters": { + "fields": { + "parameterNames": { + "rule": "repeated", + "type": "string", + "id": 1 + } + } + }, + "VulnerableHeaders": { + "fields": { + "headers": { + "rule": "repeated", + "type": "Header", + "id": 1 + }, + "missingHeaders": { + "rule": "repeated", + "type": "Header", + "id": 2 + } + }, + "nested": { + "Header": { + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "value": { + "type": "string", + "id": 2 + } + } + } + } + }, + "Xss": { + "fields": { + "stackTraces": { + "rule": "repeated", + "type": "string", + "id": 1 + }, + "errorMessage": { + "type": "string", + "id": 2 + }, + "attackVector": { + "type": "AttackVector", + "id": 3 + }, + "storedXssSeedingUrl": { + "type": "string", + "id": 4 + } + }, + "nested": { + "AttackVector": { + "values": { + "ATTACK_VECTOR_UNSPECIFIED": 0, + "LOCAL_STORAGE": 1, + "SESSION_STORAGE": 2, + "WINDOW_NAME": 3, + "REFERRER": 4, + "FORM_INPUT": 5, + "COOKIE": 6, + "POST_MESSAGE": 7, + "GET_PARAMETERS": 8, + "URL_FRAGMENT": 9, + "HTML_COMMENT": 10, + "POST_PARAMETERS": 11, + "PROTOCOL": 12, + "STORED_XSS": 13, + "SAME_ORIGIN": 14, + "USER_CONTROLLABLE_URL": 15 + } + } + } + }, + "Xxe": { + "fields": { + "payloadValue": { + "type": "string", + "id": 1 + }, + "payloadLocation": { + "type": "Location", + "id": 2 + } + }, + "nested": { + "Location": { + "values": { + "LOCATION_UNSPECIFIED": 0, + "COMPLETE_REQUEST_BODY": 1 + } + } + } + }, + "FindingTypeStats": { + "fields": { + "findingType": { + "type": "string", + "id": 1 + }, + "findingCount": { + "type": "int32", + "id": 2 + } + } + }, + "ScanConfig": { + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "displayName": { + "type": "string", + "id": 2 + }, + "maxQps": { + "type": "int32", + "id": 3 + }, + "startingUrls": { + "rule": "repeated", + "type": "string", + "id": 4 + }, + "authentication": { + "type": "Authentication", + "id": 5 + }, + "userAgent": { + "type": "UserAgent", + "id": 6 + }, + "blacklistPatterns": { + "rule": "repeated", + "type": "string", + "id": 7 + }, + "schedule": { + "type": "Schedule", + "id": 8 + }, + "exportToSecurityCommandCenter": { + "type": "ExportToSecurityCommandCenter", + "id": 10 + }, + "riskLevel": { + "type": "RiskLevel", + "id": 12 + }, + "managedScan": { + "type": "bool", + "id": 13 + }, + "staticIpScan": { + "type": "bool", + "id": 14 + }, + "ignoreHttpStatusErrors": { + "type": "bool", + "id": 15 + } + }, + "nested": { + "Authentication": { + "oneofs": { + "authentication": { + "oneof": [ + "googleAccount", + "customAccount", + "iapCredential" + ] + } + }, + "fields": { + "googleAccount": { + "type": "GoogleAccount", + "id": 1, + "options": { + "deprecated": true + } + }, + "customAccount": { + "type": "CustomAccount", + "id": 2 + }, + "iapCredential": { + "type": "IapCredential", + "id": 4 + } + }, + "nested": { + "GoogleAccount": { + "options": { + "deprecated": true + }, + "fields": { + "username": { + "type": "string", + "id": 1 + }, + "password": { + "type": "string", + "id": 2 + } + } + }, + "CustomAccount": { + "fields": { + "username": { + "type": "string", + "id": 1 + }, + "password": { + "type": "string", + "id": 2 + }, + "loginUrl": { + "type": "string", + "id": 3 + } + } + }, + "IapCredential": { + "oneofs": { + "iapCredentials": { + "oneof": [ + "iapTestServiceAccountInfo" + ] + } + }, + "fields": { + "iapTestServiceAccountInfo": { + "type": "IapTestServiceAccountInfo", + "id": 1 + } + }, + "nested": { + "IapTestServiceAccountInfo": { + "fields": { + "targetAudienceClientId": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + } + } + } + } + }, + "Schedule": { + "fields": { + "scheduleTime": { + "type": "google.protobuf.Timestamp", + "id": 1 + }, + "intervalDurationDays": { + "type": "int32", + "id": 2 + } + } + }, + "UserAgent": { + "values": { + "USER_AGENT_UNSPECIFIED": 0, + "CHROME_LINUX": 1, + "CHROME_ANDROID": 2, + "SAFARI_IPHONE": 3 + } + }, + "RiskLevel": { + "values": { + "RISK_LEVEL_UNSPECIFIED": 0, + "NORMAL": 1, + "LOW": 2 + } + }, + "ExportToSecurityCommandCenter": { + "values": { + "EXPORT_TO_SECURITY_COMMAND_CENTER_UNSPECIFIED": 0, + "ENABLED": 1, + "DISABLED": 2 + } + } + } + }, + "ScanConfigError": { + "fields": { + "code": { + "type": "Code", + "id": 1 + }, + "fieldName": { + "type": "string", + "id": 2 + } + }, + "nested": { + "Code": { + "options": { + "allow_alias": true + }, + "values": { + "CODE_UNSPECIFIED": 0, + "OK": 0, + "INTERNAL_ERROR": 1, + "APPENGINE_API_BACKEND_ERROR": 2, + "APPENGINE_API_NOT_ACCESSIBLE": 3, + "APPENGINE_DEFAULT_HOST_MISSING": 4, + "CANNOT_USE_GOOGLE_COM_ACCOUNT": 6, + "CANNOT_USE_OWNER_ACCOUNT": 7, + "COMPUTE_API_BACKEND_ERROR": 8, + "COMPUTE_API_NOT_ACCESSIBLE": 9, + "CUSTOM_LOGIN_URL_DOES_NOT_BELONG_TO_CURRENT_PROJECT": 10, + "CUSTOM_LOGIN_URL_MALFORMED": 11, + "CUSTOM_LOGIN_URL_MAPPED_TO_NON_ROUTABLE_ADDRESS": 12, + "CUSTOM_LOGIN_URL_MAPPED_TO_UNRESERVED_ADDRESS": 13, + "CUSTOM_LOGIN_URL_HAS_NON_ROUTABLE_IP_ADDRESS": 14, + "CUSTOM_LOGIN_URL_HAS_UNRESERVED_IP_ADDRESS": 15, + "DUPLICATE_SCAN_NAME": 16, + "INVALID_FIELD_VALUE": 18, + "FAILED_TO_AUTHENTICATE_TO_TARGET": 19, + "FINDING_TYPE_UNSPECIFIED": 20, + "FORBIDDEN_TO_SCAN_COMPUTE": 21, + "FORBIDDEN_UPDATE_TO_MANAGED_SCAN": 43, + "MALFORMED_FILTER": 22, + "MALFORMED_RESOURCE_NAME": 23, + "PROJECT_INACTIVE": 24, + "REQUIRED_FIELD": 25, + "RESOURCE_NAME_INCONSISTENT": 26, + "SCAN_ALREADY_RUNNING": 27, + "SCAN_NOT_RUNNING": 28, + "SEED_URL_DOES_NOT_BELONG_TO_CURRENT_PROJECT": 29, + "SEED_URL_MALFORMED": 30, + "SEED_URL_MAPPED_TO_NON_ROUTABLE_ADDRESS": 31, + "SEED_URL_MAPPED_TO_UNRESERVED_ADDRESS": 32, + "SEED_URL_HAS_NON_ROUTABLE_IP_ADDRESS": 33, + "SEED_URL_HAS_UNRESERVED_IP_ADDRESS": 35, + "SERVICE_ACCOUNT_NOT_CONFIGURED": 36, + "TOO_MANY_SCANS": 37, + "UNABLE_TO_RESOLVE_PROJECT_INFO": 38, + "UNSUPPORTED_BLACKLIST_PATTERN_FORMAT": 39, + "UNSUPPORTED_FILTER": 40, + "UNSUPPORTED_FINDING_TYPE": 41, + "UNSUPPORTED_URL_SCHEME": 42 + } + } + } + }, + "ScanRun": { + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "executionState": { + "type": "ExecutionState", + "id": 2 + }, + "resultState": { + "type": "ResultState", + "id": 3 + }, + "startTime": { + "type": "google.protobuf.Timestamp", + "id": 4 + }, + "endTime": { + "type": "google.protobuf.Timestamp", + "id": 5 + }, + "urlsCrawledCount": { + "type": "int64", + "id": 6 + }, + "urlsTestedCount": { + "type": "int64", + "id": 7 + }, + "hasVulnerabilities": { + "type": "bool", + "id": 8 + }, + "progressPercent": { + "type": "int32", + "id": 9 + }, + "errorTrace": { + "type": "ScanRunErrorTrace", + "id": 10 + }, + "warningTraces": { + "rule": "repeated", + "type": "ScanRunWarningTrace", + "id": 11 + } + }, + "nested": { + "ExecutionState": { + "values": { + "EXECUTION_STATE_UNSPECIFIED": 0, + "QUEUED": 1, + "SCANNING": 2, + "FINISHED": 3 + } + }, + "ResultState": { + "values": { + "RESULT_STATE_UNSPECIFIED": 0, + "SUCCESS": 1, + "ERROR": 2, + "KILLED": 3 + } + } + } + }, + "ScanRunErrorTrace": { + "fields": { + "code": { + "type": "Code", + "id": 1 + }, + "scanConfigError": { + "type": "ScanConfigError", + "id": 2 + }, + "mostCommonHttpErrorCode": { + "type": "int32", + "id": 3 + } + }, + "nested": { + "Code": { + "values": { + "CODE_UNSPECIFIED": 0, + "INTERNAL_ERROR": 1, + "SCAN_CONFIG_ISSUE": 2, + "AUTHENTICATION_CONFIG_ISSUE": 3, + "TIMED_OUT_WHILE_SCANNING": 4, + "TOO_MANY_REDIRECTS": 5, + "TOO_MANY_HTTP_ERRORS": 6 + } + } + } + }, + "ScanRunWarningTrace": { + "fields": { + "code": { + "type": "Code", + "id": 1 + } + }, + "nested": { + "Code": { + "values": { + "CODE_UNSPECIFIED": 0, + "INSUFFICIENT_CRAWL_RESULTS": 1, + "TOO_MANY_CRAWL_RESULTS": 2, + "TOO_MANY_FUZZ_TASKS": 3, + "BLOCKED_BY_IAP": 4, + "NO_STARTING_URL_FOUND_FOR_MANAGED_SCAN": 5 + } + } + } + }, + "ScanRunLog": { + "fields": { + "summary": { + "type": "string", + "id": 1 + }, + "name": { + "type": "string", + "id": 2 + }, + "executionState": { + "type": "google.cloud.websecurityscanner.v1.ScanRun.ExecutionState", + "id": 3 + }, + "resultState": { + "type": "google.cloud.websecurityscanner.v1.ScanRun.ResultState", + "id": 4 + }, + "urlsCrawledCount": { + "type": "int64", + "id": 5 + }, + "urlsTestedCount": { + "type": "int64", + "id": 6 + }, + "hasFindings": { + "type": "bool", + "id": 7 + }, + "errorTrace": { + "type": "google.cloud.websecurityscanner.v1.ScanRunErrorTrace", + "id": 8 + } + } + }, + "WebSecurityScanner": { + "options": { + "(google.api.default_host)": "websecurityscanner.googleapis.com", + "(google.api.oauth_scopes)": "https://www.googleapis.com/auth/cloud-platform" + }, + "methods": { + "CreateScanConfig": { + "requestType": "CreateScanConfigRequest", + "responseType": "ScanConfig", + "options": { + "(google.api.http).post": "/v1/{parent=projects/*}/scanConfigs", + "(google.api.http).body": "scan_config" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1/{parent=projects/*}/scanConfigs", + "body": "scan_config" + } + } + ] + }, + "DeleteScanConfig": { + "requestType": "DeleteScanConfigRequest", + "responseType": "google.protobuf.Empty", + "options": { + "(google.api.http).delete": "/v1/{name=projects/*/scanConfigs/*}" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "delete": "/v1/{name=projects/*/scanConfigs/*}" + } + } + ] + }, + "GetScanConfig": { + "requestType": "GetScanConfigRequest", + "responseType": "ScanConfig", + "options": { + "(google.api.http).get": "/v1/{name=projects/*/scanConfigs/*}" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1/{name=projects/*/scanConfigs/*}" + } + } + ] + }, + "ListScanConfigs": { + "requestType": "ListScanConfigsRequest", + "responseType": "ListScanConfigsResponse", + "options": { + "(google.api.http).get": "/v1/{parent=projects/*}/scanConfigs" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1/{parent=projects/*}/scanConfigs" + } + } + ] + }, + "UpdateScanConfig": { + "requestType": "UpdateScanConfigRequest", + "responseType": "ScanConfig", + "options": { + "(google.api.http).patch": "/v1/{scan_config.name=projects/*/scanConfigs/*}", + "(google.api.http).body": "scan_config" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "patch": "/v1/{scan_config.name=projects/*/scanConfigs/*}", + "body": "scan_config" + } + } + ] + }, + "StartScanRun": { + "requestType": "StartScanRunRequest", + "responseType": "ScanRun", + "options": { + "(google.api.http).post": "/v1/{name=projects/*/scanConfigs/*}:start", + "(google.api.http).body": "*" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1/{name=projects/*/scanConfigs/*}:start", + "body": "*" + } + } + ] + }, + "GetScanRun": { + "requestType": "GetScanRunRequest", + "responseType": "ScanRun", + "options": { + "(google.api.http).get": "/v1/{name=projects/*/scanConfigs/*/scanRuns/*}" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1/{name=projects/*/scanConfigs/*/scanRuns/*}" + } + } + ] + }, + "ListScanRuns": { + "requestType": "ListScanRunsRequest", + "responseType": "ListScanRunsResponse", + "options": { + "(google.api.http).get": "/v1/{parent=projects/*/scanConfigs/*}/scanRuns" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1/{parent=projects/*/scanConfigs/*}/scanRuns" + } + } + ] + }, + "StopScanRun": { + "requestType": "StopScanRunRequest", + "responseType": "ScanRun", + "options": { + "(google.api.http).post": "/v1/{name=projects/*/scanConfigs/*/scanRuns/*}:stop", + "(google.api.http).body": "*" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1/{name=projects/*/scanConfigs/*/scanRuns/*}:stop", + "body": "*" + } + } + ] + }, + "ListCrawledUrls": { + "requestType": "ListCrawledUrlsRequest", + "responseType": "ListCrawledUrlsResponse", + "options": { + "(google.api.http).get": "/v1/{parent=projects/*/scanConfigs/*/scanRuns/*}/crawledUrls" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1/{parent=projects/*/scanConfigs/*/scanRuns/*}/crawledUrls" + } + } + ] + }, + "GetFinding": { + "requestType": "GetFindingRequest", + "responseType": "Finding", + "options": { + "(google.api.http).get": "/v1/{name=projects/*/scanConfigs/*/scanRuns/*/findings/*}" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1/{name=projects/*/scanConfigs/*/scanRuns/*/findings/*}" + } + } + ] + }, + "ListFindings": { + "requestType": "ListFindingsRequest", + "responseType": "ListFindingsResponse", + "options": { + "(google.api.http).get": "/v1/{parent=projects/*/scanConfigs/*/scanRuns/*}/findings" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1/{parent=projects/*/scanConfigs/*/scanRuns/*}/findings" + } + } + ] + }, + "ListFindingTypeStats": { + "requestType": "ListFindingTypeStatsRequest", + "responseType": "ListFindingTypeStatsResponse", + "options": { + "(google.api.http).get": "/v1/{parent=projects/*/scanConfigs/*/scanRuns/*}/findingTypeStats" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1/{parent=projects/*/scanConfigs/*/scanRuns/*}/findingTypeStats" + } + } + ] + } + } + }, + "CreateScanConfigRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1 + }, + "scanConfig": { + "type": "ScanConfig", + "id": 2 + } + } + }, + "DeleteScanConfigRequest": { + "fields": { + "name": { + "type": "string", + "id": 1 + } + } + }, + "GetScanConfigRequest": { + "fields": { + "name": { + "type": "string", + "id": 1 + } + } + }, + "ListScanConfigsRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1 + }, + "pageToken": { + "type": "string", + "id": 2 + }, + "pageSize": { + "type": "int32", + "id": 3 + } + } + }, + "UpdateScanConfigRequest": { + "fields": { + "scanConfig": { + "type": "ScanConfig", + "id": 2 + }, + "updateMask": { + "type": "google.protobuf.FieldMask", + "id": 3 + } + } + }, + "ListScanConfigsResponse": { + "fields": { + "scanConfigs": { + "rule": "repeated", + "type": "ScanConfig", + "id": 1 + }, + "nextPageToken": { + "type": "string", + "id": 2 + } + } + }, + "StartScanRunRequest": { + "fields": { + "name": { + "type": "string", + "id": 1 + } + } + }, + "GetScanRunRequest": { + "fields": { + "name": { + "type": "string", + "id": 1 + } + } + }, + "ListScanRunsRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1 + }, + "pageToken": { + "type": "string", + "id": 2 + }, + "pageSize": { + "type": "int32", + "id": 3 + } + } + }, + "ListScanRunsResponse": { + "fields": { + "scanRuns": { + "rule": "repeated", + "type": "ScanRun", + "id": 1 + }, + "nextPageToken": { + "type": "string", + "id": 2 + } + } + }, + "StopScanRunRequest": { + "fields": { + "name": { + "type": "string", + "id": 1 + } + } + }, + "ListCrawledUrlsRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1 + }, + "pageToken": { + "type": "string", + "id": 2 + }, + "pageSize": { + "type": "int32", + "id": 3 + } + } + }, + "ListCrawledUrlsResponse": { + "fields": { + "crawledUrls": { + "rule": "repeated", + "type": "CrawledUrl", + "id": 1 + }, + "nextPageToken": { + "type": "string", + "id": 2 + } + } + }, + "GetFindingRequest": { + "fields": { + "name": { + "type": "string", + "id": 1 + } + } + }, + "ListFindingsRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1 + }, + "filter": { + "type": "string", + "id": 2 + }, + "pageToken": { + "type": "string", + "id": 3 + }, + "pageSize": { + "type": "int32", + "id": 4 + } + } + }, + "ListFindingsResponse": { + "fields": { + "findings": { + "rule": "repeated", + "type": "Finding", + "id": 1 + }, + "nextPageToken": { + "type": "string", + "id": 2 + } + } + }, + "ListFindingTypeStatsRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1 + } + } + }, + "ListFindingTypeStatsResponse": { + "fields": { + "findingTypeStats": { + "rule": "repeated", + "type": "FindingTypeStats", + "id": 1 + } + } + } + } + }, + "v1alpha": { + "options": { + "go_package": "google.golang.org/genproto/googleapis/cloud/websecurityscanner/v1alpha;websecurityscanner", + "java_multiple_files": true, + "java_outer_classname": "WebSecurityScannerProto", + "java_package": "com.google.cloud.websecurityscanner.v1alpha" + }, + "nested": { + "CrawledUrl": { + "fields": { + "httpMethod": { + "type": "string", + "id": 1 + }, + "url": { + "type": "string", + "id": 2 + }, + "body": { + "type": "string", + "id": 3 + } + } + }, + "Finding": { + "options": { + "(google.api.resource).type": "websecurityscanner.googleapis.com/Finding", + "(google.api.resource).pattern": "projects/{project}/scanConfigs/{scan_config}/scanRuns/{scan_run}/findings/{finding}" + }, + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "findingType": { + "type": "FindingType", + "id": 2 + }, + "httpMethod": { + "type": "string", + "id": 3 + }, + "fuzzedUrl": { + "type": "string", + "id": 4 + }, + "body": { + "type": "string", + "id": 5 + }, + "description": { + "type": "string", + "id": 6 + }, + "reproductionUrl": { + "type": "string", + "id": 7 + }, + "frameUrl": { + "type": "string", + "id": 8 + }, + "finalUrl": { + "type": "string", + "id": 9 + }, + "trackingId": { + "type": "string", + "id": 10 + }, + "outdatedLibrary": { + "type": "OutdatedLibrary", + "id": 11 + }, + "violatingResource": { + "type": "ViolatingResource", + "id": 12 + }, + "vulnerableHeaders": { + "type": "VulnerableHeaders", + "id": 15 + }, + "vulnerableParameters": { + "type": "VulnerableParameters", + "id": 13 + }, + "xss": { + "type": "Xss", + "id": 14 + } + }, + "nested": { + "FindingType": { + "values": { + "FINDING_TYPE_UNSPECIFIED": 0, + "MIXED_CONTENT": 1, + "OUTDATED_LIBRARY": 2, + "ROSETTA_FLASH": 5, + "XSS_CALLBACK": 3, + "XSS_ERROR": 4, + "CLEAR_TEXT_PASSWORD": 6, + "INVALID_CONTENT_TYPE": 7, + "XSS_ANGULAR_CALLBACK": 8, + "INVALID_HEADER": 9, + "MISSPELLED_SECURITY_HEADER_NAME": 10, + "MISMATCHING_SECURITY_HEADER_VALUES": 11 + } + } + } + }, + "OutdatedLibrary": { + "fields": { + "libraryName": { + "type": "string", + "id": 1 + }, + "version": { + "type": "string", + "id": 2 + }, + "learnMoreUrls": { + "rule": "repeated", + "type": "string", + "id": 3 + } + } + }, + "ViolatingResource": { + "fields": { + "contentType": { + "type": "string", + "id": 1 + }, + "resourceUrl": { + "type": "string", + "id": 2 + } + } + }, + "VulnerableParameters": { + "fields": { + "parameterNames": { + "rule": "repeated", + "type": "string", + "id": 1 + } + } + }, + "VulnerableHeaders": { + "fields": { + "headers": { + "rule": "repeated", + "type": "Header", + "id": 1 + }, + "missingHeaders": { + "rule": "repeated", + "type": "Header", + "id": 2 + } + }, + "nested": { + "Header": { + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "value": { + "type": "string", + "id": 2 + } + } + } + } + }, + "Xss": { + "fields": { + "stackTraces": { + "rule": "repeated", + "type": "string", + "id": 1 + }, + "errorMessage": { + "type": "string", + "id": 2 + } + } + }, + "FindingTypeStats": { + "fields": { + "findingType": { + "type": "Finding.FindingType", + "id": 1 + }, + "findingCount": { + "type": "int32", + "id": 2 + } + } + }, + "ScanConfig": { + "options": { + "(google.api.resource).type": "websecurityscanner.googleapis.com/ScanConfig", + "(google.api.resource).pattern": "projects/{project}/scanConfigs/{scan_config}" + }, + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "displayName": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "maxQps": { + "type": "int32", + "id": 3 + }, + "startingUrls": { + "rule": "repeated", + "type": "string", + "id": 4, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "authentication": { + "type": "Authentication", + "id": 5 + }, + "userAgent": { + "type": "UserAgent", + "id": 6 + }, + "blacklistPatterns": { + "rule": "repeated", + "type": "string", + "id": 7 + }, + "schedule": { + "type": "Schedule", + "id": 8 + }, + "targetPlatforms": { + "rule": "repeated", + "type": "TargetPlatform", + "id": 9 + }, + "latestRun": { + "type": "ScanRun", + "id": 11 + } + }, + "nested": { + "Authentication": { + "oneofs": { + "authentication": { + "oneof": [ + "googleAccount", + "customAccount" + ] + } + }, + "fields": { + "googleAccount": { + "type": "GoogleAccount", + "id": 1 + }, + "customAccount": { + "type": "CustomAccount", + "id": 2 + } + }, + "nested": { + "GoogleAccount": { + "fields": { + "username": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "password": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "INPUT_ONLY" + } + } + } + }, + "CustomAccount": { + "fields": { + "username": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "password": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "INPUT_ONLY" + } + }, + "loginUrl": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + } + } + }, + "Schedule": { + "fields": { + "scheduleTime": { + "type": "google.protobuf.Timestamp", + "id": 1 + }, + "intervalDurationDays": { + "type": "int32", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "UserAgent": { + "values": { + "USER_AGENT_UNSPECIFIED": 0, + "CHROME_LINUX": 1, + "CHROME_ANDROID": 2, + "SAFARI_IPHONE": 3 + } + }, + "TargetPlatform": { + "values": { + "TARGET_PLATFORM_UNSPECIFIED": 0, + "APP_ENGINE": 1, + "COMPUTE": 2 + } + } + } + }, + "ScanRun": { + "options": { + "(google.api.resource).type": "websecurityscanner.googleapis.com/ScanRun", + "(google.api.resource).pattern": "projects/{project}/scanConfigs/{scan_config}/scanRuns/{scan_run}" + }, + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "executionState": { + "type": "ExecutionState", + "id": 2 + }, + "resultState": { + "type": "ResultState", + "id": 3 + }, + "startTime": { + "type": "google.protobuf.Timestamp", + "id": 4 + }, + "endTime": { + "type": "google.protobuf.Timestamp", + "id": 5 + }, + "urlsCrawledCount": { + "type": "int64", + "id": 6 + }, + "urlsTestedCount": { + "type": "int64", + "id": 7 + }, + "hasVulnerabilities": { + "type": "bool", + "id": 8 + }, + "progressPercent": { + "type": "int32", + "id": 9 + } + }, + "nested": { + "ExecutionState": { + "values": { + "EXECUTION_STATE_UNSPECIFIED": 0, + "QUEUED": 1, + "SCANNING": 2, + "FINISHED": 3 + } + }, + "ResultState": { + "values": { + "RESULT_STATE_UNSPECIFIED": 0, + "SUCCESS": 1, + "ERROR": 2, + "KILLED": 3 + } + } + } + }, + "WebSecurityScanner": { + "options": { + "(google.api.default_host)": "websecurityscanner.googleapis.com", + "(google.api.oauth_scopes)": "https://www.googleapis.com/auth/cloud-platform" + }, + "methods": { + "CreateScanConfig": { + "requestType": "CreateScanConfigRequest", + "responseType": "ScanConfig", + "options": { + "(google.api.http).post": "/v1alpha/{parent=projects/*}/scanConfigs", + "(google.api.http).body": "scan_config", + "(google.api.method_signature)": "parent,scan_config" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1alpha/{parent=projects/*}/scanConfigs", + "body": "scan_config" + } + }, + { + "(google.api.method_signature)": "parent,scan_config" + } + ] + }, + "DeleteScanConfig": { + "requestType": "DeleteScanConfigRequest", + "responseType": "google.protobuf.Empty", + "options": { + "(google.api.http).delete": "/v1alpha/{name=projects/*/scanConfigs/*}", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "delete": "/v1alpha/{name=projects/*/scanConfigs/*}" + } + }, + { + "(google.api.method_signature)": "name" + } + ] + }, + "GetScanConfig": { + "requestType": "GetScanConfigRequest", + "responseType": "ScanConfig", + "options": { + "(google.api.http).get": "/v1alpha/{name=projects/*/scanConfigs/*}", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1alpha/{name=projects/*/scanConfigs/*}" + } + }, + { + "(google.api.method_signature)": "name" + } + ] + }, + "ListScanConfigs": { + "requestType": "ListScanConfigsRequest", + "responseType": "ListScanConfigsResponse", + "options": { + "(google.api.http).get": "/v1alpha/{parent=projects/*}/scanConfigs", + "(google.api.method_signature)": "parent" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1alpha/{parent=projects/*}/scanConfigs" + } + }, + { + "(google.api.method_signature)": "parent" + } + ] + }, + "UpdateScanConfig": { + "requestType": "UpdateScanConfigRequest", + "responseType": "ScanConfig", + "options": { + "(google.api.http).patch": "/v1alpha/{scan_config.name=projects/*/scanConfigs/*}", + "(google.api.http).body": "scan_config", + "(google.api.method_signature)": "scan_config,update_mask" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "patch": "/v1alpha/{scan_config.name=projects/*/scanConfigs/*}", + "body": "scan_config" + } + }, + { + "(google.api.method_signature)": "scan_config,update_mask" + } + ] + }, + "StartScanRun": { + "requestType": "StartScanRunRequest", + "responseType": "ScanRun", + "options": { + "(google.api.http).post": "/v1alpha/{name=projects/*/scanConfigs/*}:start", + "(google.api.http).body": "*", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1alpha/{name=projects/*/scanConfigs/*}:start", + "body": "*" + } + }, + { + "(google.api.method_signature)": "name" + } + ] + }, + "GetScanRun": { + "requestType": "GetScanRunRequest", + "responseType": "ScanRun", + "options": { + "(google.api.http).get": "/v1alpha/{name=projects/*/scanConfigs/*/scanRuns/*}", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1alpha/{name=projects/*/scanConfigs/*/scanRuns/*}" + } + }, + { + "(google.api.method_signature)": "name" + } + ] + }, + "ListScanRuns": { + "requestType": "ListScanRunsRequest", + "responseType": "ListScanRunsResponse", + "options": { + "(google.api.http).get": "/v1alpha/{parent=projects/*/scanConfigs/*}/scanRuns", + "(google.api.method_signature)": "parent" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1alpha/{parent=projects/*/scanConfigs/*}/scanRuns" + } + }, + { + "(google.api.method_signature)": "parent" + } + ] + }, + "StopScanRun": { + "requestType": "StopScanRunRequest", + "responseType": "ScanRun", + "options": { + "(google.api.http).post": "/v1alpha/{name=projects/*/scanConfigs/*/scanRuns/*}:stop", + "(google.api.http).body": "*", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1alpha/{name=projects/*/scanConfigs/*/scanRuns/*}:stop", + "body": "*" + } + }, + { + "(google.api.method_signature)": "name" + } + ] + }, + "ListCrawledUrls": { + "requestType": "ListCrawledUrlsRequest", + "responseType": "ListCrawledUrlsResponse", + "options": { + "(google.api.http).get": "/v1alpha/{parent=projects/*/scanConfigs/*/scanRuns/*}/crawledUrls", + "(google.api.method_signature)": "parent" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1alpha/{parent=projects/*/scanConfigs/*/scanRuns/*}/crawledUrls" + } + }, + { + "(google.api.method_signature)": "parent" + } + ] + }, + "GetFinding": { + "requestType": "GetFindingRequest", + "responseType": "Finding", + "options": { + "(google.api.http).get": "/v1alpha/{name=projects/*/scanConfigs/*/scanRuns/*/findings/*}", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1alpha/{name=projects/*/scanConfigs/*/scanRuns/*/findings/*}" + } + }, + { + "(google.api.method_signature)": "name" + } + ] + }, + "ListFindings": { + "requestType": "ListFindingsRequest", + "responseType": "ListFindingsResponse", + "options": { + "(google.api.http).get": "/v1alpha/{parent=projects/*/scanConfigs/*/scanRuns/*}/findings", + "(google.api.method_signature)": "parent,filter" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1alpha/{parent=projects/*/scanConfigs/*/scanRuns/*}/findings" + } + }, + { + "(google.api.method_signature)": "parent,filter" + } + ] + }, + "ListFindingTypeStats": { + "requestType": "ListFindingTypeStatsRequest", + "responseType": "ListFindingTypeStatsResponse", + "options": { + "(google.api.http).get": "/v1alpha/{parent=projects/*/scanConfigs/*/scanRuns/*}/findingTypeStats", + "(google.api.method_signature)": "parent" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1alpha/{parent=projects/*/scanConfigs/*/scanRuns/*}/findingTypeStats" + } + }, + { + "(google.api.method_signature)": "parent" + } + ] + } + } + }, + "CreateScanConfigRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "cloudresourcemanager.googleapis.com/Project" + } + }, + "scanConfig": { + "type": "ScanConfig", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "DeleteScanConfigRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "websecurityscanner.googleapis.com/ScanConfig" + } + } + } + }, + "GetScanConfigRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "websecurityscanner.googleapis.com/ScanConfig" + } + } + } + }, + "ListScanConfigsRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "cloudresourcemanager.googleapis.com/Project" + } + }, + "pageToken": { + "type": "string", + "id": 2 + }, + "pageSize": { + "type": "int32", + "id": 3 + } + } + }, + "UpdateScanConfigRequest": { + "fields": { + "scanConfig": { + "type": "ScanConfig", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "updateMask": { + "type": "google.protobuf.FieldMask", + "id": 3, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "ListScanConfigsResponse": { + "fields": { + "scanConfigs": { + "rule": "repeated", + "type": "ScanConfig", + "id": 1 + }, + "nextPageToken": { + "type": "string", + "id": 2 + } + } + }, + "StartScanRunRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "websecurityscanner.googleapis.com/ScanConfig" + } + } + } + }, + "GetScanRunRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "websecurityscanner.googleapis.com/ScanRun" + } + } + } + }, + "ListScanRunsRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "websecurityscanner.googleapis.com/ScanConfig" + } + }, + "pageToken": { + "type": "string", + "id": 2 + }, + "pageSize": { + "type": "int32", + "id": 3 + } + } + }, + "ListScanRunsResponse": { + "fields": { + "scanRuns": { + "rule": "repeated", + "type": "ScanRun", + "id": 1 + }, + "nextPageToken": { + "type": "string", + "id": 2 + } + } + }, + "StopScanRunRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "websecurityscanner.googleapis.com/ScanRun" + } + } + } + }, + "ListCrawledUrlsRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "websecurityscanner.googleapis.com/ScanRun" + } + }, + "pageToken": { + "type": "string", + "id": 2 + }, + "pageSize": { + "type": "int32", + "id": 3 + } + } + }, + "ListCrawledUrlsResponse": { + "fields": { + "crawledUrls": { + "rule": "repeated", + "type": "CrawledUrl", + "id": 1 + }, + "nextPageToken": { + "type": "string", + "id": 2 + } + } + }, + "GetFindingRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "websecurityscanner.googleapis.com/Finding" + } + } + } + }, + "ListFindingsRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "websecurityscanner.googleapis.com/ScanRun" + } + }, + "filter": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "pageToken": { + "type": "string", + "id": 3 + }, + "pageSize": { + "type": "int32", + "id": 4 + } + } + }, + "ListFindingsResponse": { + "fields": { + "findings": { + "rule": "repeated", + "type": "Finding", + "id": 1 + }, + "nextPageToken": { + "type": "string", + "id": 2 + } + } + }, + "ListFindingTypeStatsRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "websecurityscanner.googleapis.com/ScanRun" + } + } + } + }, + "ListFindingTypeStatsResponse": { + "fields": { + "findingTypeStats": { + "rule": "repeated", + "type": "FindingTypeStats", + "id": 1 + } + } + } + } + }, + "v1beta": { + "options": { + "csharp_namespace": "Google.Cloud.WebSecurityScanner.V1Beta", + "go_package": "google.golang.org/genproto/googleapis/cloud/websecurityscanner/v1beta;websecurityscanner", + "java_multiple_files": true, + "java_outer_classname": "WebSecurityScannerProto", + "java_package": "com.google.cloud.websecurityscanner.v1beta", + "php_namespace": "Google\\Cloud\\WebSecurityScanner\\V1beta", + "ruby_package": "Google::Cloud::WebSecurityScanner::V1beta" + }, + "nested": { + "CrawledUrl": { + "fields": { + "httpMethod": { + "type": "string", + "id": 1 + }, + "url": { + "type": "string", + "id": 2 + }, + "body": { + "type": "string", + "id": 3 + } + } + }, + "Finding": { + "options": { + "(google.api.resource).type": "websecurityscanner.googleapis.com/Finding", + "(google.api.resource).pattern": "projects/{project}/scanConfigs/{scan_config}/scanRuns/{scan_run}/findings/{finding}" + }, + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "findingType": { + "type": "string", + "id": 2 + }, + "httpMethod": { + "type": "string", + "id": 3 + }, + "fuzzedUrl": { + "type": "string", + "id": 4 + }, + "body": { + "type": "string", + "id": 5 + }, + "description": { + "type": "string", + "id": 6 + }, + "reproductionUrl": { + "type": "string", + "id": 7 + }, + "frameUrl": { + "type": "string", + "id": 8 + }, + "finalUrl": { + "type": "string", + "id": 9 + }, + "trackingId": { + "type": "string", + "id": 10 + }, + "form": { + "type": "Form", + "id": 16 + }, + "outdatedLibrary": { + "type": "OutdatedLibrary", + "id": 11 + }, + "violatingResource": { + "type": "ViolatingResource", + "id": 12 + }, + "vulnerableHeaders": { + "type": "VulnerableHeaders", + "id": 15 + }, + "vulnerableParameters": { + "type": "VulnerableParameters", + "id": 13 + }, + "xss": { + "type": "Xss", + "id": 14 + } + } + }, + "Form": { + "fields": { + "actionUri": { + "type": "string", + "id": 1 + }, + "fields": { + "rule": "repeated", + "type": "string", + "id": 2 + } + } + }, + "OutdatedLibrary": { + "fields": { + "libraryName": { + "type": "string", + "id": 1 + }, + "version": { + "type": "string", + "id": 2 + }, + "learnMoreUrls": { + "rule": "repeated", + "type": "string", + "id": 3 + } + } + }, + "ViolatingResource": { + "fields": { + "contentType": { + "type": "string", + "id": 1 + }, + "resourceUrl": { + "type": "string", + "id": 2 + } + } + }, + "VulnerableParameters": { + "fields": { + "parameterNames": { + "rule": "repeated", + "type": "string", + "id": 1 + } + } + }, + "VulnerableHeaders": { + "fields": { + "headers": { + "rule": "repeated", + "type": "Header", + "id": 1 + }, + "missingHeaders": { + "rule": "repeated", + "type": "Header", + "id": 2 + } + }, + "nested": { + "Header": { + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "value": { + "type": "string", + "id": 2 + } + } + } + } + }, + "Xss": { + "fields": { + "stackTraces": { + "rule": "repeated", + "type": "string", + "id": 1 + }, + "errorMessage": { + "type": "string", + "id": 2 + } + } + }, + "FindingTypeStats": { + "fields": { + "findingType": { + "type": "string", + "id": 1 + }, + "findingCount": { + "type": "int32", + "id": 2 + } + } + }, + "ScanConfig": { + "options": { + "(google.api.resource).type": "websecurityscanner.googleapis.com/ScanConfig", + "(google.api.resource).pattern": "projects/{project}/scanConfigs/{scan_config}" + }, + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "displayName": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "maxQps": { + "type": "int32", + "id": 3 + }, + "startingUrls": { + "rule": "repeated", + "type": "string", + "id": 4, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "authentication": { + "type": "Authentication", + "id": 5 + }, + "userAgent": { + "type": "UserAgent", + "id": 6 + }, + "blacklistPatterns": { + "rule": "repeated", + "type": "string", + "id": 7 + }, + "schedule": { + "type": "Schedule", + "id": 8 + }, + "targetPlatforms": { + "rule": "repeated", + "type": "TargetPlatform", + "id": 9 + }, + "exportToSecurityCommandCenter": { + "type": "ExportToSecurityCommandCenter", + "id": 10 + }, + "latestRun": { + "type": "ScanRun", + "id": 11 + }, + "riskLevel": { + "type": "RiskLevel", + "id": 12 + } + }, + "nested": { + "Authentication": { + "oneofs": { + "authentication": { + "oneof": [ + "googleAccount", + "customAccount" + ] + } + }, + "fields": { + "googleAccount": { + "type": "GoogleAccount", + "id": 1 + }, + "customAccount": { + "type": "CustomAccount", + "id": 2 + } + }, + "nested": { + "GoogleAccount": { + "fields": { + "username": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "password": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "INPUT_ONLY" + } + } + } + }, + "CustomAccount": { + "fields": { + "username": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "password": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "INPUT_ONLY" + } + }, + "loginUrl": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + } + } + }, + "Schedule": { + "fields": { + "scheduleTime": { + "type": "google.protobuf.Timestamp", + "id": 1 + }, + "intervalDurationDays": { + "type": "int32", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "UserAgent": { + "values": { + "USER_AGENT_UNSPECIFIED": 0, + "CHROME_LINUX": 1, + "CHROME_ANDROID": 2, + "SAFARI_IPHONE": 3 + } + }, + "TargetPlatform": { + "values": { + "TARGET_PLATFORM_UNSPECIFIED": 0, + "APP_ENGINE": 1, + "COMPUTE": 2 + } + }, + "RiskLevel": { + "values": { + "RISK_LEVEL_UNSPECIFIED": 0, + "NORMAL": 1, + "LOW": 2 + } + }, + "ExportToSecurityCommandCenter": { + "values": { + "EXPORT_TO_SECURITY_COMMAND_CENTER_UNSPECIFIED": 0, + "ENABLED": 1, + "DISABLED": 2 + } + } + } + }, + "ScanRun": { + "options": { + "(google.api.resource).type": "websecurityscanner.googleapis.com/ScanRun", + "(google.api.resource).pattern": "projects/{project}/scanConfigs/{scan_config}/scanRuns/{scan_run}" + }, + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "executionState": { + "type": "ExecutionState", + "id": 2 + }, + "resultState": { + "type": "ResultState", + "id": 3 + }, + "startTime": { + "type": "google.protobuf.Timestamp", + "id": 4 + }, + "endTime": { + "type": "google.protobuf.Timestamp", + "id": 5 + }, + "urlsCrawledCount": { + "type": "int64", + "id": 6 + }, + "urlsTestedCount": { + "type": "int64", + "id": 7 + }, + "hasVulnerabilities": { + "type": "bool", + "id": 8 + }, + "progressPercent": { + "type": "int32", + "id": 9 + }, + "errorTrace": { + "type": "ScanRunErrorTrace", + "id": 10 + }, + "warningTraces": { + "rule": "repeated", + "type": "ScanRunWarningTrace", + "id": 11 + } + }, + "nested": { + "ExecutionState": { + "values": { + "EXECUTION_STATE_UNSPECIFIED": 0, + "QUEUED": 1, + "SCANNING": 2, + "FINISHED": 3 + } + }, + "ResultState": { + "values": { + "RESULT_STATE_UNSPECIFIED": 0, + "SUCCESS": 1, + "ERROR": 2, + "KILLED": 3 + } + } + } + }, + "ScanRunErrorTrace": { + "fields": { + "code": { + "type": "Code", + "id": 1 + }, + "scanConfigError": { + "type": "ScanConfigError", + "id": 2 + }, + "mostCommonHttpErrorCode": { + "type": "int32", + "id": 3 + } + }, + "nested": { + "Code": { + "values": { + "CODE_UNSPECIFIED": 0, + "INTERNAL_ERROR": 1, + "SCAN_CONFIG_ISSUE": 2, + "AUTHENTICATION_CONFIG_ISSUE": 3, + "TIMED_OUT_WHILE_SCANNING": 4, + "TOO_MANY_REDIRECTS": 5, + "TOO_MANY_HTTP_ERRORS": 6 + } + } + } + }, + "ScanConfigError": { + "fields": { + "code": { + "type": "Code", + "id": 1 + }, + "fieldName": { + "type": "string", + "id": 2 + } + }, + "nested": { + "Code": { + "options": { + "allow_alias": true + }, + "values": { + "CODE_UNSPECIFIED": 0, + "OK": 0, + "INTERNAL_ERROR": 1, + "APPENGINE_API_BACKEND_ERROR": 2, + "APPENGINE_API_NOT_ACCESSIBLE": 3, + "APPENGINE_DEFAULT_HOST_MISSING": 4, + "CANNOT_USE_GOOGLE_COM_ACCOUNT": 6, + "CANNOT_USE_OWNER_ACCOUNT": 7, + "COMPUTE_API_BACKEND_ERROR": 8, + "COMPUTE_API_NOT_ACCESSIBLE": 9, + "CUSTOM_LOGIN_URL_DOES_NOT_BELONG_TO_CURRENT_PROJECT": 10, + "CUSTOM_LOGIN_URL_MALFORMED": 11, + "CUSTOM_LOGIN_URL_MAPPED_TO_NON_ROUTABLE_ADDRESS": 12, + "CUSTOM_LOGIN_URL_MAPPED_TO_UNRESERVED_ADDRESS": 13, + "CUSTOM_LOGIN_URL_HAS_NON_ROUTABLE_IP_ADDRESS": 14, + "CUSTOM_LOGIN_URL_HAS_UNRESERVED_IP_ADDRESS": 15, + "DUPLICATE_SCAN_NAME": 16, + "INVALID_FIELD_VALUE": 18, + "FAILED_TO_AUTHENTICATE_TO_TARGET": 19, + "FINDING_TYPE_UNSPECIFIED": 20, + "FORBIDDEN_TO_SCAN_COMPUTE": 21, + "FORBIDDEN_UPDATE_TO_MANAGED_SCAN": 43, + "MALFORMED_FILTER": 22, + "MALFORMED_RESOURCE_NAME": 23, + "PROJECT_INACTIVE": 24, + "REQUIRED_FIELD": 25, + "RESOURCE_NAME_INCONSISTENT": 26, + "SCAN_ALREADY_RUNNING": 27, + "SCAN_NOT_RUNNING": 28, + "SEED_URL_DOES_NOT_BELONG_TO_CURRENT_PROJECT": 29, + "SEED_URL_MALFORMED": 30, + "SEED_URL_MAPPED_TO_NON_ROUTABLE_ADDRESS": 31, + "SEED_URL_MAPPED_TO_UNRESERVED_ADDRESS": 32, + "SEED_URL_HAS_NON_ROUTABLE_IP_ADDRESS": 33, + "SEED_URL_HAS_UNRESERVED_IP_ADDRESS": 35, + "SERVICE_ACCOUNT_NOT_CONFIGURED": 36, + "TOO_MANY_SCANS": 37, + "UNABLE_TO_RESOLVE_PROJECT_INFO": 38, + "UNSUPPORTED_BLACKLIST_PATTERN_FORMAT": 39, + "UNSUPPORTED_FILTER": 40, + "UNSUPPORTED_FINDING_TYPE": 41, + "UNSUPPORTED_URL_SCHEME": 42 + } + } + } + }, + "ScanRunWarningTrace": { + "fields": { + "code": { + "type": "Code", + "id": 1 + } + }, + "nested": { + "Code": { + "values": { + "CODE_UNSPECIFIED": 0, + "INSUFFICIENT_CRAWL_RESULTS": 1, + "TOO_MANY_CRAWL_RESULTS": 2, + "TOO_MANY_FUZZ_TASKS": 3, + "BLOCKED_BY_IAP": 4 + } + } + } + }, + "WebSecurityScanner": { + "options": { + "(google.api.default_host)": "websecurityscanner.googleapis.com", + "(google.api.oauth_scopes)": "https://www.googleapis.com/auth/cloud-platform" + }, + "methods": { + "CreateScanConfig": { + "requestType": "CreateScanConfigRequest", + "responseType": "ScanConfig", + "options": { + "(google.api.http).post": "/v1beta/{parent=projects/*}/scanConfigs", + "(google.api.http).body": "scan_config", + "(google.api.method_signature)": "parent,scan_config" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1beta/{parent=projects/*}/scanConfigs", + "body": "scan_config" + } + }, + { + "(google.api.method_signature)": "parent,scan_config" + } + ] + }, + "DeleteScanConfig": { + "requestType": "DeleteScanConfigRequest", + "responseType": "google.protobuf.Empty", + "options": { + "(google.api.http).delete": "/v1beta/{name=projects/*/scanConfigs/*}", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "delete": "/v1beta/{name=projects/*/scanConfigs/*}" + } + }, + { + "(google.api.method_signature)": "name" + } + ] + }, + "GetScanConfig": { + "requestType": "GetScanConfigRequest", + "responseType": "ScanConfig", + "options": { + "(google.api.http).get": "/v1beta/{name=projects/*/scanConfigs/*}", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1beta/{name=projects/*/scanConfigs/*}" + } + }, + { + "(google.api.method_signature)": "name" + } + ] + }, + "ListScanConfigs": { + "requestType": "ListScanConfigsRequest", + "responseType": "ListScanConfigsResponse", + "options": { + "(google.api.http).get": "/v1beta/{parent=projects/*}/scanConfigs", + "(google.api.method_signature)": "parent" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1beta/{parent=projects/*}/scanConfigs" + } + }, + { + "(google.api.method_signature)": "parent" + } + ] + }, + "UpdateScanConfig": { + "requestType": "UpdateScanConfigRequest", + "responseType": "ScanConfig", + "options": { + "(google.api.http).patch": "/v1beta/{scan_config.name=projects/*/scanConfigs/*}", + "(google.api.http).body": "scan_config", + "(google.api.method_signature)": "scan_config,update_mask" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "patch": "/v1beta/{scan_config.name=projects/*/scanConfigs/*}", + "body": "scan_config" + } + }, + { + "(google.api.method_signature)": "scan_config,update_mask" + } + ] + }, + "StartScanRun": { + "requestType": "StartScanRunRequest", + "responseType": "ScanRun", + "options": { + "(google.api.http).post": "/v1beta/{name=projects/*/scanConfigs/*}:start", + "(google.api.http).body": "*", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1beta/{name=projects/*/scanConfigs/*}:start", + "body": "*" + } + }, + { + "(google.api.method_signature)": "name" + } + ] + }, + "GetScanRun": { + "requestType": "GetScanRunRequest", + "responseType": "ScanRun", + "options": { + "(google.api.http).get": "/v1beta/{name=projects/*/scanConfigs/*/scanRuns/*}", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1beta/{name=projects/*/scanConfigs/*/scanRuns/*}" + } + }, + { + "(google.api.method_signature)": "name" + } + ] + }, + "ListScanRuns": { + "requestType": "ListScanRunsRequest", + "responseType": "ListScanRunsResponse", + "options": { + "(google.api.http).get": "/v1beta/{parent=projects/*/scanConfigs/*}/scanRuns", + "(google.api.method_signature)": "parent" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1beta/{parent=projects/*/scanConfigs/*}/scanRuns" + } + }, + { + "(google.api.method_signature)": "parent" + } + ] + }, + "StopScanRun": { + "requestType": "StopScanRunRequest", + "responseType": "ScanRun", + "options": { + "(google.api.http).post": "/v1beta/{name=projects/*/scanConfigs/*/scanRuns/*}:stop", + "(google.api.http).body": "*", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1beta/{name=projects/*/scanConfigs/*/scanRuns/*}:stop", + "body": "*" + } + }, + { + "(google.api.method_signature)": "name" + } + ] + }, + "ListCrawledUrls": { + "requestType": "ListCrawledUrlsRequest", + "responseType": "ListCrawledUrlsResponse", + "options": { + "(google.api.http).get": "/v1beta/{parent=projects/*/scanConfigs/*/scanRuns/*}/crawledUrls", + "(google.api.method_signature)": "parent" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1beta/{parent=projects/*/scanConfigs/*/scanRuns/*}/crawledUrls" + } + }, + { + "(google.api.method_signature)": "parent" + } + ] + }, + "GetFinding": { + "requestType": "GetFindingRequest", + "responseType": "Finding", + "options": { + "(google.api.http).get": "/v1beta/{name=projects/*/scanConfigs/*/scanRuns/*/findings/*}", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1beta/{name=projects/*/scanConfigs/*/scanRuns/*/findings/*}" + } + }, + { + "(google.api.method_signature)": "name" + } + ] + }, + "ListFindings": { + "requestType": "ListFindingsRequest", + "responseType": "ListFindingsResponse", + "options": { + "(google.api.http).get": "/v1beta/{parent=projects/*/scanConfigs/*/scanRuns/*}/findings", + "(google.api.method_signature)": "parent,filter" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1beta/{parent=projects/*/scanConfigs/*/scanRuns/*}/findings" + } + }, + { + "(google.api.method_signature)": "parent,filter" + } + ] + }, + "ListFindingTypeStats": { + "requestType": "ListFindingTypeStatsRequest", + "responseType": "ListFindingTypeStatsResponse", + "options": { + "(google.api.http).get": "/v1beta/{parent=projects/*/scanConfigs/*/scanRuns/*}/findingTypeStats", + "(google.api.method_signature)": "parent" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1beta/{parent=projects/*/scanConfigs/*/scanRuns/*}/findingTypeStats" + } + }, + { + "(google.api.method_signature)": "parent" + } + ] + } + } + }, + "CreateScanConfigRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "cloudresourcemanager.googleapis.com/Project" + } + }, + "scanConfig": { + "type": "ScanConfig", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "DeleteScanConfigRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "websecurityscanner.googleapis.com/ScanConfig" + } + } + } + }, + "GetScanConfigRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "websecurityscanner.googleapis.com/ScanConfig" + } + } + } + }, + "ListScanConfigsRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "cloudresourcemanager.googleapis.com/Project" + } + }, + "pageToken": { + "type": "string", + "id": 2 + }, + "pageSize": { + "type": "int32", + "id": 3 + } + } + }, + "UpdateScanConfigRequest": { + "fields": { + "scanConfig": { + "type": "ScanConfig", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "updateMask": { + "type": "google.protobuf.FieldMask", + "id": 3, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "ListScanConfigsResponse": { + "fields": { + "scanConfigs": { + "rule": "repeated", + "type": "ScanConfig", + "id": 1 + }, + "nextPageToken": { + "type": "string", + "id": 2 + } + } + }, + "StartScanRunRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "websecurityscanner.googleapis.com/ScanConfig" + } + } + } + }, + "GetScanRunRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "websecurityscanner.googleapis.com/ScanRun" + } + } + } + }, + "ListScanRunsRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "websecurityscanner.googleapis.com/ScanConfig" + } + }, + "pageToken": { + "type": "string", + "id": 2 + }, + "pageSize": { + "type": "int32", + "id": 3 + } + } + }, + "ListScanRunsResponse": { + "fields": { + "scanRuns": { + "rule": "repeated", + "type": "ScanRun", + "id": 1 + }, + "nextPageToken": { + "type": "string", + "id": 2 + } + } + }, + "StopScanRunRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "websecurityscanner.googleapis.com/ScanRun" + } + } + } + }, + "ListCrawledUrlsRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "websecurityscanner.googleapis.com/ScanRun" + } + }, + "pageToken": { + "type": "string", + "id": 2 + }, + "pageSize": { + "type": "int32", + "id": 3 + } + } + }, + "ListCrawledUrlsResponse": { + "fields": { + "crawledUrls": { + "rule": "repeated", + "type": "CrawledUrl", + "id": 1 + }, + "nextPageToken": { + "type": "string", + "id": 2 + } + } + }, + "GetFindingRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "websecurityscanner.googleapis.com/Finding" + } + } + } + }, + "ListFindingsRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "websecurityscanner.googleapis.com/ScanRun" + } + }, + "filter": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "pageToken": { + "type": "string", + "id": 3 + }, + "pageSize": { + "type": "int32", + "id": 4 + } + } + }, + "ListFindingsResponse": { + "fields": { + "findings": { + "rule": "repeated", + "type": "Finding", + "id": 1 + }, + "nextPageToken": { + "type": "string", + "id": 2 + } + } + }, + "ListFindingTypeStatsRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "websecurityscanner.googleapis.com/ScanRun" + } + } + } + }, + "ListFindingTypeStatsResponse": { + "fields": { + "findingTypeStats": { + "rule": "repeated", + "type": "FindingTypeStats", + "id": 1 + } + } + } + } + } + } + } + } + }, + "api": { + "options": { + "go_package": "google.golang.org/genproto/googleapis/api/annotations;annotations", + "java_multiple_files": true, + "java_outer_classname": "ClientProto", + "java_package": "com.google.api", + "objc_class_prefix": "GAPI", + "cc_enable_arenas": true + }, + "nested": { + "fieldBehavior": { + "rule": "repeated", + "type": "google.api.FieldBehavior", + "id": 1052, + "extend": "google.protobuf.FieldOptions" + }, + "FieldBehavior": { + "values": { + "FIELD_BEHAVIOR_UNSPECIFIED": 0, + "OPTIONAL": 1, + "REQUIRED": 2, + "OUTPUT_ONLY": 3, + "INPUT_ONLY": 4, + "IMMUTABLE": 5, + "UNORDERED_LIST": 6, + "NON_EMPTY_DEFAULT": 7 + } + }, + "resourceReference": { + "type": "google.api.ResourceReference", + "id": 1055, + "extend": "google.protobuf.FieldOptions" + }, + "resourceDefinition": { + "rule": "repeated", + "type": "google.api.ResourceDescriptor", + "id": 1053, + "extend": "google.protobuf.FileOptions" + }, + "resource": { + "type": "google.api.ResourceDescriptor", + "id": 1053, + "extend": "google.protobuf.MessageOptions" + }, + "ResourceDescriptor": { + "fields": { + "type": { + "type": "string", + "id": 1 + }, + "pattern": { + "rule": "repeated", + "type": "string", + "id": 2 + }, + "nameField": { + "type": "string", + "id": 3 + }, + "history": { + "type": "History", + "id": 4 + }, + "plural": { + "type": "string", + "id": 5 + }, + "singular": { + "type": "string", + "id": 6 + }, + "style": { + "rule": "repeated", + "type": "Style", + "id": 10 + } + }, + "nested": { + "History": { + "values": { + "HISTORY_UNSPECIFIED": 0, + "ORIGINALLY_SINGLE_PATTERN": 1, + "FUTURE_MULTI_PATTERN": 2 + } + }, + "Style": { + "values": { + "STYLE_UNSPECIFIED": 0, + "DECLARATIVE_FRIENDLY": 1 + } + } + } + }, + "ResourceReference": { + "fields": { + "type": { + "type": "string", + "id": 1 + }, + "childType": { + "type": "string", + "id": 2 + } + } + }, + "http": { + "type": "HttpRule", + "id": 72295728, + "extend": "google.protobuf.MethodOptions" + }, + "Http": { + "fields": { + "rules": { + "rule": "repeated", + "type": "HttpRule", + "id": 1 + }, + "fullyDecodeReservedExpansion": { + "type": "bool", + "id": 2 + } + } + }, + "HttpRule": { + "oneofs": { + "pattern": { + "oneof": [ + "get", + "put", + "post", + "delete", + "patch", + "custom" + ] + } + }, + "fields": { + "selector": { + "type": "string", + "id": 1 + }, + "get": { + "type": "string", + "id": 2 + }, + "put": { + "type": "string", + "id": 3 + }, + "post": { + "type": "string", + "id": 4 + }, + "delete": { + "type": "string", + "id": 5 + }, + "patch": { + "type": "string", + "id": 6 + }, + "custom": { + "type": "CustomHttpPattern", + "id": 8 + }, + "body": { + "type": "string", + "id": 7 + }, + "responseBody": { + "type": "string", + "id": 12 + }, + "additionalBindings": { + "rule": "repeated", + "type": "HttpRule", + "id": 11 + } + } + }, + "CustomHttpPattern": { + "fields": { + "kind": { + "type": "string", + "id": 1 + }, + "path": { + "type": "string", + "id": 2 + } + } + }, + "methodSignature": { + "rule": "repeated", + "type": "string", + "id": 1051, + "extend": "google.protobuf.MethodOptions" + }, + "defaultHost": { + "type": "string", + "id": 1049, + "extend": "google.protobuf.ServiceOptions" + }, + "oauthScopes": { + "type": "string", + "id": 1050, + "extend": "google.protobuf.ServiceOptions" + } + } + }, + "protobuf": { + "options": { + "go_package": "google.golang.org/protobuf/types/descriptorpb", + "java_package": "com.google.protobuf", + "java_outer_classname": "DescriptorProtos", + "csharp_namespace": "Google.Protobuf.Reflection", + "objc_class_prefix": "GPB", + "cc_enable_arenas": true, + "optimize_for": "SPEED" + }, + "nested": { + "FileDescriptorSet": { + "fields": { + "file": { + "rule": "repeated", + "type": "FileDescriptorProto", + "id": 1 + } + } + }, + "FileDescriptorProto": { + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "package": { + "type": "string", + "id": 2 + }, + "dependency": { + "rule": "repeated", + "type": "string", + "id": 3 + }, + "publicDependency": { + "rule": "repeated", + "type": "int32", + "id": 10, + "options": { + "packed": false + } + }, + "weakDependency": { + "rule": "repeated", + "type": "int32", + "id": 11, + "options": { + "packed": false + } + }, + "messageType": { + "rule": "repeated", + "type": "DescriptorProto", + "id": 4 + }, + "enumType": { + "rule": "repeated", + "type": "EnumDescriptorProto", + "id": 5 + }, + "service": { + "rule": "repeated", + "type": "ServiceDescriptorProto", + "id": 6 + }, + "extension": { + "rule": "repeated", + "type": "FieldDescriptorProto", + "id": 7 + }, + "options": { + "type": "FileOptions", + "id": 8 + }, + "sourceCodeInfo": { + "type": "SourceCodeInfo", + "id": 9 + }, + "syntax": { + "type": "string", + "id": 12 + }, + "edition": { + "type": "string", + "id": 13 + } + } + }, + "DescriptorProto": { + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "field": { + "rule": "repeated", + "type": "FieldDescriptorProto", + "id": 2 + }, + "extension": { + "rule": "repeated", + "type": "FieldDescriptorProto", + "id": 6 + }, + "nestedType": { + "rule": "repeated", + "type": "DescriptorProto", + "id": 3 + }, + "enumType": { + "rule": "repeated", + "type": "EnumDescriptorProto", + "id": 4 + }, + "extensionRange": { + "rule": "repeated", + "type": "ExtensionRange", + "id": 5 + }, + "oneofDecl": { + "rule": "repeated", + "type": "OneofDescriptorProto", + "id": 8 + }, + "options": { + "type": "MessageOptions", + "id": 7 + }, + "reservedRange": { + "rule": "repeated", + "type": "ReservedRange", + "id": 9 + }, + "reservedName": { + "rule": "repeated", + "type": "string", + "id": 10 + } + }, + "nested": { + "ExtensionRange": { + "fields": { + "start": { + "type": "int32", + "id": 1 + }, + "end": { + "type": "int32", + "id": 2 + }, + "options": { + "type": "ExtensionRangeOptions", + "id": 3 + } + } + }, + "ReservedRange": { + "fields": { + "start": { + "type": "int32", + "id": 1 + }, + "end": { + "type": "int32", + "id": 2 + } + } + } + } + }, + "ExtensionRangeOptions": { + "fields": { + "uninterpretedOption": { + "rule": "repeated", + "type": "UninterpretedOption", + "id": 999 + } + }, + "extensions": [ + [ + 1000, + 536870911 + ] + ] + }, + "FieldDescriptorProto": { + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "number": { + "type": "int32", + "id": 3 + }, + "label": { + "type": "Label", + "id": 4 + }, + "type": { + "type": "Type", + "id": 5 + }, + "typeName": { + "type": "string", + "id": 6 + }, + "extendee": { + "type": "string", + "id": 2 + }, + "defaultValue": { + "type": "string", + "id": 7 + }, + "oneofIndex": { + "type": "int32", + "id": 9 + }, + "jsonName": { + "type": "string", + "id": 10 + }, + "options": { + "type": "FieldOptions", + "id": 8 + }, + "proto3Optional": { + "type": "bool", + "id": 17 + } + }, + "nested": { + "Type": { + "values": { + "TYPE_DOUBLE": 1, + "TYPE_FLOAT": 2, + "TYPE_INT64": 3, + "TYPE_UINT64": 4, + "TYPE_INT32": 5, + "TYPE_FIXED64": 6, + "TYPE_FIXED32": 7, + "TYPE_BOOL": 8, + "TYPE_STRING": 9, + "TYPE_GROUP": 10, + "TYPE_MESSAGE": 11, + "TYPE_BYTES": 12, + "TYPE_UINT32": 13, + "TYPE_ENUM": 14, + "TYPE_SFIXED32": 15, + "TYPE_SFIXED64": 16, + "TYPE_SINT32": 17, + "TYPE_SINT64": 18 + } + }, + "Label": { + "values": { + "LABEL_OPTIONAL": 1, + "LABEL_REQUIRED": 2, + "LABEL_REPEATED": 3 + } + } + } + }, + "OneofDescriptorProto": { + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "options": { + "type": "OneofOptions", + "id": 2 + } + } + }, + "EnumDescriptorProto": { + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "value": { + "rule": "repeated", + "type": "EnumValueDescriptorProto", + "id": 2 + }, + "options": { + "type": "EnumOptions", + "id": 3 + }, + "reservedRange": { + "rule": "repeated", + "type": "EnumReservedRange", + "id": 4 + }, + "reservedName": { + "rule": "repeated", + "type": "string", + "id": 5 + } + }, + "nested": { + "EnumReservedRange": { + "fields": { + "start": { + "type": "int32", + "id": 1 + }, + "end": { + "type": "int32", + "id": 2 + } + } + } + } + }, + "EnumValueDescriptorProto": { + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "number": { + "type": "int32", + "id": 2 + }, + "options": { + "type": "EnumValueOptions", + "id": 3 + } + } + }, + "ServiceDescriptorProto": { + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "method": { + "rule": "repeated", + "type": "MethodDescriptorProto", + "id": 2 + }, + "options": { + "type": "ServiceOptions", + "id": 3 + } + } + }, + "MethodDescriptorProto": { + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "inputType": { + "type": "string", + "id": 2 + }, + "outputType": { + "type": "string", + "id": 3 + }, + "options": { + "type": "MethodOptions", + "id": 4 + }, + "clientStreaming": { + "type": "bool", + "id": 5, + "options": { + "default": false + } + }, + "serverStreaming": { + "type": "bool", + "id": 6, + "options": { + "default": false + } + } + } + }, + "FileOptions": { + "fields": { + "javaPackage": { + "type": "string", + "id": 1 + }, + "javaOuterClassname": { + "type": "string", + "id": 8 + }, + "javaMultipleFiles": { + "type": "bool", + "id": 10, + "options": { + "default": false + } + }, + "javaGenerateEqualsAndHash": { + "type": "bool", + "id": 20, + "options": { + "deprecated": true + } + }, + "javaStringCheckUtf8": { + "type": "bool", + "id": 27, + "options": { + "default": false + } + }, + "optimizeFor": { + "type": "OptimizeMode", + "id": 9, + "options": { + "default": "SPEED" + } + }, + "goPackage": { + "type": "string", + "id": 11 + }, + "ccGenericServices": { + "type": "bool", + "id": 16, + "options": { + "default": false + } + }, + "javaGenericServices": { + "type": "bool", + "id": 17, + "options": { + "default": false + } + }, + "pyGenericServices": { + "type": "bool", + "id": 18, + "options": { + "default": false + } + }, + "phpGenericServices": { + "type": "bool", + "id": 42, + "options": { + "default": false + } + }, + "deprecated": { + "type": "bool", + "id": 23, + "options": { + "default": false + } + }, + "ccEnableArenas": { + "type": "bool", + "id": 31, + "options": { + "default": true + } + }, + "objcClassPrefix": { + "type": "string", + "id": 36 + }, + "csharpNamespace": { + "type": "string", + "id": 37 + }, + "swiftPrefix": { + "type": "string", + "id": 39 + }, + "phpClassPrefix": { + "type": "string", + "id": 40 + }, + "phpNamespace": { + "type": "string", + "id": 41 + }, + "phpMetadataNamespace": { + "type": "string", + "id": 44 + }, + "rubyPackage": { + "type": "string", + "id": 45 + }, + "uninterpretedOption": { + "rule": "repeated", + "type": "UninterpretedOption", + "id": 999 + } + }, + "extensions": [ + [ + 1000, + 536870911 + ] + ], + "reserved": [ + [ + 38, + 38 + ] + ], + "nested": { + "OptimizeMode": { + "values": { + "SPEED": 1, + "CODE_SIZE": 2, + "LITE_RUNTIME": 3 + } + } + } + }, + "MessageOptions": { + "fields": { + "messageSetWireFormat": { + "type": "bool", + "id": 1, + "options": { + "default": false + } + }, + "noStandardDescriptorAccessor": { + "type": "bool", + "id": 2, + "options": { + "default": false + } + }, + "deprecated": { + "type": "bool", + "id": 3, + "options": { + "default": false + } + }, + "mapEntry": { + "type": "bool", + "id": 7 + }, + "uninterpretedOption": { + "rule": "repeated", + "type": "UninterpretedOption", + "id": 999 + } + }, + "extensions": [ + [ + 1000, + 536870911 + ] + ], + "reserved": [ + [ + 4, + 4 + ], + [ + 5, + 5 + ], + [ + 6, + 6 + ], + [ + 8, + 8 + ], + [ + 9, + 9 + ] + ] + }, + "FieldOptions": { + "fields": { + "ctype": { + "type": "CType", + "id": 1, + "options": { + "default": "STRING" + } + }, + "packed": { + "type": "bool", + "id": 2 + }, + "jstype": { + "type": "JSType", + "id": 6, + "options": { + "default": "JS_NORMAL" + } + }, + "lazy": { + "type": "bool", + "id": 5, + "options": { + "default": false + } + }, + "unverifiedLazy": { + "type": "bool", + "id": 15, + "options": { + "default": false + } + }, + "deprecated": { + "type": "bool", + "id": 3, + "options": { + "default": false + } + }, + "weak": { + "type": "bool", + "id": 10, + "options": { + "default": false + } + }, + "uninterpretedOption": { + "rule": "repeated", + "type": "UninterpretedOption", + "id": 999 + } + }, + "extensions": [ + [ + 1000, + 536870911 + ] + ], + "reserved": [ + [ + 4, + 4 + ] + ], + "nested": { + "CType": { + "values": { + "STRING": 0, + "CORD": 1, + "STRING_PIECE": 2 + } + }, + "JSType": { + "values": { + "JS_NORMAL": 0, + "JS_STRING": 1, + "JS_NUMBER": 2 + } + } + } + }, + "OneofOptions": { + "fields": { + "uninterpretedOption": { + "rule": "repeated", + "type": "UninterpretedOption", + "id": 999 + } + }, + "extensions": [ + [ + 1000, + 536870911 + ] + ] + }, + "EnumOptions": { + "fields": { + "allowAlias": { + "type": "bool", + "id": 2 + }, + "deprecated": { + "type": "bool", + "id": 3, + "options": { + "default": false + } + }, + "uninterpretedOption": { + "rule": "repeated", + "type": "UninterpretedOption", + "id": 999 + } + }, + "extensions": [ + [ + 1000, + 536870911 + ] + ], + "reserved": [ + [ + 5, + 5 + ] + ] + }, + "EnumValueOptions": { + "fields": { + "deprecated": { + "type": "bool", + "id": 1, + "options": { + "default": false + } + }, + "uninterpretedOption": { + "rule": "repeated", + "type": "UninterpretedOption", + "id": 999 + } + }, + "extensions": [ + [ + 1000, + 536870911 + ] + ] + }, + "ServiceOptions": { + "fields": { + "deprecated": { + "type": "bool", + "id": 33, + "options": { + "default": false + } + }, + "uninterpretedOption": { + "rule": "repeated", + "type": "UninterpretedOption", + "id": 999 + } + }, + "extensions": [ + [ + 1000, + 536870911 + ] + ] + }, + "MethodOptions": { + "fields": { + "deprecated": { + "type": "bool", + "id": 33, + "options": { + "default": false + } + }, + "idempotencyLevel": { + "type": "IdempotencyLevel", + "id": 34, + "options": { + "default": "IDEMPOTENCY_UNKNOWN" + } + }, + "uninterpretedOption": { + "rule": "repeated", + "type": "UninterpretedOption", + "id": 999 + } + }, + "extensions": [ + [ + 1000, + 536870911 + ] + ], + "nested": { + "IdempotencyLevel": { + "values": { + "IDEMPOTENCY_UNKNOWN": 0, + "NO_SIDE_EFFECTS": 1, + "IDEMPOTENT": 2 + } + } + } + }, + "UninterpretedOption": { + "fields": { + "name": { + "rule": "repeated", + "type": "NamePart", + "id": 2 + }, + "identifierValue": { + "type": "string", + "id": 3 + }, + "positiveIntValue": { + "type": "uint64", + "id": 4 + }, + "negativeIntValue": { + "type": "int64", + "id": 5 + }, + "doubleValue": { + "type": "double", + "id": 6 + }, + "stringValue": { + "type": "bytes", + "id": 7 + }, + "aggregateValue": { + "type": "string", + "id": 8 + } + }, + "nested": { + "NamePart": { + "fields": { + "namePart": { + "rule": "required", + "type": "string", + "id": 1 + }, + "isExtension": { + "rule": "required", + "type": "bool", + "id": 2 + } + } + } + } + }, + "SourceCodeInfo": { + "fields": { + "location": { + "rule": "repeated", + "type": "Location", + "id": 1 + } + }, + "nested": { + "Location": { + "fields": { + "path": { + "rule": "repeated", + "type": "int32", + "id": 1 + }, + "span": { + "rule": "repeated", + "type": "int32", + "id": 2 + }, + "leadingComments": { + "type": "string", + "id": 3 + }, + "trailingComments": { + "type": "string", + "id": 4 + }, + "leadingDetachedComments": { + "rule": "repeated", + "type": "string", + "id": 6 + } + } + } + } + }, + "GeneratedCodeInfo": { + "fields": { + "annotation": { + "rule": "repeated", + "type": "Annotation", + "id": 1 + } + }, + "nested": { + "Annotation": { + "fields": { + "path": { + "rule": "repeated", + "type": "int32", + "id": 1 + }, + "sourceFile": { + "type": "string", + "id": 2 + }, + "begin": { + "type": "int32", + "id": 3 + }, + "end": { + "type": "int32", + "id": 4 + }, + "semantic": { + "type": "Semantic", + "id": 5 + } + }, + "nested": { + "Semantic": { + "values": { + "NONE": 0, + "SET": 1, + "ALIAS": 2 + } + } + } + } + } + }, + "Timestamp": { + "fields": { + "seconds": { + "type": "int64", + "id": 1 + }, + "nanos": { + "type": "int32", + "id": 2 + } + } + }, + "Empty": { + "fields": {} + }, + "FieldMask": { + "fields": { + "paths": { + "rule": "repeated", + "type": "string", + "id": 1 + } + } + } + } + } + } + } + } +} \ No newline at end of file diff --git a/packages/google-cloud-websecurityscanner/samples/README.md b/packages/google-cloud-websecurityscanner/samples/README.md new file mode 100644 index 00000000000..6cb716ddcd7 --- /dev/null +++ b/packages/google-cloud-websecurityscanner/samples/README.md @@ -0,0 +1,50 @@ +[//]: # "This README.md file is auto-generated, all changes to this file will be lost." +[//]: # "To regenerate it, use `python -m synthtool`." +Google Cloud Platform logo + +# [Web Security Scanner: Node.js Samples](https://github.com/googleapis/nodejs-web-security-scanner) + +[![Open in Cloud Shell][shell_img]][shell_link] + + + +## Table of Contents + +* [Before you begin](#before-you-begin) +* [Samples](#samples) + * [Quickstart](#quickstart) + +## Before you begin + +Before running the samples, make sure you've followed the steps outlined in +[Using the client library](https://github.com/googleapis/nodejs-web-security-scanner#using-the-client-library). + +`cd samples` + +`npm install` + +`cd ..` + +## Samples + + + +### Quickstart + +View the [source code](https://github.com/googleapis/nodejs-web-security-scanner/blob/main/samples/quickstart.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-web-security-scanner&page=editor&open_in_editor=samples/quickstart.js,samples/README.md) + +__Usage:__ + + +`node samples/quickstart.js` + + + + + + +[shell_img]: https://gstatic.com/cloudssh/images/open-btn.png +[shell_link]: https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-web-security-scanner&page=editor&open_in_editor=samples/README.md +[product-docs]: https://cloud.google.com/security-scanner/ diff --git a/packages/google-cloud-websecurityscanner/samples/generated/v1/snippet_metadata.google.cloud.websecurityscanner.v1.json b/packages/google-cloud-websecurityscanner/samples/generated/v1/snippet_metadata.google.cloud.websecurityscanner.v1.json new file mode 100644 index 00000000000..4f5eb93cf6c --- /dev/null +++ b/packages/google-cloud-websecurityscanner/samples/generated/v1/snippet_metadata.google.cloud.websecurityscanner.v1.json @@ -0,0 +1,579 @@ +{ + "clientLibrary": { + "name": "nodejs-websecurityscanner", + "version": "2.1.3", + "language": "TYPESCRIPT", + "apis": [ + { + "id": "google.cloud.websecurityscanner.v1", + "version": "v1" + } + ] + }, + "snippets": [ + { + "regionTag": "websecurityscanner_v1_generated_WebSecurityScanner_CreateScanConfig_async", + "title": "WebSecurityScanner createScanConfig Sample", + "origin": "API_DEFINITION", + "description": " Creates a new ScanConfig.", + "canonical": true, + "file": "web_security_scanner.create_scan_config.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 57, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "CreateScanConfig", + "fullName": "google.cloud.websecurityscanner.v1.WebSecurityScanner.CreateScanConfig", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "scan_config", + "type": ".google.cloud.websecurityscanner.v1.ScanConfig" + } + ], + "resultType": ".google.cloud.websecurityscanner.v1.ScanConfig", + "client": { + "shortName": "WebSecurityScannerClient", + "fullName": "google.cloud.websecurityscanner.v1.WebSecurityScannerClient" + }, + "method": { + "shortName": "CreateScanConfig", + "fullName": "google.cloud.websecurityscanner.v1.WebSecurityScanner.CreateScanConfig", + "service": { + "shortName": "WebSecurityScanner", + "fullName": "google.cloud.websecurityscanner.v1.WebSecurityScanner" + } + } + } + }, + { + "regionTag": "websecurityscanner_v1_generated_WebSecurityScanner_DeleteScanConfig_async", + "title": "WebSecurityScanner deleteScanConfig Sample", + "origin": "API_DEFINITION", + "description": " Deletes an existing ScanConfig and its child resources.", + "canonical": true, + "file": "web_security_scanner.delete_scan_config.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 53, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "DeleteScanConfig", + "fullName": "google.cloud.websecurityscanner.v1.WebSecurityScanner.DeleteScanConfig", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.protobuf.Empty", + "client": { + "shortName": "WebSecurityScannerClient", + "fullName": "google.cloud.websecurityscanner.v1.WebSecurityScannerClient" + }, + "method": { + "shortName": "DeleteScanConfig", + "fullName": "google.cloud.websecurityscanner.v1.WebSecurityScanner.DeleteScanConfig", + "service": { + "shortName": "WebSecurityScanner", + "fullName": "google.cloud.websecurityscanner.v1.WebSecurityScanner" + } + } + } + }, + { + "regionTag": "websecurityscanner_v1_generated_WebSecurityScanner_GetScanConfig_async", + "title": "WebSecurityScanner getScanConfig Sample", + "origin": "API_DEFINITION", + "description": " Gets a ScanConfig.", + "canonical": true, + "file": "web_security_scanner.get_scan_config.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 53, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "GetScanConfig", + "fullName": "google.cloud.websecurityscanner.v1.WebSecurityScanner.GetScanConfig", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.websecurityscanner.v1.ScanConfig", + "client": { + "shortName": "WebSecurityScannerClient", + "fullName": "google.cloud.websecurityscanner.v1.WebSecurityScannerClient" + }, + "method": { + "shortName": "GetScanConfig", + "fullName": "google.cloud.websecurityscanner.v1.WebSecurityScanner.GetScanConfig", + "service": { + "shortName": "WebSecurityScanner", + "fullName": "google.cloud.websecurityscanner.v1.WebSecurityScanner" + } + } + } + }, + { + "regionTag": "websecurityscanner_v1_generated_WebSecurityScanner_ListScanConfigs_async", + "title": "WebSecurityScanner listScanConfigs Sample", + "origin": "API_DEFINITION", + "description": " Lists ScanConfigs under a given project.", + "canonical": true, + "file": "web_security_scanner.list_scan_configs.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 67, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "ListScanConfigs", + "fullName": "google.cloud.websecurityscanner.v1.WebSecurityScanner.ListScanConfigs", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "page_token", + "type": "TYPE_STRING" + }, + { + "name": "page_size", + "type": "TYPE_INT32" + } + ], + "resultType": ".google.cloud.websecurityscanner.v1.ListScanConfigsResponse", + "client": { + "shortName": "WebSecurityScannerClient", + "fullName": "google.cloud.websecurityscanner.v1.WebSecurityScannerClient" + }, + "method": { + "shortName": "ListScanConfigs", + "fullName": "google.cloud.websecurityscanner.v1.WebSecurityScanner.ListScanConfigs", + "service": { + "shortName": "WebSecurityScanner", + "fullName": "google.cloud.websecurityscanner.v1.WebSecurityScanner" + } + } + } + }, + { + "regionTag": "websecurityscanner_v1_generated_WebSecurityScanner_UpdateScanConfig_async", + "title": "WebSecurityScanner updateScanConfig Sample", + "origin": "API_DEFINITION", + "description": " Updates a ScanConfig. This method support partial update of a ScanConfig.", + "canonical": true, + "file": "web_security_scanner.update_scan_config.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 60, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "UpdateScanConfig", + "fullName": "google.cloud.websecurityscanner.v1.WebSecurityScanner.UpdateScanConfig", + "async": true, + "parameters": [ + { + "name": "scan_config", + "type": ".google.cloud.websecurityscanner.v1.ScanConfig" + }, + { + "name": "update_mask", + "type": ".google.protobuf.FieldMask" + } + ], + "resultType": ".google.cloud.websecurityscanner.v1.ScanConfig", + "client": { + "shortName": "WebSecurityScannerClient", + "fullName": "google.cloud.websecurityscanner.v1.WebSecurityScannerClient" + }, + "method": { + "shortName": "UpdateScanConfig", + "fullName": "google.cloud.websecurityscanner.v1.WebSecurityScanner.UpdateScanConfig", + "service": { + "shortName": "WebSecurityScanner", + "fullName": "google.cloud.websecurityscanner.v1.WebSecurityScanner" + } + } + } + }, + { + "regionTag": "websecurityscanner_v1_generated_WebSecurityScanner_StartScanRun_async", + "title": "WebSecurityScanner startScanRun Sample", + "origin": "API_DEFINITION", + "description": " Start a ScanRun according to the given ScanConfig.", + "canonical": true, + "file": "web_security_scanner.start_scan_run.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 53, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "StartScanRun", + "fullName": "google.cloud.websecurityscanner.v1.WebSecurityScanner.StartScanRun", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.websecurityscanner.v1.ScanRun", + "client": { + "shortName": "WebSecurityScannerClient", + "fullName": "google.cloud.websecurityscanner.v1.WebSecurityScannerClient" + }, + "method": { + "shortName": "StartScanRun", + "fullName": "google.cloud.websecurityscanner.v1.WebSecurityScanner.StartScanRun", + "service": { + "shortName": "WebSecurityScanner", + "fullName": "google.cloud.websecurityscanner.v1.WebSecurityScanner" + } + } + } + }, + { + "regionTag": "websecurityscanner_v1_generated_WebSecurityScanner_GetScanRun_async", + "title": "WebSecurityScanner getScanRun Sample", + "origin": "API_DEFINITION", + "description": " Gets a ScanRun.", + "canonical": true, + "file": "web_security_scanner.get_scan_run.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 54, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "GetScanRun", + "fullName": "google.cloud.websecurityscanner.v1.WebSecurityScanner.GetScanRun", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.websecurityscanner.v1.ScanRun", + "client": { + "shortName": "WebSecurityScannerClient", + "fullName": "google.cloud.websecurityscanner.v1.WebSecurityScannerClient" + }, + "method": { + "shortName": "GetScanRun", + "fullName": "google.cloud.websecurityscanner.v1.WebSecurityScanner.GetScanRun", + "service": { + "shortName": "WebSecurityScanner", + "fullName": "google.cloud.websecurityscanner.v1.WebSecurityScanner" + } + } + } + }, + { + "regionTag": "websecurityscanner_v1_generated_WebSecurityScanner_ListScanRuns_async", + "title": "WebSecurityScanner listScanRuns Sample", + "origin": "API_DEFINITION", + "description": " Lists ScanRuns under a given ScanConfig, in descending order of ScanRun stop time.", + "canonical": true, + "file": "web_security_scanner.list_scan_runs.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 67, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "ListScanRuns", + "fullName": "google.cloud.websecurityscanner.v1.WebSecurityScanner.ListScanRuns", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "page_token", + "type": "TYPE_STRING" + }, + { + "name": "page_size", + "type": "TYPE_INT32" + } + ], + "resultType": ".google.cloud.websecurityscanner.v1.ListScanRunsResponse", + "client": { + "shortName": "WebSecurityScannerClient", + "fullName": "google.cloud.websecurityscanner.v1.WebSecurityScannerClient" + }, + "method": { + "shortName": "ListScanRuns", + "fullName": "google.cloud.websecurityscanner.v1.WebSecurityScanner.ListScanRuns", + "service": { + "shortName": "WebSecurityScanner", + "fullName": "google.cloud.websecurityscanner.v1.WebSecurityScanner" + } + } + } + }, + { + "regionTag": "websecurityscanner_v1_generated_WebSecurityScanner_StopScanRun_async", + "title": "WebSecurityScanner stopScanRun Sample", + "origin": "API_DEFINITION", + "description": " Stops a ScanRun. The stopped ScanRun is returned.", + "canonical": true, + "file": "web_security_scanner.stop_scan_run.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 54, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "StopScanRun", + "fullName": "google.cloud.websecurityscanner.v1.WebSecurityScanner.StopScanRun", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.websecurityscanner.v1.ScanRun", + "client": { + "shortName": "WebSecurityScannerClient", + "fullName": "google.cloud.websecurityscanner.v1.WebSecurityScannerClient" + }, + "method": { + "shortName": "StopScanRun", + "fullName": "google.cloud.websecurityscanner.v1.WebSecurityScanner.StopScanRun", + "service": { + "shortName": "WebSecurityScanner", + "fullName": "google.cloud.websecurityscanner.v1.WebSecurityScanner" + } + } + } + }, + { + "regionTag": "websecurityscanner_v1_generated_WebSecurityScanner_ListCrawledUrls_async", + "title": "WebSecurityScanner listCrawledUrls Sample", + "origin": "API_DEFINITION", + "description": " List CrawledUrls under a given ScanRun.", + "canonical": true, + "file": "web_security_scanner.list_crawled_urls.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 68, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "ListCrawledUrls", + "fullName": "google.cloud.websecurityscanner.v1.WebSecurityScanner.ListCrawledUrls", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "page_token", + "type": "TYPE_STRING" + }, + { + "name": "page_size", + "type": "TYPE_INT32" + } + ], + "resultType": ".google.cloud.websecurityscanner.v1.ListCrawledUrlsResponse", + "client": { + "shortName": "WebSecurityScannerClient", + "fullName": "google.cloud.websecurityscanner.v1.WebSecurityScannerClient" + }, + "method": { + "shortName": "ListCrawledUrls", + "fullName": "google.cloud.websecurityscanner.v1.WebSecurityScanner.ListCrawledUrls", + "service": { + "shortName": "WebSecurityScanner", + "fullName": "google.cloud.websecurityscanner.v1.WebSecurityScanner" + } + } + } + }, + { + "regionTag": "websecurityscanner_v1_generated_WebSecurityScanner_GetFinding_async", + "title": "WebSecurityScanner getFinding Sample", + "origin": "API_DEFINITION", + "description": " Gets a Finding.", + "canonical": true, + "file": "web_security_scanner.get_finding.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 54, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "GetFinding", + "fullName": "google.cloud.websecurityscanner.v1.WebSecurityScanner.GetFinding", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.websecurityscanner.v1.Finding", + "client": { + "shortName": "WebSecurityScannerClient", + "fullName": "google.cloud.websecurityscanner.v1.WebSecurityScannerClient" + }, + "method": { + "shortName": "GetFinding", + "fullName": "google.cloud.websecurityscanner.v1.WebSecurityScanner.GetFinding", + "service": { + "shortName": "WebSecurityScanner", + "fullName": "google.cloud.websecurityscanner.v1.WebSecurityScanner" + } + } + } + }, + { + "regionTag": "websecurityscanner_v1_generated_WebSecurityScanner_ListFindings_async", + "title": "WebSecurityScanner listFindings Sample", + "origin": "API_DEFINITION", + "description": " List Findings under a given ScanRun.", + "canonical": true, + "file": "web_security_scanner.list_findings.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 75, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "ListFindings", + "fullName": "google.cloud.websecurityscanner.v1.WebSecurityScanner.ListFindings", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "filter", + "type": "TYPE_STRING" + }, + { + "name": "page_token", + "type": "TYPE_STRING" + }, + { + "name": "page_size", + "type": "TYPE_INT32" + } + ], + "resultType": ".google.cloud.websecurityscanner.v1.ListFindingsResponse", + "client": { + "shortName": "WebSecurityScannerClient", + "fullName": "google.cloud.websecurityscanner.v1.WebSecurityScannerClient" + }, + "method": { + "shortName": "ListFindings", + "fullName": "google.cloud.websecurityscanner.v1.WebSecurityScanner.ListFindings", + "service": { + "shortName": "WebSecurityScanner", + "fullName": "google.cloud.websecurityscanner.v1.WebSecurityScanner" + } + } + } + }, + { + "regionTag": "websecurityscanner_v1_generated_WebSecurityScanner_ListFindingTypeStats_async", + "title": "WebSecurityScanner listFindingTypeStats Sample", + "origin": "API_DEFINITION", + "description": " List all FindingTypeStats under a given ScanRun.", + "canonical": true, + "file": "web_security_scanner.list_finding_type_stats.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 54, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "ListFindingTypeStats", + "fullName": "google.cloud.websecurityscanner.v1.WebSecurityScanner.ListFindingTypeStats", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.websecurityscanner.v1.ListFindingTypeStatsResponse", + "client": { + "shortName": "WebSecurityScannerClient", + "fullName": "google.cloud.websecurityscanner.v1.WebSecurityScannerClient" + }, + "method": { + "shortName": "ListFindingTypeStats", + "fullName": "google.cloud.websecurityscanner.v1.WebSecurityScanner.ListFindingTypeStats", + "service": { + "shortName": "WebSecurityScanner", + "fullName": "google.cloud.websecurityscanner.v1.WebSecurityScanner" + } + } + } + } + ] +} \ No newline at end of file diff --git a/packages/google-cloud-websecurityscanner/samples/generated/v1/web_security_scanner.create_scan_config.js b/packages/google-cloud-websecurityscanner/samples/generated/v1/web_security_scanner.create_scan_config.js new file mode 100644 index 00000000000..9cf5dfab642 --- /dev/null +++ b/packages/google-cloud-websecurityscanner/samples/generated/v1/web_security_scanner.create_scan_config.js @@ -0,0 +1,65 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main() { + // [START websecurityscanner_v1_generated_WebSecurityScanner_CreateScanConfig_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require 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 name where the scan is created, which should be a + * project resource name in the format 'projects/{projectId}'. + */ + // const parent = 'abc123' + /** + * Required. The ScanConfig to be created. + */ + // const scanConfig = {} + + // Imports the Websecurityscanner library + const {WebSecurityScannerClient} = require('@google-cloud/web-security-scanner').v1; + + // Instantiates a client + const websecurityscannerClient = new WebSecurityScannerClient(); + + async function callCreateScanConfig() { + // Construct request + const request = { + }; + + // Run request + const response = await websecurityscannerClient.createScanConfig(request); + console.log(response); + } + + callCreateScanConfig(); + // [END websecurityscanner_v1_generated_WebSecurityScanner_CreateScanConfig_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-websecurityscanner/samples/generated/v1/web_security_scanner.delete_scan_config.js b/packages/google-cloud-websecurityscanner/samples/generated/v1/web_security_scanner.delete_scan_config.js new file mode 100644 index 00000000000..b3dd16386f8 --- /dev/null +++ b/packages/google-cloud-websecurityscanner/samples/generated/v1/web_security_scanner.delete_scan_config.js @@ -0,0 +1,61 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main() { + // [START websecurityscanner_v1_generated_WebSecurityScanner_DeleteScanConfig_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require 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 ScanConfig to be deleted. The name follows the + * format of 'projects/{projectId}/scanConfigs/{scanConfigId}'. + */ + // const name = 'abc123' + + // Imports the Websecurityscanner library + const {WebSecurityScannerClient} = require('@google-cloud/web-security-scanner').v1; + + // Instantiates a client + const websecurityscannerClient = new WebSecurityScannerClient(); + + async function callDeleteScanConfig() { + // Construct request + const request = { + }; + + // Run request + const response = await websecurityscannerClient.deleteScanConfig(request); + console.log(response); + } + + callDeleteScanConfig(); + // [END websecurityscanner_v1_generated_WebSecurityScanner_DeleteScanConfig_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-websecurityscanner/samples/generated/v1/web_security_scanner.get_finding.js b/packages/google-cloud-websecurityscanner/samples/generated/v1/web_security_scanner.get_finding.js new file mode 100644 index 00000000000..df1a6655f38 --- /dev/null +++ b/packages/google-cloud-websecurityscanner/samples/generated/v1/web_security_scanner.get_finding.js @@ -0,0 +1,62 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main() { + // [START websecurityscanner_v1_generated_WebSecurityScanner_GetFinding_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require 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 Finding to be returned. The name follows the + * format of + * 'projects/{projectId}/scanConfigs/{scanConfigId}/scanRuns/{scanRunId}/findings/{findingId}'. + */ + // const name = 'abc123' + + // Imports the Websecurityscanner library + const {WebSecurityScannerClient} = require('@google-cloud/web-security-scanner').v1; + + // Instantiates a client + const websecurityscannerClient = new WebSecurityScannerClient(); + + async function callGetFinding() { + // Construct request + const request = { + }; + + // Run request + const response = await websecurityscannerClient.getFinding(request); + console.log(response); + } + + callGetFinding(); + // [END websecurityscanner_v1_generated_WebSecurityScanner_GetFinding_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-websecurityscanner/samples/generated/v1/web_security_scanner.get_scan_config.js b/packages/google-cloud-websecurityscanner/samples/generated/v1/web_security_scanner.get_scan_config.js new file mode 100644 index 00000000000..6bd7a28cd46 --- /dev/null +++ b/packages/google-cloud-websecurityscanner/samples/generated/v1/web_security_scanner.get_scan_config.js @@ -0,0 +1,61 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main() { + // [START websecurityscanner_v1_generated_WebSecurityScanner_GetScanConfig_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require 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 ScanConfig to be returned. The name follows the + * format of 'projects/{projectId}/scanConfigs/{scanConfigId}'. + */ + // const name = 'abc123' + + // Imports the Websecurityscanner library + const {WebSecurityScannerClient} = require('@google-cloud/web-security-scanner').v1; + + // Instantiates a client + const websecurityscannerClient = new WebSecurityScannerClient(); + + async function callGetScanConfig() { + // Construct request + const request = { + }; + + // Run request + const response = await websecurityscannerClient.getScanConfig(request); + console.log(response); + } + + callGetScanConfig(); + // [END websecurityscanner_v1_generated_WebSecurityScanner_GetScanConfig_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-websecurityscanner/samples/generated/v1/web_security_scanner.get_scan_run.js b/packages/google-cloud-websecurityscanner/samples/generated/v1/web_security_scanner.get_scan_run.js new file mode 100644 index 00000000000..c67f9499ae1 --- /dev/null +++ b/packages/google-cloud-websecurityscanner/samples/generated/v1/web_security_scanner.get_scan_run.js @@ -0,0 +1,62 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main() { + // [START websecurityscanner_v1_generated_WebSecurityScanner_GetScanRun_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require 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 ScanRun to be returned. The name follows the + * format of + * 'projects/{projectId}/scanConfigs/{scanConfigId}/scanRuns/{scanRunId}'. + */ + // const name = 'abc123' + + // Imports the Websecurityscanner library + const {WebSecurityScannerClient} = require('@google-cloud/web-security-scanner').v1; + + // Instantiates a client + const websecurityscannerClient = new WebSecurityScannerClient(); + + async function callGetScanRun() { + // Construct request + const request = { + }; + + // Run request + const response = await websecurityscannerClient.getScanRun(request); + console.log(response); + } + + callGetScanRun(); + // [END websecurityscanner_v1_generated_WebSecurityScanner_GetScanRun_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-websecurityscanner/samples/generated/v1/web_security_scanner.list_crawled_urls.js b/packages/google-cloud-websecurityscanner/samples/generated/v1/web_security_scanner.list_crawled_urls.js new file mode 100644 index 00000000000..81cbb973b39 --- /dev/null +++ b/packages/google-cloud-websecurityscanner/samples/generated/v1/web_security_scanner.list_crawled_urls.js @@ -0,0 +1,76 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main() { + // [START websecurityscanner_v1_generated_WebSecurityScanner_ListCrawledUrls_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require 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 name, which should be a scan run resource name in the + * format + * 'projects/{projectId}/scanConfigs/{scanConfigId}/scanRuns/{scanRunId}'. + */ + // const parent = 'abc123' + /** + * A token identifying a page of results to be returned. This should be a + * `next_page_token` value returned from a previous List request. + * If unspecified, the first page of results is returned. + */ + // const pageToken = 'abc123' + /** + * The maximum number of CrawledUrls to return, can be limited by server. + * If not specified or not positive, the implementation will select a + * reasonable value. + */ + // const pageSize = 1234 + + // Imports the Websecurityscanner library + const {WebSecurityScannerClient} = require('@google-cloud/web-security-scanner').v1; + + // Instantiates a client + const websecurityscannerClient = new WebSecurityScannerClient(); + + async function callListCrawledUrls() { + // Construct request + const request = { + }; + + // Run request + const iterable = await websecurityscannerClient.listCrawledUrlsAsync(request); + for await (const response of iterable) { + console.log(response); + } + } + + callListCrawledUrls(); + // [END websecurityscanner_v1_generated_WebSecurityScanner_ListCrawledUrls_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-websecurityscanner/samples/generated/v1/web_security_scanner.list_finding_type_stats.js b/packages/google-cloud-websecurityscanner/samples/generated/v1/web_security_scanner.list_finding_type_stats.js new file mode 100644 index 00000000000..d8f51efeff1 --- /dev/null +++ b/packages/google-cloud-websecurityscanner/samples/generated/v1/web_security_scanner.list_finding_type_stats.js @@ -0,0 +1,62 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main() { + // [START websecurityscanner_v1_generated_WebSecurityScanner_ListFindingTypeStats_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require 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 name, which should be a scan run resource name in the + * format + * 'projects/{projectId}/scanConfigs/{scanConfigId}/scanRuns/{scanRunId}'. + */ + // const parent = 'abc123' + + // Imports the Websecurityscanner library + const {WebSecurityScannerClient} = require('@google-cloud/web-security-scanner').v1; + + // Instantiates a client + const websecurityscannerClient = new WebSecurityScannerClient(); + + async function callListFindingTypeStats() { + // Construct request + const request = { + }; + + // Run request + const response = await websecurityscannerClient.listFindingTypeStats(request); + console.log(response); + } + + callListFindingTypeStats(); + // [END websecurityscanner_v1_generated_WebSecurityScanner_ListFindingTypeStats_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-websecurityscanner/samples/generated/v1/web_security_scanner.list_findings.js b/packages/google-cloud-websecurityscanner/samples/generated/v1/web_security_scanner.list_findings.js new file mode 100644 index 00000000000..3075a740c33 --- /dev/null +++ b/packages/google-cloud-websecurityscanner/samples/generated/v1/web_security_scanner.list_findings.js @@ -0,0 +1,83 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main() { + // [START websecurityscanner_v1_generated_WebSecurityScanner_ListFindings_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require 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 name, which should be a scan run resource name in the + * format + * 'projects/{projectId}/scanConfigs/{scanConfigId}/scanRuns/{scanRunId}'. + */ + // const parent = 'abc123' + /** + * The filter expression. The expression must be in the format: + * . + * Supported field: 'finding_type'. + * Supported operator: '='. + */ + // const filter = 'abc123' + /** + * A token identifying a page of results to be returned. This should be a + * `next_page_token` value returned from a previous List request. + * If unspecified, the first page of results is returned. + */ + // const pageToken = 'abc123' + /** + * The maximum number of Findings to return, can be limited by server. + * If not specified or not positive, the implementation will select a + * reasonable value. + */ + // const pageSize = 1234 + + // Imports the Websecurityscanner library + const {WebSecurityScannerClient} = require('@google-cloud/web-security-scanner').v1; + + // Instantiates a client + const websecurityscannerClient = new WebSecurityScannerClient(); + + async function callListFindings() { + // Construct request + const request = { + }; + + // Run request + const iterable = await websecurityscannerClient.listFindingsAsync(request); + for await (const response of iterable) { + console.log(response); + } + } + + callListFindings(); + // [END websecurityscanner_v1_generated_WebSecurityScanner_ListFindings_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-websecurityscanner/samples/generated/v1/web_security_scanner.list_scan_configs.js b/packages/google-cloud-websecurityscanner/samples/generated/v1/web_security_scanner.list_scan_configs.js new file mode 100644 index 00000000000..f1ec0d90ef6 --- /dev/null +++ b/packages/google-cloud-websecurityscanner/samples/generated/v1/web_security_scanner.list_scan_configs.js @@ -0,0 +1,75 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main() { + // [START websecurityscanner_v1_generated_WebSecurityScanner_ListScanConfigs_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require 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 name, which should be a project resource name in the + * format 'projects/{projectId}'. + */ + // const parent = 'abc123' + /** + * A token identifying a page of results to be returned. This should be a + * `next_page_token` value returned from a previous List request. + * If unspecified, the first page of results is returned. + */ + // const pageToken = 'abc123' + /** + * The maximum number of ScanConfigs to return, can be limited by server. + * If not specified or not positive, the implementation will select a + * reasonable value. + */ + // const pageSize = 1234 + + // Imports the Websecurityscanner library + const {WebSecurityScannerClient} = require('@google-cloud/web-security-scanner').v1; + + // Instantiates a client + const websecurityscannerClient = new WebSecurityScannerClient(); + + async function callListScanConfigs() { + // Construct request + const request = { + }; + + // Run request + const iterable = await websecurityscannerClient.listScanConfigsAsync(request); + for await (const response of iterable) { + console.log(response); + } + } + + callListScanConfigs(); + // [END websecurityscanner_v1_generated_WebSecurityScanner_ListScanConfigs_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-websecurityscanner/samples/generated/v1/web_security_scanner.list_scan_runs.js b/packages/google-cloud-websecurityscanner/samples/generated/v1/web_security_scanner.list_scan_runs.js new file mode 100644 index 00000000000..17c5e4649de --- /dev/null +++ b/packages/google-cloud-websecurityscanner/samples/generated/v1/web_security_scanner.list_scan_runs.js @@ -0,0 +1,75 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main() { + // [START websecurityscanner_v1_generated_WebSecurityScanner_ListScanRuns_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require 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 name, which should be a scan resource name in the + * format 'projects/{projectId}/scanConfigs/{scanConfigId}'. + */ + // const parent = 'abc123' + /** + * A token identifying a page of results to be returned. This should be a + * `next_page_token` value returned from a previous List request. + * If unspecified, the first page of results is returned. + */ + // const pageToken = 'abc123' + /** + * The maximum number of ScanRuns to return, can be limited by server. + * If not specified or not positive, the implementation will select a + * reasonable value. + */ + // const pageSize = 1234 + + // Imports the Websecurityscanner library + const {WebSecurityScannerClient} = require('@google-cloud/web-security-scanner').v1; + + // Instantiates a client + const websecurityscannerClient = new WebSecurityScannerClient(); + + async function callListScanRuns() { + // Construct request + const request = { + }; + + // Run request + const iterable = await websecurityscannerClient.listScanRunsAsync(request); + for await (const response of iterable) { + console.log(response); + } + } + + callListScanRuns(); + // [END websecurityscanner_v1_generated_WebSecurityScanner_ListScanRuns_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-websecurityscanner/samples/generated/v1/web_security_scanner.start_scan_run.js b/packages/google-cloud-websecurityscanner/samples/generated/v1/web_security_scanner.start_scan_run.js new file mode 100644 index 00000000000..d03e0b1bea5 --- /dev/null +++ b/packages/google-cloud-websecurityscanner/samples/generated/v1/web_security_scanner.start_scan_run.js @@ -0,0 +1,61 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main() { + // [START websecurityscanner_v1_generated_WebSecurityScanner_StartScanRun_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require 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 ScanConfig to be used. The name follows the + * format of 'projects/{projectId}/scanConfigs/{scanConfigId}'. + */ + // const name = 'abc123' + + // Imports the Websecurityscanner library + const {WebSecurityScannerClient} = require('@google-cloud/web-security-scanner').v1; + + // Instantiates a client + const websecurityscannerClient = new WebSecurityScannerClient(); + + async function callStartScanRun() { + // Construct request + const request = { + }; + + // Run request + const response = await websecurityscannerClient.startScanRun(request); + console.log(response); + } + + callStartScanRun(); + // [END websecurityscanner_v1_generated_WebSecurityScanner_StartScanRun_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-websecurityscanner/samples/generated/v1/web_security_scanner.stop_scan_run.js b/packages/google-cloud-websecurityscanner/samples/generated/v1/web_security_scanner.stop_scan_run.js new file mode 100644 index 00000000000..e4ae0b0c076 --- /dev/null +++ b/packages/google-cloud-websecurityscanner/samples/generated/v1/web_security_scanner.stop_scan_run.js @@ -0,0 +1,62 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main() { + // [START websecurityscanner_v1_generated_WebSecurityScanner_StopScanRun_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require 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 ScanRun to be stopped. The name follows the + * format of + * 'projects/{projectId}/scanConfigs/{scanConfigId}/scanRuns/{scanRunId}'. + */ + // const name = 'abc123' + + // Imports the Websecurityscanner library + const {WebSecurityScannerClient} = require('@google-cloud/web-security-scanner').v1; + + // Instantiates a client + const websecurityscannerClient = new WebSecurityScannerClient(); + + async function callStopScanRun() { + // Construct request + const request = { + }; + + // Run request + const response = await websecurityscannerClient.stopScanRun(request); + console.log(response); + } + + callStopScanRun(); + // [END websecurityscanner_v1_generated_WebSecurityScanner_StopScanRun_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-websecurityscanner/samples/generated/v1/web_security_scanner.update_scan_config.js b/packages/google-cloud-websecurityscanner/samples/generated/v1/web_security_scanner.update_scan_config.js new file mode 100644 index 00000000000..5e6a7ebc8d0 --- /dev/null +++ b/packages/google-cloud-websecurityscanner/samples/generated/v1/web_security_scanner.update_scan_config.js @@ -0,0 +1,68 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main() { + // [START websecurityscanner_v1_generated_WebSecurityScanner_UpdateScanConfig_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The ScanConfig to be updated. The name field must be set to identify the + * resource to be updated. The values of fields not covered by the mask + * will be ignored. + */ + // const scanConfig = {} + /** + * Required. The update mask applies to the resource. For the `FieldMask` definition, + * see + * https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#fieldmask + */ + // const updateMask = {} + + // Imports the Websecurityscanner library + const {WebSecurityScannerClient} = require('@google-cloud/web-security-scanner').v1; + + // Instantiates a client + const websecurityscannerClient = new WebSecurityScannerClient(); + + async function callUpdateScanConfig() { + // Construct request + const request = { + }; + + // Run request + const response = await websecurityscannerClient.updateScanConfig(request); + console.log(response); + } + + callUpdateScanConfig(); + // [END websecurityscanner_v1_generated_WebSecurityScanner_UpdateScanConfig_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-websecurityscanner/samples/generated/v1alpha/snippet_metadata.google.cloud.websecurityscanner.v1alpha.json b/packages/google-cloud-websecurityscanner/samples/generated/v1alpha/snippet_metadata.google.cloud.websecurityscanner.v1alpha.json new file mode 100644 index 00000000000..a2044b8cf7d --- /dev/null +++ b/packages/google-cloud-websecurityscanner/samples/generated/v1alpha/snippet_metadata.google.cloud.websecurityscanner.v1alpha.json @@ -0,0 +1,579 @@ +{ + "clientLibrary": { + "name": "nodejs-websecurityscanner", + "version": "2.1.3", + "language": "TYPESCRIPT", + "apis": [ + { + "id": "google.cloud.websecurityscanner.v1alpha", + "version": "v1alpha" + } + ] + }, + "snippets": [ + { + "regionTag": "websecurityscanner_v1alpha_generated_WebSecurityScanner_CreateScanConfig_async", + "title": "WebSecurityScanner createScanConfig Sample", + "origin": "API_DEFINITION", + "description": " Creates a new ScanConfig.", + "canonical": true, + "file": "web_security_scanner.create_scan_config.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 59, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "CreateScanConfig", + "fullName": "google.cloud.websecurityscanner.v1alpha.WebSecurityScanner.CreateScanConfig", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "scan_config", + "type": ".google.cloud.websecurityscanner.v1alpha.ScanConfig" + } + ], + "resultType": ".google.cloud.websecurityscanner.v1alpha.ScanConfig", + "client": { + "shortName": "WebSecurityScannerClient", + "fullName": "google.cloud.websecurityscanner.v1alpha.WebSecurityScannerClient" + }, + "method": { + "shortName": "CreateScanConfig", + "fullName": "google.cloud.websecurityscanner.v1alpha.WebSecurityScanner.CreateScanConfig", + "service": { + "shortName": "WebSecurityScanner", + "fullName": "google.cloud.websecurityscanner.v1alpha.WebSecurityScanner" + } + } + } + }, + { + "regionTag": "websecurityscanner_v1alpha_generated_WebSecurityScanner_DeleteScanConfig_async", + "title": "WebSecurityScanner deleteScanConfig Sample", + "origin": "API_DEFINITION", + "description": " Deletes an existing ScanConfig and its child resources.", + "canonical": true, + "file": "web_security_scanner.delete_scan_config.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 54, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "DeleteScanConfig", + "fullName": "google.cloud.websecurityscanner.v1alpha.WebSecurityScanner.DeleteScanConfig", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.protobuf.Empty", + "client": { + "shortName": "WebSecurityScannerClient", + "fullName": "google.cloud.websecurityscanner.v1alpha.WebSecurityScannerClient" + }, + "method": { + "shortName": "DeleteScanConfig", + "fullName": "google.cloud.websecurityscanner.v1alpha.WebSecurityScanner.DeleteScanConfig", + "service": { + "shortName": "WebSecurityScanner", + "fullName": "google.cloud.websecurityscanner.v1alpha.WebSecurityScanner" + } + } + } + }, + { + "regionTag": "websecurityscanner_v1alpha_generated_WebSecurityScanner_GetScanConfig_async", + "title": "WebSecurityScanner getScanConfig Sample", + "origin": "API_DEFINITION", + "description": " Gets a ScanConfig.", + "canonical": true, + "file": "web_security_scanner.get_scan_config.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 54, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "GetScanConfig", + "fullName": "google.cloud.websecurityscanner.v1alpha.WebSecurityScanner.GetScanConfig", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.websecurityscanner.v1alpha.ScanConfig", + "client": { + "shortName": "WebSecurityScannerClient", + "fullName": "google.cloud.websecurityscanner.v1alpha.WebSecurityScannerClient" + }, + "method": { + "shortName": "GetScanConfig", + "fullName": "google.cloud.websecurityscanner.v1alpha.WebSecurityScanner.GetScanConfig", + "service": { + "shortName": "WebSecurityScanner", + "fullName": "google.cloud.websecurityscanner.v1alpha.WebSecurityScanner" + } + } + } + }, + { + "regionTag": "websecurityscanner_v1alpha_generated_WebSecurityScanner_ListScanConfigs_async", + "title": "WebSecurityScanner listScanConfigs Sample", + "origin": "API_DEFINITION", + "description": " Lists ScanConfigs under a given project.", + "canonical": true, + "file": "web_security_scanner.list_scan_configs.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 68, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "ListScanConfigs", + "fullName": "google.cloud.websecurityscanner.v1alpha.WebSecurityScanner.ListScanConfigs", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "page_token", + "type": "TYPE_STRING" + }, + { + "name": "page_size", + "type": "TYPE_INT32" + } + ], + "resultType": ".google.cloud.websecurityscanner.v1alpha.ListScanConfigsResponse", + "client": { + "shortName": "WebSecurityScannerClient", + "fullName": "google.cloud.websecurityscanner.v1alpha.WebSecurityScannerClient" + }, + "method": { + "shortName": "ListScanConfigs", + "fullName": "google.cloud.websecurityscanner.v1alpha.WebSecurityScanner.ListScanConfigs", + "service": { + "shortName": "WebSecurityScanner", + "fullName": "google.cloud.websecurityscanner.v1alpha.WebSecurityScanner" + } + } + } + }, + { + "regionTag": "websecurityscanner_v1alpha_generated_WebSecurityScanner_UpdateScanConfig_async", + "title": "WebSecurityScanner updateScanConfig Sample", + "origin": "API_DEFINITION", + "description": " Updates a ScanConfig. This method support partial update of a ScanConfig.", + "canonical": true, + "file": "web_security_scanner.update_scan_config.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 62, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "UpdateScanConfig", + "fullName": "google.cloud.websecurityscanner.v1alpha.WebSecurityScanner.UpdateScanConfig", + "async": true, + "parameters": [ + { + "name": "scan_config", + "type": ".google.cloud.websecurityscanner.v1alpha.ScanConfig" + }, + { + "name": "update_mask", + "type": ".google.protobuf.FieldMask" + } + ], + "resultType": ".google.cloud.websecurityscanner.v1alpha.ScanConfig", + "client": { + "shortName": "WebSecurityScannerClient", + "fullName": "google.cloud.websecurityscanner.v1alpha.WebSecurityScannerClient" + }, + "method": { + "shortName": "UpdateScanConfig", + "fullName": "google.cloud.websecurityscanner.v1alpha.WebSecurityScanner.UpdateScanConfig", + "service": { + "shortName": "WebSecurityScanner", + "fullName": "google.cloud.websecurityscanner.v1alpha.WebSecurityScanner" + } + } + } + }, + { + "regionTag": "websecurityscanner_v1alpha_generated_WebSecurityScanner_StartScanRun_async", + "title": "WebSecurityScanner startScanRun Sample", + "origin": "API_DEFINITION", + "description": " Start a ScanRun according to the given ScanConfig.", + "canonical": true, + "file": "web_security_scanner.start_scan_run.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 54, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "StartScanRun", + "fullName": "google.cloud.websecurityscanner.v1alpha.WebSecurityScanner.StartScanRun", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.websecurityscanner.v1alpha.ScanRun", + "client": { + "shortName": "WebSecurityScannerClient", + "fullName": "google.cloud.websecurityscanner.v1alpha.WebSecurityScannerClient" + }, + "method": { + "shortName": "StartScanRun", + "fullName": "google.cloud.websecurityscanner.v1alpha.WebSecurityScanner.StartScanRun", + "service": { + "shortName": "WebSecurityScanner", + "fullName": "google.cloud.websecurityscanner.v1alpha.WebSecurityScanner" + } + } + } + }, + { + "regionTag": "websecurityscanner_v1alpha_generated_WebSecurityScanner_GetScanRun_async", + "title": "WebSecurityScanner getScanRun Sample", + "origin": "API_DEFINITION", + "description": " Gets a ScanRun.", + "canonical": true, + "file": "web_security_scanner.get_scan_run.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 55, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "GetScanRun", + "fullName": "google.cloud.websecurityscanner.v1alpha.WebSecurityScanner.GetScanRun", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.websecurityscanner.v1alpha.ScanRun", + "client": { + "shortName": "WebSecurityScannerClient", + "fullName": "google.cloud.websecurityscanner.v1alpha.WebSecurityScannerClient" + }, + "method": { + "shortName": "GetScanRun", + "fullName": "google.cloud.websecurityscanner.v1alpha.WebSecurityScanner.GetScanRun", + "service": { + "shortName": "WebSecurityScanner", + "fullName": "google.cloud.websecurityscanner.v1alpha.WebSecurityScanner" + } + } + } + }, + { + "regionTag": "websecurityscanner_v1alpha_generated_WebSecurityScanner_ListScanRuns_async", + "title": "WebSecurityScanner listScanRuns Sample", + "origin": "API_DEFINITION", + "description": " Lists ScanRuns under a given ScanConfig, in descending order of ScanRun stop time.", + "canonical": true, + "file": "web_security_scanner.list_scan_runs.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 68, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "ListScanRuns", + "fullName": "google.cloud.websecurityscanner.v1alpha.WebSecurityScanner.ListScanRuns", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "page_token", + "type": "TYPE_STRING" + }, + { + "name": "page_size", + "type": "TYPE_INT32" + } + ], + "resultType": ".google.cloud.websecurityscanner.v1alpha.ListScanRunsResponse", + "client": { + "shortName": "WebSecurityScannerClient", + "fullName": "google.cloud.websecurityscanner.v1alpha.WebSecurityScannerClient" + }, + "method": { + "shortName": "ListScanRuns", + "fullName": "google.cloud.websecurityscanner.v1alpha.WebSecurityScanner.ListScanRuns", + "service": { + "shortName": "WebSecurityScanner", + "fullName": "google.cloud.websecurityscanner.v1alpha.WebSecurityScanner" + } + } + } + }, + { + "regionTag": "websecurityscanner_v1alpha_generated_WebSecurityScanner_StopScanRun_async", + "title": "WebSecurityScanner stopScanRun Sample", + "origin": "API_DEFINITION", + "description": " Stops a ScanRun. The stopped ScanRun is returned.", + "canonical": true, + "file": "web_security_scanner.stop_scan_run.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 55, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "StopScanRun", + "fullName": "google.cloud.websecurityscanner.v1alpha.WebSecurityScanner.StopScanRun", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.websecurityscanner.v1alpha.ScanRun", + "client": { + "shortName": "WebSecurityScannerClient", + "fullName": "google.cloud.websecurityscanner.v1alpha.WebSecurityScannerClient" + }, + "method": { + "shortName": "StopScanRun", + "fullName": "google.cloud.websecurityscanner.v1alpha.WebSecurityScanner.StopScanRun", + "service": { + "shortName": "WebSecurityScanner", + "fullName": "google.cloud.websecurityscanner.v1alpha.WebSecurityScanner" + } + } + } + }, + { + "regionTag": "websecurityscanner_v1alpha_generated_WebSecurityScanner_ListCrawledUrls_async", + "title": "WebSecurityScanner listCrawledUrls Sample", + "origin": "API_DEFINITION", + "description": " List CrawledUrls under a given ScanRun.", + "canonical": true, + "file": "web_security_scanner.list_crawled_urls.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 69, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "ListCrawledUrls", + "fullName": "google.cloud.websecurityscanner.v1alpha.WebSecurityScanner.ListCrawledUrls", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "page_token", + "type": "TYPE_STRING" + }, + { + "name": "page_size", + "type": "TYPE_INT32" + } + ], + "resultType": ".google.cloud.websecurityscanner.v1alpha.ListCrawledUrlsResponse", + "client": { + "shortName": "WebSecurityScannerClient", + "fullName": "google.cloud.websecurityscanner.v1alpha.WebSecurityScannerClient" + }, + "method": { + "shortName": "ListCrawledUrls", + "fullName": "google.cloud.websecurityscanner.v1alpha.WebSecurityScanner.ListCrawledUrls", + "service": { + "shortName": "WebSecurityScanner", + "fullName": "google.cloud.websecurityscanner.v1alpha.WebSecurityScanner" + } + } + } + }, + { + "regionTag": "websecurityscanner_v1alpha_generated_WebSecurityScanner_GetFinding_async", + "title": "WebSecurityScanner getFinding Sample", + "origin": "API_DEFINITION", + "description": " Gets a Finding.", + "canonical": true, + "file": "web_security_scanner.get_finding.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 55, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "GetFinding", + "fullName": "google.cloud.websecurityscanner.v1alpha.WebSecurityScanner.GetFinding", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.websecurityscanner.v1alpha.Finding", + "client": { + "shortName": "WebSecurityScannerClient", + "fullName": "google.cloud.websecurityscanner.v1alpha.WebSecurityScannerClient" + }, + "method": { + "shortName": "GetFinding", + "fullName": "google.cloud.websecurityscanner.v1alpha.WebSecurityScanner.GetFinding", + "service": { + "shortName": "WebSecurityScanner", + "fullName": "google.cloud.websecurityscanner.v1alpha.WebSecurityScanner" + } + } + } + }, + { + "regionTag": "websecurityscanner_v1alpha_generated_WebSecurityScanner_ListFindings_async", + "title": "WebSecurityScanner listFindings Sample", + "origin": "API_DEFINITION", + "description": " List Findings under a given ScanRun.", + "canonical": true, + "file": "web_security_scanner.list_findings.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 77, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "ListFindings", + "fullName": "google.cloud.websecurityscanner.v1alpha.WebSecurityScanner.ListFindings", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "filter", + "type": "TYPE_STRING" + }, + { + "name": "page_token", + "type": "TYPE_STRING" + }, + { + "name": "page_size", + "type": "TYPE_INT32" + } + ], + "resultType": ".google.cloud.websecurityscanner.v1alpha.ListFindingsResponse", + "client": { + "shortName": "WebSecurityScannerClient", + "fullName": "google.cloud.websecurityscanner.v1alpha.WebSecurityScannerClient" + }, + "method": { + "shortName": "ListFindings", + "fullName": "google.cloud.websecurityscanner.v1alpha.WebSecurityScanner.ListFindings", + "service": { + "shortName": "WebSecurityScanner", + "fullName": "google.cloud.websecurityscanner.v1alpha.WebSecurityScanner" + } + } + } + }, + { + "regionTag": "websecurityscanner_v1alpha_generated_WebSecurityScanner_ListFindingTypeStats_async", + "title": "WebSecurityScanner listFindingTypeStats Sample", + "origin": "API_DEFINITION", + "description": " List all FindingTypeStats under a given ScanRun.", + "canonical": true, + "file": "web_security_scanner.list_finding_type_stats.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 55, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "ListFindingTypeStats", + "fullName": "google.cloud.websecurityscanner.v1alpha.WebSecurityScanner.ListFindingTypeStats", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.websecurityscanner.v1alpha.ListFindingTypeStatsResponse", + "client": { + "shortName": "WebSecurityScannerClient", + "fullName": "google.cloud.websecurityscanner.v1alpha.WebSecurityScannerClient" + }, + "method": { + "shortName": "ListFindingTypeStats", + "fullName": "google.cloud.websecurityscanner.v1alpha.WebSecurityScanner.ListFindingTypeStats", + "service": { + "shortName": "WebSecurityScanner", + "fullName": "google.cloud.websecurityscanner.v1alpha.WebSecurityScanner" + } + } + } + } + ] +} \ No newline at end of file diff --git a/packages/google-cloud-websecurityscanner/samples/generated/v1alpha/web_security_scanner.create_scan_config.js b/packages/google-cloud-websecurityscanner/samples/generated/v1alpha/web_security_scanner.create_scan_config.js new file mode 100644 index 00000000000..f1c2186b8e0 --- /dev/null +++ b/packages/google-cloud-websecurityscanner/samples/generated/v1alpha/web_security_scanner.create_scan_config.js @@ -0,0 +1,67 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(parent, scanConfig) { + // [START websecurityscanner_v1alpha_generated_WebSecurityScanner_CreateScanConfig_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require 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 name where the scan is created, which should be a + * project resource name in the format 'projects/{projectId}'. + */ + // const parent = 'abc123' + /** + * Required. The ScanConfig to be created. + */ + // const scanConfig = {} + + // Imports the Websecurityscanner library + const {WebSecurityScannerClient} = require('@google-cloud/web-security-scanner').v1alpha; + + // Instantiates a client + const websecurityscannerClient = new WebSecurityScannerClient(); + + async function callCreateScanConfig() { + // Construct request + const request = { + parent, + scanConfig, + }; + + // Run request + const response = await websecurityscannerClient.createScanConfig(request); + console.log(response); + } + + callCreateScanConfig(); + // [END websecurityscanner_v1alpha_generated_WebSecurityScanner_CreateScanConfig_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-websecurityscanner/samples/generated/v1alpha/web_security_scanner.delete_scan_config.js b/packages/google-cloud-websecurityscanner/samples/generated/v1alpha/web_security_scanner.delete_scan_config.js new file mode 100644 index 00000000000..ed9a9196882 --- /dev/null +++ b/packages/google-cloud-websecurityscanner/samples/generated/v1alpha/web_security_scanner.delete_scan_config.js @@ -0,0 +1,62 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(name) { + // [START websecurityscanner_v1alpha_generated_WebSecurityScanner_DeleteScanConfig_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require 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 ScanConfig to be deleted. The name follows the + * format of 'projects/{projectId}/scanConfigs/{scanConfigId}'. + */ + // const name = 'abc123' + + // Imports the Websecurityscanner library + const {WebSecurityScannerClient} = require('@google-cloud/web-security-scanner').v1alpha; + + // Instantiates a client + const websecurityscannerClient = new WebSecurityScannerClient(); + + async function callDeleteScanConfig() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await websecurityscannerClient.deleteScanConfig(request); + console.log(response); + } + + callDeleteScanConfig(); + // [END websecurityscanner_v1alpha_generated_WebSecurityScanner_DeleteScanConfig_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-websecurityscanner/samples/generated/v1alpha/web_security_scanner.get_finding.js b/packages/google-cloud-websecurityscanner/samples/generated/v1alpha/web_security_scanner.get_finding.js new file mode 100644 index 00000000000..77579f62998 --- /dev/null +++ b/packages/google-cloud-websecurityscanner/samples/generated/v1alpha/web_security_scanner.get_finding.js @@ -0,0 +1,63 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(name) { + // [START websecurityscanner_v1alpha_generated_WebSecurityScanner_GetFinding_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require 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 Finding to be returned. The name follows the + * format of + * 'projects/{projectId}/scanConfigs/{scanConfigId}/scanRuns/{scanRunId}/findings/{findingId}'. + */ + // const name = 'abc123' + + // Imports the Websecurityscanner library + const {WebSecurityScannerClient} = require('@google-cloud/web-security-scanner').v1alpha; + + // Instantiates a client + const websecurityscannerClient = new WebSecurityScannerClient(); + + async function callGetFinding() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await websecurityscannerClient.getFinding(request); + console.log(response); + } + + callGetFinding(); + // [END websecurityscanner_v1alpha_generated_WebSecurityScanner_GetFinding_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-websecurityscanner/samples/generated/v1alpha/web_security_scanner.get_scan_config.js b/packages/google-cloud-websecurityscanner/samples/generated/v1alpha/web_security_scanner.get_scan_config.js new file mode 100644 index 00000000000..a617e277633 --- /dev/null +++ b/packages/google-cloud-websecurityscanner/samples/generated/v1alpha/web_security_scanner.get_scan_config.js @@ -0,0 +1,62 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(name) { + // [START websecurityscanner_v1alpha_generated_WebSecurityScanner_GetScanConfig_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require 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 ScanConfig to be returned. The name follows the + * format of 'projects/{projectId}/scanConfigs/{scanConfigId}'. + */ + // const name = 'abc123' + + // Imports the Websecurityscanner library + const {WebSecurityScannerClient} = require('@google-cloud/web-security-scanner').v1alpha; + + // Instantiates a client + const websecurityscannerClient = new WebSecurityScannerClient(); + + async function callGetScanConfig() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await websecurityscannerClient.getScanConfig(request); + console.log(response); + } + + callGetScanConfig(); + // [END websecurityscanner_v1alpha_generated_WebSecurityScanner_GetScanConfig_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-websecurityscanner/samples/generated/v1alpha/web_security_scanner.get_scan_run.js b/packages/google-cloud-websecurityscanner/samples/generated/v1alpha/web_security_scanner.get_scan_run.js new file mode 100644 index 00000000000..a8df8aac80e --- /dev/null +++ b/packages/google-cloud-websecurityscanner/samples/generated/v1alpha/web_security_scanner.get_scan_run.js @@ -0,0 +1,63 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(name) { + // [START websecurityscanner_v1alpha_generated_WebSecurityScanner_GetScanRun_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require 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 ScanRun to be returned. The name follows the + * format of + * 'projects/{projectId}/scanConfigs/{scanConfigId}/scanRuns/{scanRunId}'. + */ + // const name = 'abc123' + + // Imports the Websecurityscanner library + const {WebSecurityScannerClient} = require('@google-cloud/web-security-scanner').v1alpha; + + // Instantiates a client + const websecurityscannerClient = new WebSecurityScannerClient(); + + async function callGetScanRun() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await websecurityscannerClient.getScanRun(request); + console.log(response); + } + + callGetScanRun(); + // [END websecurityscanner_v1alpha_generated_WebSecurityScanner_GetScanRun_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-websecurityscanner/samples/generated/v1alpha/web_security_scanner.list_crawled_urls.js b/packages/google-cloud-websecurityscanner/samples/generated/v1alpha/web_security_scanner.list_crawled_urls.js new file mode 100644 index 00000000000..b7e64a076b7 --- /dev/null +++ b/packages/google-cloud-websecurityscanner/samples/generated/v1alpha/web_security_scanner.list_crawled_urls.js @@ -0,0 +1,77 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(parent) { + // [START websecurityscanner_v1alpha_generated_WebSecurityScanner_ListCrawledUrls_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require 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 name, which should be a scan run resource name in the + * format + * 'projects/{projectId}/scanConfigs/{scanConfigId}/scanRuns/{scanRunId}'. + */ + // const parent = 'abc123' + /** + * A token identifying a page of results to be returned. This should be a + * `next_page_token` value returned from a previous List request. + * If unspecified, the first page of results is returned. + */ + // const pageToken = 'abc123' + /** + * The maximum number of CrawledUrls to return, can be limited by server. + * If not specified or not positive, the implementation will select a + * reasonable value. + */ + // const pageSize = 1234 + + // Imports the Websecurityscanner library + const {WebSecurityScannerClient} = require('@google-cloud/web-security-scanner').v1alpha; + + // Instantiates a client + const websecurityscannerClient = new WebSecurityScannerClient(); + + async function callListCrawledUrls() { + // Construct request + const request = { + parent, + }; + + // Run request + const iterable = await websecurityscannerClient.listCrawledUrlsAsync(request); + for await (const response of iterable) { + console.log(response); + } + } + + callListCrawledUrls(); + // [END websecurityscanner_v1alpha_generated_WebSecurityScanner_ListCrawledUrls_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-websecurityscanner/samples/generated/v1alpha/web_security_scanner.list_finding_type_stats.js b/packages/google-cloud-websecurityscanner/samples/generated/v1alpha/web_security_scanner.list_finding_type_stats.js new file mode 100644 index 00000000000..2b3682c8622 --- /dev/null +++ b/packages/google-cloud-websecurityscanner/samples/generated/v1alpha/web_security_scanner.list_finding_type_stats.js @@ -0,0 +1,63 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(parent) { + // [START websecurityscanner_v1alpha_generated_WebSecurityScanner_ListFindingTypeStats_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require 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 name, which should be a scan run resource name in the + * format + * 'projects/{projectId}/scanConfigs/{scanConfigId}/scanRuns/{scanRunId}'. + */ + // const parent = 'abc123' + + // Imports the Websecurityscanner library + const {WebSecurityScannerClient} = require('@google-cloud/web-security-scanner').v1alpha; + + // Instantiates a client + const websecurityscannerClient = new WebSecurityScannerClient(); + + async function callListFindingTypeStats() { + // Construct request + const request = { + parent, + }; + + // Run request + const response = await websecurityscannerClient.listFindingTypeStats(request); + console.log(response); + } + + callListFindingTypeStats(); + // [END websecurityscanner_v1alpha_generated_WebSecurityScanner_ListFindingTypeStats_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-websecurityscanner/samples/generated/v1alpha/web_security_scanner.list_findings.js b/packages/google-cloud-websecurityscanner/samples/generated/v1alpha/web_security_scanner.list_findings.js new file mode 100644 index 00000000000..0086231ccdc --- /dev/null +++ b/packages/google-cloud-websecurityscanner/samples/generated/v1alpha/web_security_scanner.list_findings.js @@ -0,0 +1,85 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(parent, filter) { + // [START websecurityscanner_v1alpha_generated_WebSecurityScanner_ListFindings_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require 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 name, which should be a scan run resource name in the + * format + * 'projects/{projectId}/scanConfigs/{scanConfigId}/scanRuns/{scanRunId}'. + */ + // const parent = 'abc123' + /** + * Required. The filter expression. The expression must be in the format: + * . + * Supported field: 'finding_type'. + * Supported operator: '='. + */ + // const filter = 'abc123' + /** + * A token identifying a page of results to be returned. This should be a + * `next_page_token` value returned from a previous List request. + * If unspecified, the first page of results is returned. + */ + // const pageToken = 'abc123' + /** + * The maximum number of Findings to return, can be limited by server. + * If not specified or not positive, the implementation will select a + * reasonable value. + */ + // const pageSize = 1234 + + // Imports the Websecurityscanner library + const {WebSecurityScannerClient} = require('@google-cloud/web-security-scanner').v1alpha; + + // Instantiates a client + const websecurityscannerClient = new WebSecurityScannerClient(); + + async function callListFindings() { + // Construct request + const request = { + parent, + filter, + }; + + // Run request + const iterable = await websecurityscannerClient.listFindingsAsync(request); + for await (const response of iterable) { + console.log(response); + } + } + + callListFindings(); + // [END websecurityscanner_v1alpha_generated_WebSecurityScanner_ListFindings_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-websecurityscanner/samples/generated/v1alpha/web_security_scanner.list_scan_configs.js b/packages/google-cloud-websecurityscanner/samples/generated/v1alpha/web_security_scanner.list_scan_configs.js new file mode 100644 index 00000000000..c0d63c4e563 --- /dev/null +++ b/packages/google-cloud-websecurityscanner/samples/generated/v1alpha/web_security_scanner.list_scan_configs.js @@ -0,0 +1,76 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(parent) { + // [START websecurityscanner_v1alpha_generated_WebSecurityScanner_ListScanConfigs_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require 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 name, which should be a project resource name in the + * format 'projects/{projectId}'. + */ + // const parent = 'abc123' + /** + * A token identifying a page of results to be returned. This should be a + * `next_page_token` value returned from a previous List request. + * If unspecified, the first page of results is returned. + */ + // const pageToken = 'abc123' + /** + * The maximum number of ScanConfigs to return, can be limited by server. + * If not specified or not positive, the implementation will select a + * reasonable value. + */ + // const pageSize = 1234 + + // Imports the Websecurityscanner library + const {WebSecurityScannerClient} = require('@google-cloud/web-security-scanner').v1alpha; + + // Instantiates a client + const websecurityscannerClient = new WebSecurityScannerClient(); + + async function callListScanConfigs() { + // Construct request + const request = { + parent, + }; + + // Run request + const iterable = await websecurityscannerClient.listScanConfigsAsync(request); + for await (const response of iterable) { + console.log(response); + } + } + + callListScanConfigs(); + // [END websecurityscanner_v1alpha_generated_WebSecurityScanner_ListScanConfigs_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-websecurityscanner/samples/generated/v1alpha/web_security_scanner.list_scan_runs.js b/packages/google-cloud-websecurityscanner/samples/generated/v1alpha/web_security_scanner.list_scan_runs.js new file mode 100644 index 00000000000..86ba468d62e --- /dev/null +++ b/packages/google-cloud-websecurityscanner/samples/generated/v1alpha/web_security_scanner.list_scan_runs.js @@ -0,0 +1,76 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(parent) { + // [START websecurityscanner_v1alpha_generated_WebSecurityScanner_ListScanRuns_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require 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 name, which should be a scan resource name in the + * format 'projects/{projectId}/scanConfigs/{scanConfigId}'. + */ + // const parent = 'abc123' + /** + * A token identifying a page of results to be returned. This should be a + * `next_page_token` value returned from a previous List request. + * If unspecified, the first page of results is returned. + */ + // const pageToken = 'abc123' + /** + * The maximum number of ScanRuns to return, can be limited by server. + * If not specified or not positive, the implementation will select a + * reasonable value. + */ + // const pageSize = 1234 + + // Imports the Websecurityscanner library + const {WebSecurityScannerClient} = require('@google-cloud/web-security-scanner').v1alpha; + + // Instantiates a client + const websecurityscannerClient = new WebSecurityScannerClient(); + + async function callListScanRuns() { + // Construct request + const request = { + parent, + }; + + // Run request + const iterable = await websecurityscannerClient.listScanRunsAsync(request); + for await (const response of iterable) { + console.log(response); + } + } + + callListScanRuns(); + // [END websecurityscanner_v1alpha_generated_WebSecurityScanner_ListScanRuns_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-websecurityscanner/samples/generated/v1alpha/web_security_scanner.start_scan_run.js b/packages/google-cloud-websecurityscanner/samples/generated/v1alpha/web_security_scanner.start_scan_run.js new file mode 100644 index 00000000000..c7546d321d5 --- /dev/null +++ b/packages/google-cloud-websecurityscanner/samples/generated/v1alpha/web_security_scanner.start_scan_run.js @@ -0,0 +1,62 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(name) { + // [START websecurityscanner_v1alpha_generated_WebSecurityScanner_StartScanRun_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require 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 ScanConfig to be used. The name follows the + * format of 'projects/{projectId}/scanConfigs/{scanConfigId}'. + */ + // const name = 'abc123' + + // Imports the Websecurityscanner library + const {WebSecurityScannerClient} = require('@google-cloud/web-security-scanner').v1alpha; + + // Instantiates a client + const websecurityscannerClient = new WebSecurityScannerClient(); + + async function callStartScanRun() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await websecurityscannerClient.startScanRun(request); + console.log(response); + } + + callStartScanRun(); + // [END websecurityscanner_v1alpha_generated_WebSecurityScanner_StartScanRun_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-websecurityscanner/samples/generated/v1alpha/web_security_scanner.stop_scan_run.js b/packages/google-cloud-websecurityscanner/samples/generated/v1alpha/web_security_scanner.stop_scan_run.js new file mode 100644 index 00000000000..724c243c675 --- /dev/null +++ b/packages/google-cloud-websecurityscanner/samples/generated/v1alpha/web_security_scanner.stop_scan_run.js @@ -0,0 +1,63 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(name) { + // [START websecurityscanner_v1alpha_generated_WebSecurityScanner_StopScanRun_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require 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 ScanRun to be stopped. The name follows the + * format of + * 'projects/{projectId}/scanConfigs/{scanConfigId}/scanRuns/{scanRunId}'. + */ + // const name = 'abc123' + + // Imports the Websecurityscanner library + const {WebSecurityScannerClient} = require('@google-cloud/web-security-scanner').v1alpha; + + // Instantiates a client + const websecurityscannerClient = new WebSecurityScannerClient(); + + async function callStopScanRun() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await websecurityscannerClient.stopScanRun(request); + console.log(response); + } + + callStopScanRun(); + // [END websecurityscanner_v1alpha_generated_WebSecurityScanner_StopScanRun_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-websecurityscanner/samples/generated/v1alpha/web_security_scanner.update_scan_config.js b/packages/google-cloud-websecurityscanner/samples/generated/v1alpha/web_security_scanner.update_scan_config.js new file mode 100644 index 00000000000..6f9ea3986d0 --- /dev/null +++ b/packages/google-cloud-websecurityscanner/samples/generated/v1alpha/web_security_scanner.update_scan_config.js @@ -0,0 +1,70 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(scanConfig, updateMask) { + // [START websecurityscanner_v1alpha_generated_WebSecurityScanner_UpdateScanConfig_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The ScanConfig to be updated. The name field must be set to identify the + * resource to be updated. The values of fields not covered by the mask + * will be ignored. + */ + // const scanConfig = {} + /** + * Required. The update mask applies to the resource. For the `FieldMask` definition, + * see + * https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#fieldmask + */ + // const updateMask = {} + + // Imports the Websecurityscanner library + const {WebSecurityScannerClient} = require('@google-cloud/web-security-scanner').v1alpha; + + // Instantiates a client + const websecurityscannerClient = new WebSecurityScannerClient(); + + async function callUpdateScanConfig() { + // Construct request + const request = { + scanConfig, + updateMask, + }; + + // Run request + const response = await websecurityscannerClient.updateScanConfig(request); + console.log(response); + } + + callUpdateScanConfig(); + // [END websecurityscanner_v1alpha_generated_WebSecurityScanner_UpdateScanConfig_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-websecurityscanner/samples/generated/v1beta/snippet_metadata.google.cloud.websecurityscanner.v1beta.json b/packages/google-cloud-websecurityscanner/samples/generated/v1beta/snippet_metadata.google.cloud.websecurityscanner.v1beta.json new file mode 100644 index 00000000000..77438b7583b --- /dev/null +++ b/packages/google-cloud-websecurityscanner/samples/generated/v1beta/snippet_metadata.google.cloud.websecurityscanner.v1beta.json @@ -0,0 +1,579 @@ +{ + "clientLibrary": { + "name": "nodejs-websecurityscanner", + "version": "2.1.3", + "language": "TYPESCRIPT", + "apis": [ + { + "id": "google.cloud.websecurityscanner.v1beta", + "version": "v1beta" + } + ] + }, + "snippets": [ + { + "regionTag": "websecurityscanner_v1beta_generated_WebSecurityScanner_CreateScanConfig_async", + "title": "WebSecurityScanner createScanConfig Sample", + "origin": "API_DEFINITION", + "description": " Creates a new ScanConfig.", + "canonical": true, + "file": "web_security_scanner.create_scan_config.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 59, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "CreateScanConfig", + "fullName": "google.cloud.websecurityscanner.v1beta.WebSecurityScanner.CreateScanConfig", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "scan_config", + "type": ".google.cloud.websecurityscanner.v1beta.ScanConfig" + } + ], + "resultType": ".google.cloud.websecurityscanner.v1beta.ScanConfig", + "client": { + "shortName": "WebSecurityScannerClient", + "fullName": "google.cloud.websecurityscanner.v1beta.WebSecurityScannerClient" + }, + "method": { + "shortName": "CreateScanConfig", + "fullName": "google.cloud.websecurityscanner.v1beta.WebSecurityScanner.CreateScanConfig", + "service": { + "shortName": "WebSecurityScanner", + "fullName": "google.cloud.websecurityscanner.v1beta.WebSecurityScanner" + } + } + } + }, + { + "regionTag": "websecurityscanner_v1beta_generated_WebSecurityScanner_DeleteScanConfig_async", + "title": "WebSecurityScanner deleteScanConfig Sample", + "origin": "API_DEFINITION", + "description": " Deletes an existing ScanConfig and its child resources.", + "canonical": true, + "file": "web_security_scanner.delete_scan_config.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 54, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "DeleteScanConfig", + "fullName": "google.cloud.websecurityscanner.v1beta.WebSecurityScanner.DeleteScanConfig", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.protobuf.Empty", + "client": { + "shortName": "WebSecurityScannerClient", + "fullName": "google.cloud.websecurityscanner.v1beta.WebSecurityScannerClient" + }, + "method": { + "shortName": "DeleteScanConfig", + "fullName": "google.cloud.websecurityscanner.v1beta.WebSecurityScanner.DeleteScanConfig", + "service": { + "shortName": "WebSecurityScanner", + "fullName": "google.cloud.websecurityscanner.v1beta.WebSecurityScanner" + } + } + } + }, + { + "regionTag": "websecurityscanner_v1beta_generated_WebSecurityScanner_GetScanConfig_async", + "title": "WebSecurityScanner getScanConfig Sample", + "origin": "API_DEFINITION", + "description": " Gets a ScanConfig.", + "canonical": true, + "file": "web_security_scanner.get_scan_config.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 54, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "GetScanConfig", + "fullName": "google.cloud.websecurityscanner.v1beta.WebSecurityScanner.GetScanConfig", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.websecurityscanner.v1beta.ScanConfig", + "client": { + "shortName": "WebSecurityScannerClient", + "fullName": "google.cloud.websecurityscanner.v1beta.WebSecurityScannerClient" + }, + "method": { + "shortName": "GetScanConfig", + "fullName": "google.cloud.websecurityscanner.v1beta.WebSecurityScanner.GetScanConfig", + "service": { + "shortName": "WebSecurityScanner", + "fullName": "google.cloud.websecurityscanner.v1beta.WebSecurityScanner" + } + } + } + }, + { + "regionTag": "websecurityscanner_v1beta_generated_WebSecurityScanner_ListScanConfigs_async", + "title": "WebSecurityScanner listScanConfigs Sample", + "origin": "API_DEFINITION", + "description": " Lists ScanConfigs under a given project.", + "canonical": true, + "file": "web_security_scanner.list_scan_configs.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 68, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "ListScanConfigs", + "fullName": "google.cloud.websecurityscanner.v1beta.WebSecurityScanner.ListScanConfigs", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "page_token", + "type": "TYPE_STRING" + }, + { + "name": "page_size", + "type": "TYPE_INT32" + } + ], + "resultType": ".google.cloud.websecurityscanner.v1beta.ListScanConfigsResponse", + "client": { + "shortName": "WebSecurityScannerClient", + "fullName": "google.cloud.websecurityscanner.v1beta.WebSecurityScannerClient" + }, + "method": { + "shortName": "ListScanConfigs", + "fullName": "google.cloud.websecurityscanner.v1beta.WebSecurityScanner.ListScanConfigs", + "service": { + "shortName": "WebSecurityScanner", + "fullName": "google.cloud.websecurityscanner.v1beta.WebSecurityScanner" + } + } + } + }, + { + "regionTag": "websecurityscanner_v1beta_generated_WebSecurityScanner_UpdateScanConfig_async", + "title": "WebSecurityScanner updateScanConfig Sample", + "origin": "API_DEFINITION", + "description": " Updates a ScanConfig. This method support partial update of a ScanConfig.", + "canonical": true, + "file": "web_security_scanner.update_scan_config.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 62, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "UpdateScanConfig", + "fullName": "google.cloud.websecurityscanner.v1beta.WebSecurityScanner.UpdateScanConfig", + "async": true, + "parameters": [ + { + "name": "scan_config", + "type": ".google.cloud.websecurityscanner.v1beta.ScanConfig" + }, + { + "name": "update_mask", + "type": ".google.protobuf.FieldMask" + } + ], + "resultType": ".google.cloud.websecurityscanner.v1beta.ScanConfig", + "client": { + "shortName": "WebSecurityScannerClient", + "fullName": "google.cloud.websecurityscanner.v1beta.WebSecurityScannerClient" + }, + "method": { + "shortName": "UpdateScanConfig", + "fullName": "google.cloud.websecurityscanner.v1beta.WebSecurityScanner.UpdateScanConfig", + "service": { + "shortName": "WebSecurityScanner", + "fullName": "google.cloud.websecurityscanner.v1beta.WebSecurityScanner" + } + } + } + }, + { + "regionTag": "websecurityscanner_v1beta_generated_WebSecurityScanner_StartScanRun_async", + "title": "WebSecurityScanner startScanRun Sample", + "origin": "API_DEFINITION", + "description": " Start a ScanRun according to the given ScanConfig.", + "canonical": true, + "file": "web_security_scanner.start_scan_run.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 54, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "StartScanRun", + "fullName": "google.cloud.websecurityscanner.v1beta.WebSecurityScanner.StartScanRun", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.websecurityscanner.v1beta.ScanRun", + "client": { + "shortName": "WebSecurityScannerClient", + "fullName": "google.cloud.websecurityscanner.v1beta.WebSecurityScannerClient" + }, + "method": { + "shortName": "StartScanRun", + "fullName": "google.cloud.websecurityscanner.v1beta.WebSecurityScanner.StartScanRun", + "service": { + "shortName": "WebSecurityScanner", + "fullName": "google.cloud.websecurityscanner.v1beta.WebSecurityScanner" + } + } + } + }, + { + "regionTag": "websecurityscanner_v1beta_generated_WebSecurityScanner_GetScanRun_async", + "title": "WebSecurityScanner getScanRun Sample", + "origin": "API_DEFINITION", + "description": " Gets a ScanRun.", + "canonical": true, + "file": "web_security_scanner.get_scan_run.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 55, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "GetScanRun", + "fullName": "google.cloud.websecurityscanner.v1beta.WebSecurityScanner.GetScanRun", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.websecurityscanner.v1beta.ScanRun", + "client": { + "shortName": "WebSecurityScannerClient", + "fullName": "google.cloud.websecurityscanner.v1beta.WebSecurityScannerClient" + }, + "method": { + "shortName": "GetScanRun", + "fullName": "google.cloud.websecurityscanner.v1beta.WebSecurityScanner.GetScanRun", + "service": { + "shortName": "WebSecurityScanner", + "fullName": "google.cloud.websecurityscanner.v1beta.WebSecurityScanner" + } + } + } + }, + { + "regionTag": "websecurityscanner_v1beta_generated_WebSecurityScanner_ListScanRuns_async", + "title": "WebSecurityScanner listScanRuns Sample", + "origin": "API_DEFINITION", + "description": " Lists ScanRuns under a given ScanConfig, in descending order of ScanRun stop time.", + "canonical": true, + "file": "web_security_scanner.list_scan_runs.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 68, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "ListScanRuns", + "fullName": "google.cloud.websecurityscanner.v1beta.WebSecurityScanner.ListScanRuns", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "page_token", + "type": "TYPE_STRING" + }, + { + "name": "page_size", + "type": "TYPE_INT32" + } + ], + "resultType": ".google.cloud.websecurityscanner.v1beta.ListScanRunsResponse", + "client": { + "shortName": "WebSecurityScannerClient", + "fullName": "google.cloud.websecurityscanner.v1beta.WebSecurityScannerClient" + }, + "method": { + "shortName": "ListScanRuns", + "fullName": "google.cloud.websecurityscanner.v1beta.WebSecurityScanner.ListScanRuns", + "service": { + "shortName": "WebSecurityScanner", + "fullName": "google.cloud.websecurityscanner.v1beta.WebSecurityScanner" + } + } + } + }, + { + "regionTag": "websecurityscanner_v1beta_generated_WebSecurityScanner_StopScanRun_async", + "title": "WebSecurityScanner stopScanRun Sample", + "origin": "API_DEFINITION", + "description": " Stops a ScanRun. The stopped ScanRun is returned.", + "canonical": true, + "file": "web_security_scanner.stop_scan_run.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 55, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "StopScanRun", + "fullName": "google.cloud.websecurityscanner.v1beta.WebSecurityScanner.StopScanRun", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.websecurityscanner.v1beta.ScanRun", + "client": { + "shortName": "WebSecurityScannerClient", + "fullName": "google.cloud.websecurityscanner.v1beta.WebSecurityScannerClient" + }, + "method": { + "shortName": "StopScanRun", + "fullName": "google.cloud.websecurityscanner.v1beta.WebSecurityScanner.StopScanRun", + "service": { + "shortName": "WebSecurityScanner", + "fullName": "google.cloud.websecurityscanner.v1beta.WebSecurityScanner" + } + } + } + }, + { + "regionTag": "websecurityscanner_v1beta_generated_WebSecurityScanner_ListCrawledUrls_async", + "title": "WebSecurityScanner listCrawledUrls Sample", + "origin": "API_DEFINITION", + "description": " List CrawledUrls under a given ScanRun.", + "canonical": true, + "file": "web_security_scanner.list_crawled_urls.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 69, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "ListCrawledUrls", + "fullName": "google.cloud.websecurityscanner.v1beta.WebSecurityScanner.ListCrawledUrls", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "page_token", + "type": "TYPE_STRING" + }, + { + "name": "page_size", + "type": "TYPE_INT32" + } + ], + "resultType": ".google.cloud.websecurityscanner.v1beta.ListCrawledUrlsResponse", + "client": { + "shortName": "WebSecurityScannerClient", + "fullName": "google.cloud.websecurityscanner.v1beta.WebSecurityScannerClient" + }, + "method": { + "shortName": "ListCrawledUrls", + "fullName": "google.cloud.websecurityscanner.v1beta.WebSecurityScanner.ListCrawledUrls", + "service": { + "shortName": "WebSecurityScanner", + "fullName": "google.cloud.websecurityscanner.v1beta.WebSecurityScanner" + } + } + } + }, + { + "regionTag": "websecurityscanner_v1beta_generated_WebSecurityScanner_GetFinding_async", + "title": "WebSecurityScanner getFinding Sample", + "origin": "API_DEFINITION", + "description": " Gets a Finding.", + "canonical": true, + "file": "web_security_scanner.get_finding.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 55, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "GetFinding", + "fullName": "google.cloud.websecurityscanner.v1beta.WebSecurityScanner.GetFinding", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.websecurityscanner.v1beta.Finding", + "client": { + "shortName": "WebSecurityScannerClient", + "fullName": "google.cloud.websecurityscanner.v1beta.WebSecurityScannerClient" + }, + "method": { + "shortName": "GetFinding", + "fullName": "google.cloud.websecurityscanner.v1beta.WebSecurityScanner.GetFinding", + "service": { + "shortName": "WebSecurityScanner", + "fullName": "google.cloud.websecurityscanner.v1beta.WebSecurityScanner" + } + } + } + }, + { + "regionTag": "websecurityscanner_v1beta_generated_WebSecurityScanner_ListFindings_async", + "title": "WebSecurityScanner listFindings Sample", + "origin": "API_DEFINITION", + "description": " List Findings under a given ScanRun.", + "canonical": true, + "file": "web_security_scanner.list_findings.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 77, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "ListFindings", + "fullName": "google.cloud.websecurityscanner.v1beta.WebSecurityScanner.ListFindings", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "filter", + "type": "TYPE_STRING" + }, + { + "name": "page_token", + "type": "TYPE_STRING" + }, + { + "name": "page_size", + "type": "TYPE_INT32" + } + ], + "resultType": ".google.cloud.websecurityscanner.v1beta.ListFindingsResponse", + "client": { + "shortName": "WebSecurityScannerClient", + "fullName": "google.cloud.websecurityscanner.v1beta.WebSecurityScannerClient" + }, + "method": { + "shortName": "ListFindings", + "fullName": "google.cloud.websecurityscanner.v1beta.WebSecurityScanner.ListFindings", + "service": { + "shortName": "WebSecurityScanner", + "fullName": "google.cloud.websecurityscanner.v1beta.WebSecurityScanner" + } + } + } + }, + { + "regionTag": "websecurityscanner_v1beta_generated_WebSecurityScanner_ListFindingTypeStats_async", + "title": "WebSecurityScanner listFindingTypeStats Sample", + "origin": "API_DEFINITION", + "description": " List all FindingTypeStats under a given ScanRun.", + "canonical": true, + "file": "web_security_scanner.list_finding_type_stats.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 55, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "ListFindingTypeStats", + "fullName": "google.cloud.websecurityscanner.v1beta.WebSecurityScanner.ListFindingTypeStats", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.websecurityscanner.v1beta.ListFindingTypeStatsResponse", + "client": { + "shortName": "WebSecurityScannerClient", + "fullName": "google.cloud.websecurityscanner.v1beta.WebSecurityScannerClient" + }, + "method": { + "shortName": "ListFindingTypeStats", + "fullName": "google.cloud.websecurityscanner.v1beta.WebSecurityScanner.ListFindingTypeStats", + "service": { + "shortName": "WebSecurityScanner", + "fullName": "google.cloud.websecurityscanner.v1beta.WebSecurityScanner" + } + } + } + } + ] +} \ No newline at end of file diff --git a/packages/google-cloud-websecurityscanner/samples/generated/v1beta/web_security_scanner.create_scan_config.js b/packages/google-cloud-websecurityscanner/samples/generated/v1beta/web_security_scanner.create_scan_config.js new file mode 100644 index 00000000000..306f7674dcd --- /dev/null +++ b/packages/google-cloud-websecurityscanner/samples/generated/v1beta/web_security_scanner.create_scan_config.js @@ -0,0 +1,67 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(parent, scanConfig) { + // [START websecurityscanner_v1beta_generated_WebSecurityScanner_CreateScanConfig_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require 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 name where the scan is created, which should be a + * project resource name in the format 'projects/{projectId}'. + */ + // const parent = 'abc123' + /** + * Required. The ScanConfig to be created. + */ + // const scanConfig = {} + + // Imports the Websecurityscanner library + const {WebSecurityScannerClient} = require('@google-cloud/web-security-scanner').v1beta; + + // Instantiates a client + const websecurityscannerClient = new WebSecurityScannerClient(); + + async function callCreateScanConfig() { + // Construct request + const request = { + parent, + scanConfig, + }; + + // Run request + const response = await websecurityscannerClient.createScanConfig(request); + console.log(response); + } + + callCreateScanConfig(); + // [END websecurityscanner_v1beta_generated_WebSecurityScanner_CreateScanConfig_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-websecurityscanner/samples/generated/v1beta/web_security_scanner.delete_scan_config.js b/packages/google-cloud-websecurityscanner/samples/generated/v1beta/web_security_scanner.delete_scan_config.js new file mode 100644 index 00000000000..3bfe08dedd4 --- /dev/null +++ b/packages/google-cloud-websecurityscanner/samples/generated/v1beta/web_security_scanner.delete_scan_config.js @@ -0,0 +1,62 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(name) { + // [START websecurityscanner_v1beta_generated_WebSecurityScanner_DeleteScanConfig_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require 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 ScanConfig to be deleted. The name follows the + * format of 'projects/{projectId}/scanConfigs/{scanConfigId}'. + */ + // const name = 'abc123' + + // Imports the Websecurityscanner library + const {WebSecurityScannerClient} = require('@google-cloud/web-security-scanner').v1beta; + + // Instantiates a client + const websecurityscannerClient = new WebSecurityScannerClient(); + + async function callDeleteScanConfig() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await websecurityscannerClient.deleteScanConfig(request); + console.log(response); + } + + callDeleteScanConfig(); + // [END websecurityscanner_v1beta_generated_WebSecurityScanner_DeleteScanConfig_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-websecurityscanner/samples/generated/v1beta/web_security_scanner.get_finding.js b/packages/google-cloud-websecurityscanner/samples/generated/v1beta/web_security_scanner.get_finding.js new file mode 100644 index 00000000000..b185af32559 --- /dev/null +++ b/packages/google-cloud-websecurityscanner/samples/generated/v1beta/web_security_scanner.get_finding.js @@ -0,0 +1,63 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(name) { + // [START websecurityscanner_v1beta_generated_WebSecurityScanner_GetFinding_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require 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 Finding to be returned. The name follows the + * format of + * 'projects/{projectId}/scanConfigs/{scanConfigId}/scanRuns/{scanRunId}/findings/{findingId}'. + */ + // const name = 'abc123' + + // Imports the Websecurityscanner library + const {WebSecurityScannerClient} = require('@google-cloud/web-security-scanner').v1beta; + + // Instantiates a client + const websecurityscannerClient = new WebSecurityScannerClient(); + + async function callGetFinding() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await websecurityscannerClient.getFinding(request); + console.log(response); + } + + callGetFinding(); + // [END websecurityscanner_v1beta_generated_WebSecurityScanner_GetFinding_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-websecurityscanner/samples/generated/v1beta/web_security_scanner.get_scan_config.js b/packages/google-cloud-websecurityscanner/samples/generated/v1beta/web_security_scanner.get_scan_config.js new file mode 100644 index 00000000000..73dc83a92fb --- /dev/null +++ b/packages/google-cloud-websecurityscanner/samples/generated/v1beta/web_security_scanner.get_scan_config.js @@ -0,0 +1,62 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(name) { + // [START websecurityscanner_v1beta_generated_WebSecurityScanner_GetScanConfig_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require 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 ScanConfig to be returned. The name follows the + * format of 'projects/{projectId}/scanConfigs/{scanConfigId}'. + */ + // const name = 'abc123' + + // Imports the Websecurityscanner library + const {WebSecurityScannerClient} = require('@google-cloud/web-security-scanner').v1beta; + + // Instantiates a client + const websecurityscannerClient = new WebSecurityScannerClient(); + + async function callGetScanConfig() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await websecurityscannerClient.getScanConfig(request); + console.log(response); + } + + callGetScanConfig(); + // [END websecurityscanner_v1beta_generated_WebSecurityScanner_GetScanConfig_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-websecurityscanner/samples/generated/v1beta/web_security_scanner.get_scan_run.js b/packages/google-cloud-websecurityscanner/samples/generated/v1beta/web_security_scanner.get_scan_run.js new file mode 100644 index 00000000000..bdd8bae1b64 --- /dev/null +++ b/packages/google-cloud-websecurityscanner/samples/generated/v1beta/web_security_scanner.get_scan_run.js @@ -0,0 +1,63 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(name) { + // [START websecurityscanner_v1beta_generated_WebSecurityScanner_GetScanRun_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require 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 ScanRun to be returned. The name follows the + * format of + * 'projects/{projectId}/scanConfigs/{scanConfigId}/scanRuns/{scanRunId}'. + */ + // const name = 'abc123' + + // Imports the Websecurityscanner library + const {WebSecurityScannerClient} = require('@google-cloud/web-security-scanner').v1beta; + + // Instantiates a client + const websecurityscannerClient = new WebSecurityScannerClient(); + + async function callGetScanRun() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await websecurityscannerClient.getScanRun(request); + console.log(response); + } + + callGetScanRun(); + // [END websecurityscanner_v1beta_generated_WebSecurityScanner_GetScanRun_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-websecurityscanner/samples/generated/v1beta/web_security_scanner.list_crawled_urls.js b/packages/google-cloud-websecurityscanner/samples/generated/v1beta/web_security_scanner.list_crawled_urls.js new file mode 100644 index 00000000000..240aa665799 --- /dev/null +++ b/packages/google-cloud-websecurityscanner/samples/generated/v1beta/web_security_scanner.list_crawled_urls.js @@ -0,0 +1,77 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(parent) { + // [START websecurityscanner_v1beta_generated_WebSecurityScanner_ListCrawledUrls_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require 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 name, which should be a scan run resource name in the + * format + * 'projects/{projectId}/scanConfigs/{scanConfigId}/scanRuns/{scanRunId}'. + */ + // const parent = 'abc123' + /** + * A token identifying a page of results to be returned. This should be a + * `next_page_token` value returned from a previous List request. + * If unspecified, the first page of results is returned. + */ + // const pageToken = 'abc123' + /** + * The maximum number of CrawledUrls to return, can be limited by server. + * If not specified or not positive, the implementation will select a + * reasonable value. + */ + // const pageSize = 1234 + + // Imports the Websecurityscanner library + const {WebSecurityScannerClient} = require('@google-cloud/web-security-scanner').v1beta; + + // Instantiates a client + const websecurityscannerClient = new WebSecurityScannerClient(); + + async function callListCrawledUrls() { + // Construct request + const request = { + parent, + }; + + // Run request + const iterable = await websecurityscannerClient.listCrawledUrlsAsync(request); + for await (const response of iterable) { + console.log(response); + } + } + + callListCrawledUrls(); + // [END websecurityscanner_v1beta_generated_WebSecurityScanner_ListCrawledUrls_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-websecurityscanner/samples/generated/v1beta/web_security_scanner.list_finding_type_stats.js b/packages/google-cloud-websecurityscanner/samples/generated/v1beta/web_security_scanner.list_finding_type_stats.js new file mode 100644 index 00000000000..15e60fb374e --- /dev/null +++ b/packages/google-cloud-websecurityscanner/samples/generated/v1beta/web_security_scanner.list_finding_type_stats.js @@ -0,0 +1,63 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(parent) { + // [START websecurityscanner_v1beta_generated_WebSecurityScanner_ListFindingTypeStats_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require 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 name, which should be a scan run resource name in the + * format + * 'projects/{projectId}/scanConfigs/{scanConfigId}/scanRuns/{scanRunId}'. + */ + // const parent = 'abc123' + + // Imports the Websecurityscanner library + const {WebSecurityScannerClient} = require('@google-cloud/web-security-scanner').v1beta; + + // Instantiates a client + const websecurityscannerClient = new WebSecurityScannerClient(); + + async function callListFindingTypeStats() { + // Construct request + const request = { + parent, + }; + + // Run request + const response = await websecurityscannerClient.listFindingTypeStats(request); + console.log(response); + } + + callListFindingTypeStats(); + // [END websecurityscanner_v1beta_generated_WebSecurityScanner_ListFindingTypeStats_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-websecurityscanner/samples/generated/v1beta/web_security_scanner.list_findings.js b/packages/google-cloud-websecurityscanner/samples/generated/v1beta/web_security_scanner.list_findings.js new file mode 100644 index 00000000000..e92c7079d7b --- /dev/null +++ b/packages/google-cloud-websecurityscanner/samples/generated/v1beta/web_security_scanner.list_findings.js @@ -0,0 +1,85 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(parent, filter) { + // [START websecurityscanner_v1beta_generated_WebSecurityScanner_ListFindings_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require 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 name, which should be a scan run resource name in the + * format + * 'projects/{projectId}/scanConfigs/{scanConfigId}/scanRuns/{scanRunId}'. + */ + // const parent = 'abc123' + /** + * Required. The filter expression. The expression must be in the format: + * . + * Supported field: 'finding_type'. + * Supported operator: '='. + */ + // const filter = 'abc123' + /** + * A token identifying a page of results to be returned. This should be a + * `next_page_token` value returned from a previous List request. + * If unspecified, the first page of results is returned. + */ + // const pageToken = 'abc123' + /** + * The maximum number of Findings to return, can be limited by server. + * If not specified or not positive, the implementation will select a + * reasonable value. + */ + // const pageSize = 1234 + + // Imports the Websecurityscanner library + const {WebSecurityScannerClient} = require('@google-cloud/web-security-scanner').v1beta; + + // Instantiates a client + const websecurityscannerClient = new WebSecurityScannerClient(); + + async function callListFindings() { + // Construct request + const request = { + parent, + filter, + }; + + // Run request + const iterable = await websecurityscannerClient.listFindingsAsync(request); + for await (const response of iterable) { + console.log(response); + } + } + + callListFindings(); + // [END websecurityscanner_v1beta_generated_WebSecurityScanner_ListFindings_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-websecurityscanner/samples/generated/v1beta/web_security_scanner.list_scan_configs.js b/packages/google-cloud-websecurityscanner/samples/generated/v1beta/web_security_scanner.list_scan_configs.js new file mode 100644 index 00000000000..79082baf8a6 --- /dev/null +++ b/packages/google-cloud-websecurityscanner/samples/generated/v1beta/web_security_scanner.list_scan_configs.js @@ -0,0 +1,76 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(parent) { + // [START websecurityscanner_v1beta_generated_WebSecurityScanner_ListScanConfigs_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require 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 name, which should be a project resource name in the + * format 'projects/{projectId}'. + */ + // const parent = 'abc123' + /** + * A token identifying a page of results to be returned. This should be a + * `next_page_token` value returned from a previous List request. + * If unspecified, the first page of results is returned. + */ + // const pageToken = 'abc123' + /** + * The maximum number of ScanConfigs to return, can be limited by server. + * If not specified or not positive, the implementation will select a + * reasonable value. + */ + // const pageSize = 1234 + + // Imports the Websecurityscanner library + const {WebSecurityScannerClient} = require('@google-cloud/web-security-scanner').v1beta; + + // Instantiates a client + const websecurityscannerClient = new WebSecurityScannerClient(); + + async function callListScanConfigs() { + // Construct request + const request = { + parent, + }; + + // Run request + const iterable = await websecurityscannerClient.listScanConfigsAsync(request); + for await (const response of iterable) { + console.log(response); + } + } + + callListScanConfigs(); + // [END websecurityscanner_v1beta_generated_WebSecurityScanner_ListScanConfigs_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-websecurityscanner/samples/generated/v1beta/web_security_scanner.list_scan_runs.js b/packages/google-cloud-websecurityscanner/samples/generated/v1beta/web_security_scanner.list_scan_runs.js new file mode 100644 index 00000000000..f2e099b1dd1 --- /dev/null +++ b/packages/google-cloud-websecurityscanner/samples/generated/v1beta/web_security_scanner.list_scan_runs.js @@ -0,0 +1,76 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(parent) { + // [START websecurityscanner_v1beta_generated_WebSecurityScanner_ListScanRuns_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require 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 name, which should be a scan resource name in the + * format 'projects/{projectId}/scanConfigs/{scanConfigId}'. + */ + // const parent = 'abc123' + /** + * A token identifying a page of results to be returned. This should be a + * `next_page_token` value returned from a previous List request. + * If unspecified, the first page of results is returned. + */ + // const pageToken = 'abc123' + /** + * The maximum number of ScanRuns to return, can be limited by server. + * If not specified or not positive, the implementation will select a + * reasonable value. + */ + // const pageSize = 1234 + + // Imports the Websecurityscanner library + const {WebSecurityScannerClient} = require('@google-cloud/web-security-scanner').v1beta; + + // Instantiates a client + const websecurityscannerClient = new WebSecurityScannerClient(); + + async function callListScanRuns() { + // Construct request + const request = { + parent, + }; + + // Run request + const iterable = await websecurityscannerClient.listScanRunsAsync(request); + for await (const response of iterable) { + console.log(response); + } + } + + callListScanRuns(); + // [END websecurityscanner_v1beta_generated_WebSecurityScanner_ListScanRuns_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-websecurityscanner/samples/generated/v1beta/web_security_scanner.start_scan_run.js b/packages/google-cloud-websecurityscanner/samples/generated/v1beta/web_security_scanner.start_scan_run.js new file mode 100644 index 00000000000..dcb689c00bf --- /dev/null +++ b/packages/google-cloud-websecurityscanner/samples/generated/v1beta/web_security_scanner.start_scan_run.js @@ -0,0 +1,62 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(name) { + // [START websecurityscanner_v1beta_generated_WebSecurityScanner_StartScanRun_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require 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 ScanConfig to be used. The name follows the + * format of 'projects/{projectId}/scanConfigs/{scanConfigId}'. + */ + // const name = 'abc123' + + // Imports the Websecurityscanner library + const {WebSecurityScannerClient} = require('@google-cloud/web-security-scanner').v1beta; + + // Instantiates a client + const websecurityscannerClient = new WebSecurityScannerClient(); + + async function callStartScanRun() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await websecurityscannerClient.startScanRun(request); + console.log(response); + } + + callStartScanRun(); + // [END websecurityscanner_v1beta_generated_WebSecurityScanner_StartScanRun_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-websecurityscanner/samples/generated/v1beta/web_security_scanner.stop_scan_run.js b/packages/google-cloud-websecurityscanner/samples/generated/v1beta/web_security_scanner.stop_scan_run.js new file mode 100644 index 00000000000..3a5b2d4055a --- /dev/null +++ b/packages/google-cloud-websecurityscanner/samples/generated/v1beta/web_security_scanner.stop_scan_run.js @@ -0,0 +1,63 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(name) { + // [START websecurityscanner_v1beta_generated_WebSecurityScanner_StopScanRun_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require 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 ScanRun to be stopped. The name follows the + * format of + * 'projects/{projectId}/scanConfigs/{scanConfigId}/scanRuns/{scanRunId}'. + */ + // const name = 'abc123' + + // Imports the Websecurityscanner library + const {WebSecurityScannerClient} = require('@google-cloud/web-security-scanner').v1beta; + + // Instantiates a client + const websecurityscannerClient = new WebSecurityScannerClient(); + + async function callStopScanRun() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await websecurityscannerClient.stopScanRun(request); + console.log(response); + } + + callStopScanRun(); + // [END websecurityscanner_v1beta_generated_WebSecurityScanner_StopScanRun_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-websecurityscanner/samples/generated/v1beta/web_security_scanner.update_scan_config.js b/packages/google-cloud-websecurityscanner/samples/generated/v1beta/web_security_scanner.update_scan_config.js new file mode 100644 index 00000000000..114952691bb --- /dev/null +++ b/packages/google-cloud-websecurityscanner/samples/generated/v1beta/web_security_scanner.update_scan_config.js @@ -0,0 +1,70 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(scanConfig, updateMask) { + // [START websecurityscanner_v1beta_generated_WebSecurityScanner_UpdateScanConfig_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The ScanConfig to be updated. The name field must be set to identify the + * resource to be updated. The values of fields not covered by the mask + * will be ignored. + */ + // const scanConfig = {} + /** + * Required. The update mask applies to the resource. For the `FieldMask` definition, + * see + * https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#fieldmask + */ + // const updateMask = {} + + // Imports the Websecurityscanner library + const {WebSecurityScannerClient} = require('@google-cloud/web-security-scanner').v1beta; + + // Instantiates a client + const websecurityscannerClient = new WebSecurityScannerClient(); + + async function callUpdateScanConfig() { + // Construct request + const request = { + scanConfig, + updateMask, + }; + + // Run request + const response = await websecurityscannerClient.updateScanConfig(request); + console.log(response); + } + + callUpdateScanConfig(); + // [END websecurityscanner_v1beta_generated_WebSecurityScanner_UpdateScanConfig_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-websecurityscanner/samples/package.json b/packages/google-cloud-websecurityscanner/samples/package.json new file mode 100644 index 00000000000..9c51b157625 --- /dev/null +++ b/packages/google-cloud-websecurityscanner/samples/package.json @@ -0,0 +1,23 @@ +{ + "name": "nodejs-web-security-scanner", + "private": true, + "license": "Apache-2.0", + "author": "Google LLC", + "engines": { + "node": ">=12.0.0" + }, + "files": [ + "*.js" + ], + "scripts": { + "test": "c8 mocha --timeout 600000 test/*.js" + }, + "dependencies": { + "@google-cloud/web-security-scanner": "^2.1.3" + }, + "devDependencies": { + "c8": "^7.1.0", + "chai": "^4.2.0", + "mocha": "^8.0.0" + } +} diff --git a/packages/google-cloud-websecurityscanner/samples/quickstart.js b/packages/google-cloud-websecurityscanner/samples/quickstart.js new file mode 100644 index 00000000000..e36cf4a7f22 --- /dev/null +++ b/packages/google-cloud-websecurityscanner/samples/quickstart.js @@ -0,0 +1,51 @@ +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// + +'use strict'; + +async function main(projectId) { + // [START nodejs_web_security_scanner_quickstart] + // Imports the Google Cloud client library + + // remove this line after package is released + // eslint-disable-next-line node/no-missing-require + const { + WebSecurityScannerClient, + } = require('@google-cloud/web-security-scanner'); + + // TODO(developer): replace with your prefered project ID. + // const projectId = 'my-project' + + // Creates a client + // eslint-disable-next-line no-unused-vars + const client = new WebSecurityScannerClient(); + + //TODO(library generator): write the actual function you will be testing + async function listConfigs() { + const stats = await client.listScanConfigs({ + parent: `projects/${projectId}`, + }); + console.info(stats); + } + listConfigs(); + // [END nodejs_web_security_scanner_quickstart] +} + +main(...process.argv.slice(2)).catch(err => { + console.error(err.message); + process.exitCode = 1; +}); +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); diff --git a/packages/google-cloud-websecurityscanner/samples/test/quickstart.js b/packages/google-cloud-websecurityscanner/samples/test/quickstart.js new file mode 100644 index 00000000000..3690c714a37 --- /dev/null +++ b/packages/google-cloud-websecurityscanner/samples/test/quickstart.js @@ -0,0 +1,50 @@ +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + +'use strict'; + +const path = require('path'); +const cp = require('child_process'); +const {before, describe, it} = require('mocha'); +// eslint-disable-next-line node/no-missing-require +const { + WebSecurityScannerClient, +} = require('@google-cloud/web-security-scanner'); +const {assert} = require('chai'); + +const execSync = cmd => cp.execSync(cmd, {encoding: 'utf-8'}); + +const cwd = path.join(__dirname, '..'); + +const client = new WebSecurityScannerClient(); + +describe('Quickstart', () => { + //TODO: remove this if not using the projectId + let projectId; + + before(async () => { + // eslint-disable-next-line no-unused-vars + projectId = await client.getProjectId(); + }); + + it('should run quickstart', async () => { + const stdout = execSync(`node ./quickstart.js ${projectId}`, { + cwd, + }); + assert(stdout, stdout.match(/\[\]/)); + }); +}); diff --git a/packages/google-cloud-websecurityscanner/src/index.ts b/packages/google-cloud-websecurityscanner/src/index.ts new file mode 100644 index 00000000000..6dafda10ced --- /dev/null +++ b/packages/google-cloud-websecurityscanner/src/index.ts @@ -0,0 +1,29 @@ +// Copyright 2020 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by synthtool. ** +// ** https://github.com/googleapis/synthtool ** +// ** All changes to this file may be overwritten. ** + +import * as v1 from './v1'; +import * as v1alpha from './v1alpha'; +import * as v1beta from './v1beta'; + +const WebSecurityScannerClient = v1beta.WebSecurityScannerClient; +type WebSecurityScannerClient = v1beta.WebSecurityScannerClient; + +export {v1, v1alpha, v1beta, WebSecurityScannerClient}; +export default {v1, v1alpha, v1beta, WebSecurityScannerClient}; +import * as protos from '../protos/protos'; +export {protos}; diff --git a/packages/google-cloud-websecurityscanner/src/v1/gapic_metadata.json b/packages/google-cloud-websecurityscanner/src/v1/gapic_metadata.json new file mode 100644 index 00000000000..6c589c52cb4 --- /dev/null +++ b/packages/google-cloud-websecurityscanner/src/v1/gapic_metadata.json @@ -0,0 +1,169 @@ +{ + "schema": "1.0", + "comment": "This file maps proto services/RPCs to the corresponding library clients/methods", + "language": "typescript", + "protoPackage": "google.cloud.websecurityscanner.v1", + "libraryPackage": "@google-cloud/web-security-scanner", + "services": { + "WebSecurityScanner": { + "clients": { + "grpc": { + "libraryClient": "WebSecurityScannerClient", + "rpcs": { + "CreateScanConfig": { + "methods": [ + "createScanConfig" + ] + }, + "DeleteScanConfig": { + "methods": [ + "deleteScanConfig" + ] + }, + "GetScanConfig": { + "methods": [ + "getScanConfig" + ] + }, + "UpdateScanConfig": { + "methods": [ + "updateScanConfig" + ] + }, + "StartScanRun": { + "methods": [ + "startScanRun" + ] + }, + "GetScanRun": { + "methods": [ + "getScanRun" + ] + }, + "StopScanRun": { + "methods": [ + "stopScanRun" + ] + }, + "GetFinding": { + "methods": [ + "getFinding" + ] + }, + "ListFindingTypeStats": { + "methods": [ + "listFindingTypeStats" + ] + }, + "ListScanConfigs": { + "methods": [ + "listScanConfigs", + "listScanConfigsStream", + "listScanConfigsAsync" + ] + }, + "ListScanRuns": { + "methods": [ + "listScanRuns", + "listScanRunsStream", + "listScanRunsAsync" + ] + }, + "ListCrawledUrls": { + "methods": [ + "listCrawledUrls", + "listCrawledUrlsStream", + "listCrawledUrlsAsync" + ] + }, + "ListFindings": { + "methods": [ + "listFindings", + "listFindingsStream", + "listFindingsAsync" + ] + } + } + }, + "grpc-fallback": { + "libraryClient": "WebSecurityScannerClient", + "rpcs": { + "CreateScanConfig": { + "methods": [ + "createScanConfig" + ] + }, + "DeleteScanConfig": { + "methods": [ + "deleteScanConfig" + ] + }, + "GetScanConfig": { + "methods": [ + "getScanConfig" + ] + }, + "UpdateScanConfig": { + "methods": [ + "updateScanConfig" + ] + }, + "StartScanRun": { + "methods": [ + "startScanRun" + ] + }, + "GetScanRun": { + "methods": [ + "getScanRun" + ] + }, + "StopScanRun": { + "methods": [ + "stopScanRun" + ] + }, + "GetFinding": { + "methods": [ + "getFinding" + ] + }, + "ListFindingTypeStats": { + "methods": [ + "listFindingTypeStats" + ] + }, + "ListScanConfigs": { + "methods": [ + "listScanConfigs", + "listScanConfigsStream", + "listScanConfigsAsync" + ] + }, + "ListScanRuns": { + "methods": [ + "listScanRuns", + "listScanRunsStream", + "listScanRunsAsync" + ] + }, + "ListCrawledUrls": { + "methods": [ + "listCrawledUrls", + "listCrawledUrlsStream", + "listCrawledUrlsAsync" + ] + }, + "ListFindings": { + "methods": [ + "listFindings", + "listFindingsStream", + "listFindingsAsync" + ] + } + } + } + } + } + } +} diff --git a/packages/google-cloud-websecurityscanner/src/v1/index.ts b/packages/google-cloud-websecurityscanner/src/v1/index.ts new file mode 100644 index 00000000000..515d3366d8a --- /dev/null +++ b/packages/google-cloud-websecurityscanner/src/v1/index.ts @@ -0,0 +1,19 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** 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 {WebSecurityScannerClient} from './web_security_scanner_client'; diff --git a/packages/google-cloud-websecurityscanner/src/v1/web_security_scanner_client.ts b/packages/google-cloud-websecurityscanner/src/v1/web_security_scanner_client.ts new file mode 100644 index 00000000000..1f6058f9051 --- /dev/null +++ b/packages/google-cloud-websecurityscanner/src/v1/web_security_scanner_client.ts @@ -0,0 +1,2159 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + +/* global window */ +import type * as gax from 'google-gax'; +import type { + Callback, + CallOptions, + Descriptors, + ClientOptions, + PaginationCallback, + GaxCall, +} from 'google-gax'; +import {Transform} from 'stream'; +import * as protos from '../../protos/protos'; +import jsonProtos = require('../../protos/protos.json'); +/** + * Client JSON configuration object, loaded from + * `src/v1/web_security_scanner_client_config.json`. + * This file defines retry strategy and timeouts for all API methods in this library. + */ +import * as gapicConfig from './web_security_scanner_client_config.json'; +const version = require('../../../package.json').version; + +/** + * Web Security Scanner Service identifies security vulnerabilities in web + * applications hosted on Google Cloud. It crawls your application, and + * attempts to exercise as many user inputs and event handlers as possible. + * @class + * @memberof v1 + */ +export class WebSecurityScannerClient { + private _terminated = false; + private _opts: ClientOptions; + private _providedCustomServicePath: boolean; + private _gaxModule: typeof gax | typeof gax.fallback; + private _gaxGrpc: gax.GrpcClient | gax.fallback.GrpcClient; + private _protos: {}; + private _defaults: {[method: string]: gax.CallSettings}; + auth: gax.GoogleAuth; + descriptors: Descriptors = { + page: {}, + stream: {}, + longrunning: {}, + batching: {}, + }; + warn: (code: string, message: string, warnType?: string) => void; + innerApiCalls: {[name: string]: Function}; + pathTemplates: {[name: string]: gax.PathTemplate}; + webSecurityScannerStub?: Promise<{[name: string]: Function}>; + + /** + * Construct an instance of WebSecurityScannerClient. + * + * @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 | "rest"} [options.fallback] - Use HTTP fallback mode. + * Pass "rest" to use HTTP/1.1 REST API instead of gRPC. + * 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 WebSecurityScannerClient({fallback: 'rest'}, gax); + * ``` + */ + constructor( + opts?: ClientOptions, + gaxInstance?: typeof gax | typeof gax.fallback + ) { + // Ensure that options include all the required fields. + const staticMembers = this.constructor as typeof WebSecurityScannerClient; + const servicePath = + opts?.servicePath || opts?.apiEndpoint || staticMembers.servicePath; + this._providedCustomServicePath = !!( + opts?.servicePath || opts?.apiEndpoint + ); + const port = opts?.port || staticMembers.port; + const clientConfig = opts?.clientConfig ?? {}; + const fallback = + opts?.fallback ?? + (typeof window !== 'undefined' && typeof window?.fetch === 'function'); + opts = Object.assign({servicePath, port, clientConfig, fallback}, opts); + + // If scopes are unset in options and we're connecting to a non-default endpoint, set scopes just in case. + if (servicePath !== staticMembers.servicePath && !('scopes' in opts)) { + opts['scopes'] = staticMembers.scopes; + } + + // Load google-gax module synchronously if needed + if (!gaxInstance) { + gaxInstance = require('google-gax') as typeof gax; + } + + // Choose either gRPC or proto-over-HTTP implementation of google-gax. + this._gaxModule = opts.fallback ? gaxInstance.fallback : gaxInstance; + + // Create a `gaxGrpc` object, with any grpc-specific options sent to the client. + this._gaxGrpc = new this._gaxModule.GrpcClient(opts); + + // Save options to use in initialize() method. + this._opts = opts; + + // Save the auth object to the client, for use by other methods. + this.auth = this._gaxGrpc.auth as gax.GoogleAuth; + + // Set useJWTAccessWithScope on the auth object. + this.auth.useJWTAccessWithScope = true; + + // Set defaultServicePath on the auth object. + this.auth.defaultServicePath = staticMembers.servicePath; + + // Set the default scopes in auth client if needed. + if (servicePath === staticMembers.servicePath) { + this.auth.defaultScopes = staticMembers.scopes; + } + + // Determine the client header string. + const clientHeader = [`gax/${this._gaxModule.version}`, `gapic/${version}`]; + if (typeof process !== 'undefined' && 'versions' in process) { + clientHeader.push(`gl-node/${process.versions.node}`); + } else { + clientHeader.push(`gl-web/${this._gaxModule.version}`); + } + if (!opts.fallback) { + clientHeader.push(`grpc/${this._gaxGrpc.grpcVersion}`); + } else if (opts.fallback === 'rest') { + 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 = { + findingPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/scanConfigs/{scan_config}/scanRuns/{scan_run}/findings/{finding}' + ), + }; + + // 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 = { + listScanConfigs: new this._gaxModule.PageDescriptor( + 'pageToken', + 'nextPageToken', + 'scanConfigs' + ), + listScanRuns: new this._gaxModule.PageDescriptor( + 'pageToken', + 'nextPageToken', + 'scanRuns' + ), + listCrawledUrls: new this._gaxModule.PageDescriptor( + 'pageToken', + 'nextPageToken', + 'crawledUrls' + ), + listFindings: new this._gaxModule.PageDescriptor( + 'pageToken', + 'nextPageToken', + 'findings' + ), + }; + + // Put together the default options sent with requests. + this._defaults = this._gaxGrpc.constructSettings( + 'google.cloud.websecurityscanner.v1.WebSecurityScanner', + 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.webSecurityScannerStub) { + return this.webSecurityScannerStub; + } + + // Put together the "service stub" for + // google.cloud.websecurityscanner.v1.WebSecurityScanner. + this.webSecurityScannerStub = this._gaxGrpc.createStub( + this._opts.fallback + ? (this._protos as protobuf.Root).lookupService( + 'google.cloud.websecurityscanner.v1.WebSecurityScanner' + ) + : // eslint-disable-next-line @typescript-eslint/no-explicit-any + (this._protos as any).google.cloud.websecurityscanner.v1 + .WebSecurityScanner, + 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 webSecurityScannerStubMethods = [ + 'createScanConfig', + 'deleteScanConfig', + 'getScanConfig', + 'listScanConfigs', + 'updateScanConfig', + 'startScanRun', + 'getScanRun', + 'listScanRuns', + 'stopScanRun', + 'listCrawledUrls', + 'getFinding', + 'listFindings', + 'listFindingTypeStats', + ]; + for (const methodName of webSecurityScannerStubMethods) { + const callPromise = this.webSecurityScannerStub.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.webSecurityScannerStub; + } + + /** + * The DNS address for this API service. + * @returns {string} The DNS address for this service. + */ + static get servicePath() { + return 'websecurityscanner.googleapis.com'; + } + + /** + * The DNS address for this API service - same as servicePath(), + * exists for compatibility reasons. + * @returns {string} The DNS address for this service. + */ + static get apiEndpoint() { + return 'websecurityscanner.googleapis.com'; + } + + /** + * The port for this API service. + * @returns {number} The default port for this service. + */ + static get port() { + return 443; + } + + /** + * The scopes needed to make gRPC calls for every method defined + * in this service. + * @returns {string[]} List of default scopes. + */ + static get scopes() { + return ['https://www.googleapis.com/auth/cloud-platform']; + } + + getProjectId(): Promise; + getProjectId(callback: Callback): void; + /** + * Return the project ID used by this class. + * @returns {Promise} A promise that resolves to string containing the project ID. + */ + getProjectId( + callback?: Callback + ): Promise | void { + if (callback) { + this.auth.getProjectId(callback); + return; + } + return this.auth.getProjectId(); + } + + // ------------------- + // -- Service calls -- + // ------------------- + /** + * Creates a new ScanConfig. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The parent resource name where the scan is created, which should be a + * project resource name in the format 'projects/{projectId}'. + * @param {google.cloud.websecurityscanner.v1.ScanConfig} request.scanConfig + * Required. The ScanConfig 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 [ScanConfig]{@link google.cloud.websecurityscanner.v1.ScanConfig}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example include:samples/generated/v1/web_security_scanner.create_scan_config.js + * region_tag:websecurityscanner_v1_generated_WebSecurityScanner_CreateScanConfig_async + */ + createScanConfig( + request?: protos.google.cloud.websecurityscanner.v1.ICreateScanConfigRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.websecurityscanner.v1.IScanConfig, + ( + | protos.google.cloud.websecurityscanner.v1.ICreateScanConfigRequest + | undefined + ), + {} | undefined + ] + >; + createScanConfig( + request: protos.google.cloud.websecurityscanner.v1.ICreateScanConfigRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.websecurityscanner.v1.IScanConfig, + | protos.google.cloud.websecurityscanner.v1.ICreateScanConfigRequest + | null + | undefined, + {} | null | undefined + > + ): void; + createScanConfig( + request: protos.google.cloud.websecurityscanner.v1.ICreateScanConfigRequest, + callback: Callback< + protos.google.cloud.websecurityscanner.v1.IScanConfig, + | protos.google.cloud.websecurityscanner.v1.ICreateScanConfigRequest + | null + | undefined, + {} | null | undefined + > + ): void; + createScanConfig( + request?: protos.google.cloud.websecurityscanner.v1.ICreateScanConfigRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.websecurityscanner.v1.IScanConfig, + | protos.google.cloud.websecurityscanner.v1.ICreateScanConfigRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.websecurityscanner.v1.IScanConfig, + | protos.google.cloud.websecurityscanner.v1.ICreateScanConfigRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.websecurityscanner.v1.IScanConfig, + ( + | protos.google.cloud.websecurityscanner.v1.ICreateScanConfigRequest + | undefined + ), + {} | undefined + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as 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.createScanConfig(request, options, callback); + } + /** + * Deletes an existing ScanConfig and its child resources. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The resource name of the ScanConfig to be deleted. The name follows the + * format of 'projects/{projectId}/scanConfigs/{scanConfigId}'. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [Empty]{@link google.protobuf.Empty}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example include:samples/generated/v1/web_security_scanner.delete_scan_config.js + * region_tag:websecurityscanner_v1_generated_WebSecurityScanner_DeleteScanConfig_async + */ + deleteScanConfig( + request?: protos.google.cloud.websecurityscanner.v1.IDeleteScanConfigRequest, + options?: CallOptions + ): Promise< + [ + protos.google.protobuf.IEmpty, + ( + | protos.google.cloud.websecurityscanner.v1.IDeleteScanConfigRequest + | undefined + ), + {} | undefined + ] + >; + deleteScanConfig( + request: protos.google.cloud.websecurityscanner.v1.IDeleteScanConfigRequest, + options: CallOptions, + callback: Callback< + protos.google.protobuf.IEmpty, + | protos.google.cloud.websecurityscanner.v1.IDeleteScanConfigRequest + | null + | undefined, + {} | null | undefined + > + ): void; + deleteScanConfig( + request: protos.google.cloud.websecurityscanner.v1.IDeleteScanConfigRequest, + callback: Callback< + protos.google.protobuf.IEmpty, + | protos.google.cloud.websecurityscanner.v1.IDeleteScanConfigRequest + | null + | undefined, + {} | null | undefined + > + ): void; + deleteScanConfig( + request?: protos.google.cloud.websecurityscanner.v1.IDeleteScanConfigRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.protobuf.IEmpty, + | protos.google.cloud.websecurityscanner.v1.IDeleteScanConfigRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.protobuf.IEmpty, + | protos.google.cloud.websecurityscanner.v1.IDeleteScanConfigRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.protobuf.IEmpty, + ( + | protos.google.cloud.websecurityscanner.v1.IDeleteScanConfigRequest + | undefined + ), + {} | undefined + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + 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.deleteScanConfig(request, options, callback); + } + /** + * Gets a ScanConfig. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The resource name of the ScanConfig to be returned. The name follows the + * format of 'projects/{projectId}/scanConfigs/{scanConfigId}'. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [ScanConfig]{@link google.cloud.websecurityscanner.v1.ScanConfig}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example include:samples/generated/v1/web_security_scanner.get_scan_config.js + * region_tag:websecurityscanner_v1_generated_WebSecurityScanner_GetScanConfig_async + */ + getScanConfig( + request?: protos.google.cloud.websecurityscanner.v1.IGetScanConfigRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.websecurityscanner.v1.IScanConfig, + ( + | protos.google.cloud.websecurityscanner.v1.IGetScanConfigRequest + | undefined + ), + {} | undefined + ] + >; + getScanConfig( + request: protos.google.cloud.websecurityscanner.v1.IGetScanConfigRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.websecurityscanner.v1.IScanConfig, + | protos.google.cloud.websecurityscanner.v1.IGetScanConfigRequest + | null + | undefined, + {} | null | undefined + > + ): void; + getScanConfig( + request: protos.google.cloud.websecurityscanner.v1.IGetScanConfigRequest, + callback: Callback< + protos.google.cloud.websecurityscanner.v1.IScanConfig, + | protos.google.cloud.websecurityscanner.v1.IGetScanConfigRequest + | null + | undefined, + {} | null | undefined + > + ): void; + getScanConfig( + request?: protos.google.cloud.websecurityscanner.v1.IGetScanConfigRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.websecurityscanner.v1.IScanConfig, + | protos.google.cloud.websecurityscanner.v1.IGetScanConfigRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.websecurityscanner.v1.IScanConfig, + | protos.google.cloud.websecurityscanner.v1.IGetScanConfigRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.websecurityscanner.v1.IScanConfig, + ( + | protos.google.cloud.websecurityscanner.v1.IGetScanConfigRequest + | undefined + ), + {} | undefined + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + 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.getScanConfig(request, options, callback); + } + /** + * Updates a ScanConfig. This method support partial update of a ScanConfig. + * + * @param {Object} request + * The request object that will be sent. + * @param {google.cloud.websecurityscanner.v1.ScanConfig} request.scanConfig + * Required. The ScanConfig to be updated. The name field must be set to identify the + * resource to be updated. The values of fields not covered by the mask + * will be ignored. + * @param {google.protobuf.FieldMask} request.updateMask + * Required. The update mask applies to the resource. For the `FieldMask` definition, + * see + * https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#fieldmask + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [ScanConfig]{@link google.cloud.websecurityscanner.v1.ScanConfig}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example include:samples/generated/v1/web_security_scanner.update_scan_config.js + * region_tag:websecurityscanner_v1_generated_WebSecurityScanner_UpdateScanConfig_async + */ + updateScanConfig( + request?: protos.google.cloud.websecurityscanner.v1.IUpdateScanConfigRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.websecurityscanner.v1.IScanConfig, + ( + | protos.google.cloud.websecurityscanner.v1.IUpdateScanConfigRequest + | undefined + ), + {} | undefined + ] + >; + updateScanConfig( + request: protos.google.cloud.websecurityscanner.v1.IUpdateScanConfigRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.websecurityscanner.v1.IScanConfig, + | protos.google.cloud.websecurityscanner.v1.IUpdateScanConfigRequest + | null + | undefined, + {} | null | undefined + > + ): void; + updateScanConfig( + request: protos.google.cloud.websecurityscanner.v1.IUpdateScanConfigRequest, + callback: Callback< + protos.google.cloud.websecurityscanner.v1.IScanConfig, + | protos.google.cloud.websecurityscanner.v1.IUpdateScanConfigRequest + | null + | undefined, + {} | null | undefined + > + ): void; + updateScanConfig( + request?: protos.google.cloud.websecurityscanner.v1.IUpdateScanConfigRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.websecurityscanner.v1.IScanConfig, + | protos.google.cloud.websecurityscanner.v1.IUpdateScanConfigRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.websecurityscanner.v1.IScanConfig, + | protos.google.cloud.websecurityscanner.v1.IUpdateScanConfigRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.websecurityscanner.v1.IScanConfig, + ( + | protos.google.cloud.websecurityscanner.v1.IUpdateScanConfigRequest + | undefined + ), + {} | undefined + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + 'scan_config.name': request.scanConfig!.name ?? '', + }); + this.initialize(); + return this.innerApiCalls.updateScanConfig(request, options, callback); + } + /** + * Start a ScanRun according to the given ScanConfig. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The resource name of the ScanConfig to be used. The name follows the + * format of 'projects/{projectId}/scanConfigs/{scanConfigId}'. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [ScanRun]{@link google.cloud.websecurityscanner.v1.ScanRun}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example include:samples/generated/v1/web_security_scanner.start_scan_run.js + * region_tag:websecurityscanner_v1_generated_WebSecurityScanner_StartScanRun_async + */ + startScanRun( + request?: protos.google.cloud.websecurityscanner.v1.IStartScanRunRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.websecurityscanner.v1.IScanRun, + ( + | protos.google.cloud.websecurityscanner.v1.IStartScanRunRequest + | undefined + ), + {} | undefined + ] + >; + startScanRun( + request: protos.google.cloud.websecurityscanner.v1.IStartScanRunRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.websecurityscanner.v1.IScanRun, + | protos.google.cloud.websecurityscanner.v1.IStartScanRunRequest + | null + | undefined, + {} | null | undefined + > + ): void; + startScanRun( + request: protos.google.cloud.websecurityscanner.v1.IStartScanRunRequest, + callback: Callback< + protos.google.cloud.websecurityscanner.v1.IScanRun, + | protos.google.cloud.websecurityscanner.v1.IStartScanRunRequest + | null + | undefined, + {} | null | undefined + > + ): void; + startScanRun( + request?: protos.google.cloud.websecurityscanner.v1.IStartScanRunRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.websecurityscanner.v1.IScanRun, + | protos.google.cloud.websecurityscanner.v1.IStartScanRunRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.websecurityscanner.v1.IScanRun, + | protos.google.cloud.websecurityscanner.v1.IStartScanRunRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.websecurityscanner.v1.IScanRun, + ( + | protos.google.cloud.websecurityscanner.v1.IStartScanRunRequest + | undefined + ), + {} | undefined + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + 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.startScanRun(request, options, callback); + } + /** + * Gets a ScanRun. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The resource name of the ScanRun to be returned. The name follows the + * format of + * 'projects/{projectId}/scanConfigs/{scanConfigId}/scanRuns/{scanRunId}'. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [ScanRun]{@link google.cloud.websecurityscanner.v1.ScanRun}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example include:samples/generated/v1/web_security_scanner.get_scan_run.js + * region_tag:websecurityscanner_v1_generated_WebSecurityScanner_GetScanRun_async + */ + getScanRun( + request?: protos.google.cloud.websecurityscanner.v1.IGetScanRunRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.websecurityscanner.v1.IScanRun, + protos.google.cloud.websecurityscanner.v1.IGetScanRunRequest | undefined, + {} | undefined + ] + >; + getScanRun( + request: protos.google.cloud.websecurityscanner.v1.IGetScanRunRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.websecurityscanner.v1.IScanRun, + | protos.google.cloud.websecurityscanner.v1.IGetScanRunRequest + | null + | undefined, + {} | null | undefined + > + ): void; + getScanRun( + request: protos.google.cloud.websecurityscanner.v1.IGetScanRunRequest, + callback: Callback< + protos.google.cloud.websecurityscanner.v1.IScanRun, + | protos.google.cloud.websecurityscanner.v1.IGetScanRunRequest + | null + | undefined, + {} | null | undefined + > + ): void; + getScanRun( + request?: protos.google.cloud.websecurityscanner.v1.IGetScanRunRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.websecurityscanner.v1.IScanRun, + | protos.google.cloud.websecurityscanner.v1.IGetScanRunRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.websecurityscanner.v1.IScanRun, + | protos.google.cloud.websecurityscanner.v1.IGetScanRunRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.websecurityscanner.v1.IScanRun, + protos.google.cloud.websecurityscanner.v1.IGetScanRunRequest | undefined, + {} | undefined + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + 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.getScanRun(request, options, callback); + } + /** + * Stops a ScanRun. The stopped ScanRun is returned. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The resource name of the ScanRun to be stopped. The name follows the + * format of + * 'projects/{projectId}/scanConfigs/{scanConfigId}/scanRuns/{scanRunId}'. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [ScanRun]{@link google.cloud.websecurityscanner.v1.ScanRun}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example include:samples/generated/v1/web_security_scanner.stop_scan_run.js + * region_tag:websecurityscanner_v1_generated_WebSecurityScanner_StopScanRun_async + */ + stopScanRun( + request?: protos.google.cloud.websecurityscanner.v1.IStopScanRunRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.websecurityscanner.v1.IScanRun, + protos.google.cloud.websecurityscanner.v1.IStopScanRunRequest | undefined, + {} | undefined + ] + >; + stopScanRun( + request: protos.google.cloud.websecurityscanner.v1.IStopScanRunRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.websecurityscanner.v1.IScanRun, + | protos.google.cloud.websecurityscanner.v1.IStopScanRunRequest + | null + | undefined, + {} | null | undefined + > + ): void; + stopScanRun( + request: protos.google.cloud.websecurityscanner.v1.IStopScanRunRequest, + callback: Callback< + protos.google.cloud.websecurityscanner.v1.IScanRun, + | protos.google.cloud.websecurityscanner.v1.IStopScanRunRequest + | null + | undefined, + {} | null | undefined + > + ): void; + stopScanRun( + request?: protos.google.cloud.websecurityscanner.v1.IStopScanRunRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.websecurityscanner.v1.IScanRun, + | protos.google.cloud.websecurityscanner.v1.IStopScanRunRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.websecurityscanner.v1.IScanRun, + | protos.google.cloud.websecurityscanner.v1.IStopScanRunRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.websecurityscanner.v1.IScanRun, + protos.google.cloud.websecurityscanner.v1.IStopScanRunRequest | undefined, + {} | undefined + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + 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.stopScanRun(request, options, callback); + } + /** + * Gets a Finding. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The resource name of the Finding to be returned. The name follows the + * format of + * 'projects/{projectId}/scanConfigs/{scanConfigId}/scanRuns/{scanRunId}/findings/{findingId}'. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [Finding]{@link google.cloud.websecurityscanner.v1.Finding}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example include:samples/generated/v1/web_security_scanner.get_finding.js + * region_tag:websecurityscanner_v1_generated_WebSecurityScanner_GetFinding_async + */ + getFinding( + request?: protos.google.cloud.websecurityscanner.v1.IGetFindingRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.websecurityscanner.v1.IFinding, + protos.google.cloud.websecurityscanner.v1.IGetFindingRequest | undefined, + {} | undefined + ] + >; + getFinding( + request: protos.google.cloud.websecurityscanner.v1.IGetFindingRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.websecurityscanner.v1.IFinding, + | protos.google.cloud.websecurityscanner.v1.IGetFindingRequest + | null + | undefined, + {} | null | undefined + > + ): void; + getFinding( + request: protos.google.cloud.websecurityscanner.v1.IGetFindingRequest, + callback: Callback< + protos.google.cloud.websecurityscanner.v1.IFinding, + | protos.google.cloud.websecurityscanner.v1.IGetFindingRequest + | null + | undefined, + {} | null | undefined + > + ): void; + getFinding( + request?: protos.google.cloud.websecurityscanner.v1.IGetFindingRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.websecurityscanner.v1.IFinding, + | protos.google.cloud.websecurityscanner.v1.IGetFindingRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.websecurityscanner.v1.IFinding, + | protos.google.cloud.websecurityscanner.v1.IGetFindingRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.websecurityscanner.v1.IFinding, + protos.google.cloud.websecurityscanner.v1.IGetFindingRequest | undefined, + {} | undefined + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + 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.getFinding(request, options, callback); + } + /** + * List all FindingTypeStats under a given ScanRun. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The parent resource name, which should be a scan run resource name in the + * format + * 'projects/{projectId}/scanConfigs/{scanConfigId}/scanRuns/{scanRunId}'. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [ListFindingTypeStatsResponse]{@link google.cloud.websecurityscanner.v1.ListFindingTypeStatsResponse}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example include:samples/generated/v1/web_security_scanner.list_finding_type_stats.js + * region_tag:websecurityscanner_v1_generated_WebSecurityScanner_ListFindingTypeStats_async + */ + listFindingTypeStats( + request?: protos.google.cloud.websecurityscanner.v1.IListFindingTypeStatsRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.websecurityscanner.v1.IListFindingTypeStatsResponse, + ( + | protos.google.cloud.websecurityscanner.v1.IListFindingTypeStatsRequest + | undefined + ), + {} | undefined + ] + >; + listFindingTypeStats( + request: protos.google.cloud.websecurityscanner.v1.IListFindingTypeStatsRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.websecurityscanner.v1.IListFindingTypeStatsResponse, + | protos.google.cloud.websecurityscanner.v1.IListFindingTypeStatsRequest + | null + | undefined, + {} | null | undefined + > + ): void; + listFindingTypeStats( + request: protos.google.cloud.websecurityscanner.v1.IListFindingTypeStatsRequest, + callback: Callback< + protos.google.cloud.websecurityscanner.v1.IListFindingTypeStatsResponse, + | protos.google.cloud.websecurityscanner.v1.IListFindingTypeStatsRequest + | null + | undefined, + {} | null | undefined + > + ): void; + listFindingTypeStats( + request?: protos.google.cloud.websecurityscanner.v1.IListFindingTypeStatsRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.websecurityscanner.v1.IListFindingTypeStatsResponse, + | protos.google.cloud.websecurityscanner.v1.IListFindingTypeStatsRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.websecurityscanner.v1.IListFindingTypeStatsResponse, + | protos.google.cloud.websecurityscanner.v1.IListFindingTypeStatsRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.websecurityscanner.v1.IListFindingTypeStatsResponse, + ( + | protos.google.cloud.websecurityscanner.v1.IListFindingTypeStatsRequest + | undefined + ), + {} | undefined + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as 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.listFindingTypeStats(request, options, callback); + } + + /** + * Lists ScanConfigs under a given project. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The parent resource name, which should be a project resource name in the + * format 'projects/{projectId}'. + * @param {string} request.pageToken + * A token identifying a page of results to be returned. This should be a + * `next_page_token` value returned from a previous List request. + * If unspecified, the first page of results is returned. + * @param {number} request.pageSize + * The maximum number of ScanConfigs to return, can be limited by server. + * If not specified or not positive, the implementation will select a + * reasonable value. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is Array of [ScanConfig]{@link google.cloud.websecurityscanner.v1.ScanConfig}. + * 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 `listScanConfigsAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) + * for more details and examples. + */ + listScanConfigs( + request?: protos.google.cloud.websecurityscanner.v1.IListScanConfigsRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.websecurityscanner.v1.IScanConfig[], + protos.google.cloud.websecurityscanner.v1.IListScanConfigsRequest | null, + protos.google.cloud.websecurityscanner.v1.IListScanConfigsResponse + ] + >; + listScanConfigs( + request: protos.google.cloud.websecurityscanner.v1.IListScanConfigsRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.cloud.websecurityscanner.v1.IListScanConfigsRequest, + | protos.google.cloud.websecurityscanner.v1.IListScanConfigsResponse + | null + | undefined, + protos.google.cloud.websecurityscanner.v1.IScanConfig + > + ): void; + listScanConfigs( + request: protos.google.cloud.websecurityscanner.v1.IListScanConfigsRequest, + callback: PaginationCallback< + protos.google.cloud.websecurityscanner.v1.IListScanConfigsRequest, + | protos.google.cloud.websecurityscanner.v1.IListScanConfigsResponse + | null + | undefined, + protos.google.cloud.websecurityscanner.v1.IScanConfig + > + ): void; + listScanConfigs( + request?: protos.google.cloud.websecurityscanner.v1.IListScanConfigsRequest, + optionsOrCallback?: + | CallOptions + | PaginationCallback< + protos.google.cloud.websecurityscanner.v1.IListScanConfigsRequest, + | protos.google.cloud.websecurityscanner.v1.IListScanConfigsResponse + | null + | undefined, + protos.google.cloud.websecurityscanner.v1.IScanConfig + >, + callback?: PaginationCallback< + protos.google.cloud.websecurityscanner.v1.IListScanConfigsRequest, + | protos.google.cloud.websecurityscanner.v1.IListScanConfigsResponse + | null + | undefined, + protos.google.cloud.websecurityscanner.v1.IScanConfig + > + ): Promise< + [ + protos.google.cloud.websecurityscanner.v1.IScanConfig[], + protos.google.cloud.websecurityscanner.v1.IListScanConfigsRequest | null, + protos.google.cloud.websecurityscanner.v1.IListScanConfigsResponse + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as 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.listScanConfigs(request, options, callback); + } + + /** + * Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The parent resource name, which should be a project resource name in the + * format 'projects/{projectId}'. + * @param {string} request.pageToken + * A token identifying a page of results to be returned. This should be a + * `next_page_token` value returned from a previous List request. + * If unspecified, the first page of results is returned. + * @param {number} request.pageSize + * The maximum number of ScanConfigs to return, can be limited by server. + * If not specified or not positive, the implementation will select a + * reasonable value. + * @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 [ScanConfig]{@link google.cloud.websecurityscanner.v1.ScanConfig} 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 `listScanConfigsAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) + * for more details and examples. + */ + listScanConfigsStream( + request?: protos.google.cloud.websecurityscanner.v1.IListScanConfigsRequest, + 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['listScanConfigs']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.listScanConfigs.createStream( + this.innerApiCalls.listScanConfigs as GaxCall, + request, + callSettings + ); + } + + /** + * Equivalent to `listScanConfigs`, 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 name, which should be a project resource name in the + * format 'projects/{projectId}'. + * @param {string} request.pageToken + * A token identifying a page of results to be returned. This should be a + * `next_page_token` value returned from a previous List request. + * If unspecified, the first page of results is returned. + * @param {number} request.pageSize + * The maximum number of ScanConfigs to return, can be limited by server. + * If not specified or not positive, the implementation will select a + * reasonable value. + * @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 [async iteration](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols). + * When you iterate the returned iterable, each element will be an object representing + * [ScanConfig]{@link google.cloud.websecurityscanner.v1.ScanConfig}. 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 + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) + * for more details and examples. + * @example include:samples/generated/v1/web_security_scanner.list_scan_configs.js + * region_tag:websecurityscanner_v1_generated_WebSecurityScanner_ListScanConfigs_async + */ + listScanConfigsAsync( + request?: protos.google.cloud.websecurityscanner.v1.IListScanConfigsRequest, + 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['listScanConfigs']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.listScanConfigs.asyncIterate( + this.innerApiCalls['listScanConfigs'] as GaxCall, + request as {}, + callSettings + ) as AsyncIterable; + } + /** + * Lists ScanRuns under a given ScanConfig, in descending order of ScanRun + * stop time. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The parent resource name, which should be a scan resource name in the + * format 'projects/{projectId}/scanConfigs/{scanConfigId}'. + * @param {string} request.pageToken + * A token identifying a page of results to be returned. This should be a + * `next_page_token` value returned from a previous List request. + * If unspecified, the first page of results is returned. + * @param {number} request.pageSize + * The maximum number of ScanRuns to return, can be limited by server. + * If not specified or not positive, the implementation will select a + * reasonable value. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is Array of [ScanRun]{@link google.cloud.websecurityscanner.v1.ScanRun}. + * 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 `listScanRunsAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) + * for more details and examples. + */ + listScanRuns( + request?: protos.google.cloud.websecurityscanner.v1.IListScanRunsRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.websecurityscanner.v1.IScanRun[], + protos.google.cloud.websecurityscanner.v1.IListScanRunsRequest | null, + protos.google.cloud.websecurityscanner.v1.IListScanRunsResponse + ] + >; + listScanRuns( + request: protos.google.cloud.websecurityscanner.v1.IListScanRunsRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.cloud.websecurityscanner.v1.IListScanRunsRequest, + | protos.google.cloud.websecurityscanner.v1.IListScanRunsResponse + | null + | undefined, + protos.google.cloud.websecurityscanner.v1.IScanRun + > + ): void; + listScanRuns( + request: protos.google.cloud.websecurityscanner.v1.IListScanRunsRequest, + callback: PaginationCallback< + protos.google.cloud.websecurityscanner.v1.IListScanRunsRequest, + | protos.google.cloud.websecurityscanner.v1.IListScanRunsResponse + | null + | undefined, + protos.google.cloud.websecurityscanner.v1.IScanRun + > + ): void; + listScanRuns( + request?: protos.google.cloud.websecurityscanner.v1.IListScanRunsRequest, + optionsOrCallback?: + | CallOptions + | PaginationCallback< + protos.google.cloud.websecurityscanner.v1.IListScanRunsRequest, + | protos.google.cloud.websecurityscanner.v1.IListScanRunsResponse + | null + | undefined, + protos.google.cloud.websecurityscanner.v1.IScanRun + >, + callback?: PaginationCallback< + protos.google.cloud.websecurityscanner.v1.IListScanRunsRequest, + | protos.google.cloud.websecurityscanner.v1.IListScanRunsResponse + | null + | undefined, + protos.google.cloud.websecurityscanner.v1.IScanRun + > + ): Promise< + [ + protos.google.cloud.websecurityscanner.v1.IScanRun[], + protos.google.cloud.websecurityscanner.v1.IListScanRunsRequest | null, + protos.google.cloud.websecurityscanner.v1.IListScanRunsResponse + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as 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.listScanRuns(request, options, callback); + } + + /** + * Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The parent resource name, which should be a scan resource name in the + * format 'projects/{projectId}/scanConfigs/{scanConfigId}'. + * @param {string} request.pageToken + * A token identifying a page of results to be returned. This should be a + * `next_page_token` value returned from a previous List request. + * If unspecified, the first page of results is returned. + * @param {number} request.pageSize + * The maximum number of ScanRuns to return, can be limited by server. + * If not specified or not positive, the implementation will select a + * reasonable value. + * @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 [ScanRun]{@link google.cloud.websecurityscanner.v1.ScanRun} 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 `listScanRunsAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) + * for more details and examples. + */ + listScanRunsStream( + request?: protos.google.cloud.websecurityscanner.v1.IListScanRunsRequest, + 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['listScanRuns']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.listScanRuns.createStream( + this.innerApiCalls.listScanRuns as GaxCall, + request, + callSettings + ); + } + + /** + * Equivalent to `listScanRuns`, 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 name, which should be a scan resource name in the + * format 'projects/{projectId}/scanConfigs/{scanConfigId}'. + * @param {string} request.pageToken + * A token identifying a page of results to be returned. This should be a + * `next_page_token` value returned from a previous List request. + * If unspecified, the first page of results is returned. + * @param {number} request.pageSize + * The maximum number of ScanRuns to return, can be limited by server. + * If not specified or not positive, the implementation will select a + * reasonable value. + * @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 [async iteration](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols). + * When you iterate the returned iterable, each element will be an object representing + * [ScanRun]{@link google.cloud.websecurityscanner.v1.ScanRun}. 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 + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) + * for more details and examples. + * @example include:samples/generated/v1/web_security_scanner.list_scan_runs.js + * region_tag:websecurityscanner_v1_generated_WebSecurityScanner_ListScanRuns_async + */ + listScanRunsAsync( + request?: protos.google.cloud.websecurityscanner.v1.IListScanRunsRequest, + 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['listScanRuns']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.listScanRuns.asyncIterate( + this.innerApiCalls['listScanRuns'] as GaxCall, + request as {}, + callSettings + ) as AsyncIterable; + } + /** + * List CrawledUrls under a given ScanRun. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The parent resource name, which should be a scan run resource name in the + * format + * 'projects/{projectId}/scanConfigs/{scanConfigId}/scanRuns/{scanRunId}'. + * @param {string} request.pageToken + * A token identifying a page of results to be returned. This should be a + * `next_page_token` value returned from a previous List request. + * If unspecified, the first page of results is returned. + * @param {number} request.pageSize + * The maximum number of CrawledUrls to return, can be limited by server. + * If not specified or not positive, the implementation will select a + * reasonable value. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is Array of [CrawledUrl]{@link google.cloud.websecurityscanner.v1.CrawledUrl}. + * 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 `listCrawledUrlsAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) + * for more details and examples. + */ + listCrawledUrls( + request?: protos.google.cloud.websecurityscanner.v1.IListCrawledUrlsRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.websecurityscanner.v1.ICrawledUrl[], + protos.google.cloud.websecurityscanner.v1.IListCrawledUrlsRequest | null, + protos.google.cloud.websecurityscanner.v1.IListCrawledUrlsResponse + ] + >; + listCrawledUrls( + request: protos.google.cloud.websecurityscanner.v1.IListCrawledUrlsRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.cloud.websecurityscanner.v1.IListCrawledUrlsRequest, + | protos.google.cloud.websecurityscanner.v1.IListCrawledUrlsResponse + | null + | undefined, + protos.google.cloud.websecurityscanner.v1.ICrawledUrl + > + ): void; + listCrawledUrls( + request: protos.google.cloud.websecurityscanner.v1.IListCrawledUrlsRequest, + callback: PaginationCallback< + protos.google.cloud.websecurityscanner.v1.IListCrawledUrlsRequest, + | protos.google.cloud.websecurityscanner.v1.IListCrawledUrlsResponse + | null + | undefined, + protos.google.cloud.websecurityscanner.v1.ICrawledUrl + > + ): void; + listCrawledUrls( + request?: protos.google.cloud.websecurityscanner.v1.IListCrawledUrlsRequest, + optionsOrCallback?: + | CallOptions + | PaginationCallback< + protos.google.cloud.websecurityscanner.v1.IListCrawledUrlsRequest, + | protos.google.cloud.websecurityscanner.v1.IListCrawledUrlsResponse + | null + | undefined, + protos.google.cloud.websecurityscanner.v1.ICrawledUrl + >, + callback?: PaginationCallback< + protos.google.cloud.websecurityscanner.v1.IListCrawledUrlsRequest, + | protos.google.cloud.websecurityscanner.v1.IListCrawledUrlsResponse + | null + | undefined, + protos.google.cloud.websecurityscanner.v1.ICrawledUrl + > + ): Promise< + [ + protos.google.cloud.websecurityscanner.v1.ICrawledUrl[], + protos.google.cloud.websecurityscanner.v1.IListCrawledUrlsRequest | null, + protos.google.cloud.websecurityscanner.v1.IListCrawledUrlsResponse + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as 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.listCrawledUrls(request, options, callback); + } + + /** + * Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The parent resource name, which should be a scan run resource name in the + * format + * 'projects/{projectId}/scanConfigs/{scanConfigId}/scanRuns/{scanRunId}'. + * @param {string} request.pageToken + * A token identifying a page of results to be returned. This should be a + * `next_page_token` value returned from a previous List request. + * If unspecified, the first page of results is returned. + * @param {number} request.pageSize + * The maximum number of CrawledUrls to return, can be limited by server. + * If not specified or not positive, the implementation will select a + * reasonable value. + * @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 [CrawledUrl]{@link google.cloud.websecurityscanner.v1.CrawledUrl} 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 `listCrawledUrlsAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) + * for more details and examples. + */ + listCrawledUrlsStream( + request?: protos.google.cloud.websecurityscanner.v1.IListCrawledUrlsRequest, + 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['listCrawledUrls']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.listCrawledUrls.createStream( + this.innerApiCalls.listCrawledUrls as GaxCall, + request, + callSettings + ); + } + + /** + * Equivalent to `listCrawledUrls`, 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 name, which should be a scan run resource name in the + * format + * 'projects/{projectId}/scanConfigs/{scanConfigId}/scanRuns/{scanRunId}'. + * @param {string} request.pageToken + * A token identifying a page of results to be returned. This should be a + * `next_page_token` value returned from a previous List request. + * If unspecified, the first page of results is returned. + * @param {number} request.pageSize + * The maximum number of CrawledUrls to return, can be limited by server. + * If not specified or not positive, the implementation will select a + * reasonable value. + * @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 [async iteration](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols). + * When you iterate the returned iterable, each element will be an object representing + * [CrawledUrl]{@link google.cloud.websecurityscanner.v1.CrawledUrl}. 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 + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) + * for more details and examples. + * @example include:samples/generated/v1/web_security_scanner.list_crawled_urls.js + * region_tag:websecurityscanner_v1_generated_WebSecurityScanner_ListCrawledUrls_async + */ + listCrawledUrlsAsync( + request?: protos.google.cloud.websecurityscanner.v1.IListCrawledUrlsRequest, + 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['listCrawledUrls']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.listCrawledUrls.asyncIterate( + this.innerApiCalls['listCrawledUrls'] as GaxCall, + request as {}, + callSettings + ) as AsyncIterable; + } + /** + * List Findings under a given ScanRun. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The parent resource name, which should be a scan run resource name in the + * format + * 'projects/{projectId}/scanConfigs/{scanConfigId}/scanRuns/{scanRunId}'. + * @param {string} request.filter + * The filter expression. The expression must be in the format: + * . + * Supported field: 'finding_type'. + * Supported operator: '='. + * @param {string} request.pageToken + * A token identifying a page of results to be returned. This should be a + * `next_page_token` value returned from a previous List request. + * If unspecified, the first page of results is returned. + * @param {number} request.pageSize + * The maximum number of Findings to return, can be limited by server. + * If not specified or not positive, the implementation will select a + * reasonable value. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is Array of [Finding]{@link google.cloud.websecurityscanner.v1.Finding}. + * 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 `listFindingsAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) + * for more details and examples. + */ + listFindings( + request?: protos.google.cloud.websecurityscanner.v1.IListFindingsRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.websecurityscanner.v1.IFinding[], + protos.google.cloud.websecurityscanner.v1.IListFindingsRequest | null, + protos.google.cloud.websecurityscanner.v1.IListFindingsResponse + ] + >; + listFindings( + request: protos.google.cloud.websecurityscanner.v1.IListFindingsRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.cloud.websecurityscanner.v1.IListFindingsRequest, + | protos.google.cloud.websecurityscanner.v1.IListFindingsResponse + | null + | undefined, + protos.google.cloud.websecurityscanner.v1.IFinding + > + ): void; + listFindings( + request: protos.google.cloud.websecurityscanner.v1.IListFindingsRequest, + callback: PaginationCallback< + protos.google.cloud.websecurityscanner.v1.IListFindingsRequest, + | protos.google.cloud.websecurityscanner.v1.IListFindingsResponse + | null + | undefined, + protos.google.cloud.websecurityscanner.v1.IFinding + > + ): void; + listFindings( + request?: protos.google.cloud.websecurityscanner.v1.IListFindingsRequest, + optionsOrCallback?: + | CallOptions + | PaginationCallback< + protos.google.cloud.websecurityscanner.v1.IListFindingsRequest, + | protos.google.cloud.websecurityscanner.v1.IListFindingsResponse + | null + | undefined, + protos.google.cloud.websecurityscanner.v1.IFinding + >, + callback?: PaginationCallback< + protos.google.cloud.websecurityscanner.v1.IListFindingsRequest, + | protos.google.cloud.websecurityscanner.v1.IListFindingsResponse + | null + | undefined, + protos.google.cloud.websecurityscanner.v1.IFinding + > + ): Promise< + [ + protos.google.cloud.websecurityscanner.v1.IFinding[], + protos.google.cloud.websecurityscanner.v1.IListFindingsRequest | null, + protos.google.cloud.websecurityscanner.v1.IListFindingsResponse + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as 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.listFindings(request, options, callback); + } + + /** + * Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The parent resource name, which should be a scan run resource name in the + * format + * 'projects/{projectId}/scanConfigs/{scanConfigId}/scanRuns/{scanRunId}'. + * @param {string} request.filter + * The filter expression. The expression must be in the format: + * . + * Supported field: 'finding_type'. + * Supported operator: '='. + * @param {string} request.pageToken + * A token identifying a page of results to be returned. This should be a + * `next_page_token` value returned from a previous List request. + * If unspecified, the first page of results is returned. + * @param {number} request.pageSize + * The maximum number of Findings to return, can be limited by server. + * If not specified or not positive, the implementation will select a + * reasonable value. + * @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 [Finding]{@link google.cloud.websecurityscanner.v1.Finding} 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 `listFindingsAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) + * for more details and examples. + */ + listFindingsStream( + request?: protos.google.cloud.websecurityscanner.v1.IListFindingsRequest, + 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['listFindings']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.listFindings.createStream( + this.innerApiCalls.listFindings as GaxCall, + request, + callSettings + ); + } + + /** + * Equivalent to `listFindings`, 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 name, which should be a scan run resource name in the + * format + * 'projects/{projectId}/scanConfigs/{scanConfigId}/scanRuns/{scanRunId}'. + * @param {string} request.filter + * The filter expression. The expression must be in the format: + * . + * Supported field: 'finding_type'. + * Supported operator: '='. + * @param {string} request.pageToken + * A token identifying a page of results to be returned. This should be a + * `next_page_token` value returned from a previous List request. + * If unspecified, the first page of results is returned. + * @param {number} request.pageSize + * The maximum number of Findings to return, can be limited by server. + * If not specified or not positive, the implementation will select a + * reasonable value. + * @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 [async iteration](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols). + * When you iterate the returned iterable, each element will be an object representing + * [Finding]{@link google.cloud.websecurityscanner.v1.Finding}. 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 + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) + * for more details and examples. + * @example include:samples/generated/v1/web_security_scanner.list_findings.js + * region_tag:websecurityscanner_v1_generated_WebSecurityScanner_ListFindings_async + */ + listFindingsAsync( + request?: protos.google.cloud.websecurityscanner.v1.IListFindingsRequest, + 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['listFindings']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.listFindings.asyncIterate( + this.innerApiCalls['listFindings'] as GaxCall, + request as {}, + callSettings + ) as AsyncIterable; + } + // -------------------- + // -- Path templates -- + // -------------------- + + /** + * Return a fully-qualified finding resource name string. + * + * @param {string} project + * @param {string} scan_config + * @param {string} scan_run + * @param {string} finding + * @returns {string} Resource name string. + */ + findingPath( + project: string, + scanConfig: string, + scanRun: string, + finding: string + ) { + return this.pathTemplates.findingPathTemplate.render({ + project: project, + scan_config: scanConfig, + scan_run: scanRun, + finding: finding, + }); + } + + /** + * Parse the project from Finding resource. + * + * @param {string} findingName + * A fully-qualified path representing Finding resource. + * @returns {string} A string representing the project. + */ + matchProjectFromFindingName(findingName: string) { + return this.pathTemplates.findingPathTemplate.match(findingName).project; + } + + /** + * Parse the scan_config from Finding resource. + * + * @param {string} findingName + * A fully-qualified path representing Finding resource. + * @returns {string} A string representing the scan_config. + */ + matchScanConfigFromFindingName(findingName: string) { + return this.pathTemplates.findingPathTemplate.match(findingName) + .scan_config; + } + + /** + * Parse the scan_run from Finding resource. + * + * @param {string} findingName + * A fully-qualified path representing Finding resource. + * @returns {string} A string representing the scan_run. + */ + matchScanRunFromFindingName(findingName: string) { + return this.pathTemplates.findingPathTemplate.match(findingName).scan_run; + } + + /** + * Parse the finding from Finding resource. + * + * @param {string} findingName + * A fully-qualified path representing Finding resource. + * @returns {string} A string representing the finding. + */ + matchFindingFromFindingName(findingName: string) { + return this.pathTemplates.findingPathTemplate.match(findingName).finding; + } + + /** + * 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.webSecurityScannerStub && !this._terminated) { + return this.webSecurityScannerStub.then(stub => { + this._terminated = true; + stub.close(); + }); + } + return Promise.resolve(); + } +} diff --git a/packages/google-cloud-websecurityscanner/src/v1/web_security_scanner_client_config.json b/packages/google-cloud-websecurityscanner/src/v1/web_security_scanner_client_config.json new file mode 100644 index 00000000000..2e226cb1ff0 --- /dev/null +++ b/packages/google-cloud-websecurityscanner/src/v1/web_security_scanner_client_config.json @@ -0,0 +1,91 @@ +{ + "interfaces": { + "google.cloud.websecurityscanner.v1.WebSecurityScanner": { + "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": { + "CreateScanConfig": { + "timeout_millis": 600000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "DeleteScanConfig": { + "timeout_millis": 600000, + "retry_codes_name": "idempotent", + "retry_params_name": "default" + }, + "GetScanConfig": { + "timeout_millis": 600000, + "retry_codes_name": "idempotent", + "retry_params_name": "default" + }, + "ListScanConfigs": { + "timeout_millis": 600000, + "retry_codes_name": "idempotent", + "retry_params_name": "default" + }, + "UpdateScanConfig": { + "timeout_millis": 600000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "StartScanRun": { + "timeout_millis": 600000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "GetScanRun": { + "timeout_millis": 600000, + "retry_codes_name": "idempotent", + "retry_params_name": "default" + }, + "ListScanRuns": { + "timeout_millis": 600000, + "retry_codes_name": "idempotent", + "retry_params_name": "default" + }, + "StopScanRun": { + "timeout_millis": 600000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "ListCrawledUrls": { + "timeout_millis": 600000, + "retry_codes_name": "idempotent", + "retry_params_name": "default" + }, + "GetFinding": { + "timeout_millis": 600000, + "retry_codes_name": "idempotent", + "retry_params_name": "default" + }, + "ListFindings": { + "timeout_millis": 600000, + "retry_codes_name": "idempotent", + "retry_params_name": "default" + }, + "ListFindingTypeStats": { + "timeout_millis": 600000, + "retry_codes_name": "idempotent", + "retry_params_name": "default" + } + } + } + } +} diff --git a/packages/google-cloud-websecurityscanner/src/v1/web_security_scanner_proto_list.json b/packages/google-cloud-websecurityscanner/src/v1/web_security_scanner_proto_list.json new file mode 100644 index 00000000000..627b52eed99 --- /dev/null +++ b/packages/google-cloud-websecurityscanner/src/v1/web_security_scanner_proto_list.json @@ -0,0 +1,13 @@ +[ + "../../protos/google/cloud/websecurityscanner/v1/crawled_url.proto", + "../../protos/google/cloud/websecurityscanner/v1/finding.proto", + "../../protos/google/cloud/websecurityscanner/v1/finding_addon.proto", + "../../protos/google/cloud/websecurityscanner/v1/finding_type_stats.proto", + "../../protos/google/cloud/websecurityscanner/v1/scan_config.proto", + "../../protos/google/cloud/websecurityscanner/v1/scan_config_error.proto", + "../../protos/google/cloud/websecurityscanner/v1/scan_run.proto", + "../../protos/google/cloud/websecurityscanner/v1/scan_run_error_trace.proto", + "../../protos/google/cloud/websecurityscanner/v1/scan_run_log.proto", + "../../protos/google/cloud/websecurityscanner/v1/scan_run_warning_trace.proto", + "../../protos/google/cloud/websecurityscanner/v1/web_security_scanner.proto" +] diff --git a/packages/google-cloud-websecurityscanner/src/v1alpha/gapic_metadata.json b/packages/google-cloud-websecurityscanner/src/v1alpha/gapic_metadata.json new file mode 100644 index 00000000000..72e2c6b7bde --- /dev/null +++ b/packages/google-cloud-websecurityscanner/src/v1alpha/gapic_metadata.json @@ -0,0 +1,169 @@ +{ + "schema": "1.0", + "comment": "This file maps proto services/RPCs to the corresponding library clients/methods", + "language": "typescript", + "protoPackage": "google.cloud.websecurityscanner.v1alpha", + "libraryPackage": "@google-cloud/web-security-scanner", + "services": { + "WebSecurityScanner": { + "clients": { + "grpc": { + "libraryClient": "WebSecurityScannerClient", + "rpcs": { + "CreateScanConfig": { + "methods": [ + "createScanConfig" + ] + }, + "DeleteScanConfig": { + "methods": [ + "deleteScanConfig" + ] + }, + "GetScanConfig": { + "methods": [ + "getScanConfig" + ] + }, + "UpdateScanConfig": { + "methods": [ + "updateScanConfig" + ] + }, + "StartScanRun": { + "methods": [ + "startScanRun" + ] + }, + "GetScanRun": { + "methods": [ + "getScanRun" + ] + }, + "StopScanRun": { + "methods": [ + "stopScanRun" + ] + }, + "GetFinding": { + "methods": [ + "getFinding" + ] + }, + "ListFindingTypeStats": { + "methods": [ + "listFindingTypeStats" + ] + }, + "ListScanConfigs": { + "methods": [ + "listScanConfigs", + "listScanConfigsStream", + "listScanConfigsAsync" + ] + }, + "ListScanRuns": { + "methods": [ + "listScanRuns", + "listScanRunsStream", + "listScanRunsAsync" + ] + }, + "ListCrawledUrls": { + "methods": [ + "listCrawledUrls", + "listCrawledUrlsStream", + "listCrawledUrlsAsync" + ] + }, + "ListFindings": { + "methods": [ + "listFindings", + "listFindingsStream", + "listFindingsAsync" + ] + } + } + }, + "grpc-fallback": { + "libraryClient": "WebSecurityScannerClient", + "rpcs": { + "CreateScanConfig": { + "methods": [ + "createScanConfig" + ] + }, + "DeleteScanConfig": { + "methods": [ + "deleteScanConfig" + ] + }, + "GetScanConfig": { + "methods": [ + "getScanConfig" + ] + }, + "UpdateScanConfig": { + "methods": [ + "updateScanConfig" + ] + }, + "StartScanRun": { + "methods": [ + "startScanRun" + ] + }, + "GetScanRun": { + "methods": [ + "getScanRun" + ] + }, + "StopScanRun": { + "methods": [ + "stopScanRun" + ] + }, + "GetFinding": { + "methods": [ + "getFinding" + ] + }, + "ListFindingTypeStats": { + "methods": [ + "listFindingTypeStats" + ] + }, + "ListScanConfigs": { + "methods": [ + "listScanConfigs", + "listScanConfigsStream", + "listScanConfigsAsync" + ] + }, + "ListScanRuns": { + "methods": [ + "listScanRuns", + "listScanRunsStream", + "listScanRunsAsync" + ] + }, + "ListCrawledUrls": { + "methods": [ + "listCrawledUrls", + "listCrawledUrlsStream", + "listCrawledUrlsAsync" + ] + }, + "ListFindings": { + "methods": [ + "listFindings", + "listFindingsStream", + "listFindingsAsync" + ] + } + } + } + } + } + } +} diff --git a/packages/google-cloud-websecurityscanner/src/v1alpha/index.ts b/packages/google-cloud-websecurityscanner/src/v1alpha/index.ts new file mode 100644 index 00000000000..515d3366d8a --- /dev/null +++ b/packages/google-cloud-websecurityscanner/src/v1alpha/index.ts @@ -0,0 +1,19 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** 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 {WebSecurityScannerClient} from './web_security_scanner_client'; diff --git a/packages/google-cloud-websecurityscanner/src/v1alpha/web_security_scanner_client.ts b/packages/google-cloud-websecurityscanner/src/v1alpha/web_security_scanner_client.ts new file mode 100644 index 00000000000..80cd449948d --- /dev/null +++ b/packages/google-cloud-websecurityscanner/src/v1alpha/web_security_scanner_client.ts @@ -0,0 +1,2297 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + +/* global window */ +import type * as gax from 'google-gax'; +import type { + Callback, + CallOptions, + Descriptors, + ClientOptions, + PaginationCallback, + GaxCall, +} from 'google-gax'; +import {Transform} from 'stream'; +import * as protos from '../../protos/protos'; +import jsonProtos = require('../../protos/protos.json'); +/** + * Client JSON configuration object, loaded from + * `src/v1alpha/web_security_scanner_client_config.json`. + * This file defines retry strategy and timeouts for all API methods in this library. + */ +import * as gapicConfig from './web_security_scanner_client_config.json'; +const version = require('../../../package.json').version; + +/** + * Cloud Web Security Scanner Service identifies security vulnerabilities in web + * applications hosted on Google Cloud Platform. It crawls your application, and + * attempts to exercise as many user inputs and event handlers as possible. + * @class + * @memberof v1alpha + */ +export class WebSecurityScannerClient { + private _terminated = false; + private _opts: ClientOptions; + private _providedCustomServicePath: boolean; + private _gaxModule: typeof gax | typeof gax.fallback; + private _gaxGrpc: gax.GrpcClient | gax.fallback.GrpcClient; + private _protos: {}; + private _defaults: {[method: string]: gax.CallSettings}; + auth: gax.GoogleAuth; + descriptors: Descriptors = { + page: {}, + stream: {}, + longrunning: {}, + batching: {}, + }; + warn: (code: string, message: string, warnType?: string) => void; + innerApiCalls: {[name: string]: Function}; + pathTemplates: {[name: string]: gax.PathTemplate}; + webSecurityScannerStub?: Promise<{[name: string]: Function}>; + + /** + * Construct an instance of WebSecurityScannerClient. + * + * @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 | "rest"} [options.fallback] - Use HTTP fallback mode. + * Pass "rest" to use HTTP/1.1 REST API instead of gRPC. + * 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 WebSecurityScannerClient({fallback: 'rest'}, gax); + * ``` + */ + constructor( + opts?: ClientOptions, + gaxInstance?: typeof gax | typeof gax.fallback + ) { + // Ensure that options include all the required fields. + const staticMembers = this.constructor as typeof WebSecurityScannerClient; + const servicePath = + opts?.servicePath || opts?.apiEndpoint || staticMembers.servicePath; + this._providedCustomServicePath = !!( + opts?.servicePath || opts?.apiEndpoint + ); + const port = opts?.port || staticMembers.port; + const clientConfig = opts?.clientConfig ?? {}; + const fallback = + opts?.fallback ?? + (typeof window !== 'undefined' && typeof window?.fetch === 'function'); + opts = Object.assign({servicePath, port, clientConfig, fallback}, opts); + + // If scopes are unset in options and we're connecting to a non-default endpoint, set scopes just in case. + if (servicePath !== staticMembers.servicePath && !('scopes' in opts)) { + opts['scopes'] = staticMembers.scopes; + } + + // Load google-gax module synchronously if needed + if (!gaxInstance) { + gaxInstance = require('google-gax') as typeof gax; + } + + // Choose either gRPC or proto-over-HTTP implementation of google-gax. + this._gaxModule = opts.fallback ? gaxInstance.fallback : gaxInstance; + + // Create a `gaxGrpc` object, with any grpc-specific options sent to the client. + this._gaxGrpc = new this._gaxModule.GrpcClient(opts); + + // Save options to use in initialize() method. + this._opts = opts; + + // Save the auth object to the client, for use by other methods. + this.auth = this._gaxGrpc.auth as gax.GoogleAuth; + + // Set useJWTAccessWithScope on the auth object. + this.auth.useJWTAccessWithScope = true; + + // Set defaultServicePath on the auth object. + this.auth.defaultServicePath = staticMembers.servicePath; + + // Set the default scopes in auth client if needed. + if (servicePath === staticMembers.servicePath) { + this.auth.defaultScopes = staticMembers.scopes; + } + + // Determine the client header string. + const clientHeader = [`gax/${this._gaxModule.version}`, `gapic/${version}`]; + if (typeof process !== 'undefined' && 'versions' in process) { + clientHeader.push(`gl-node/${process.versions.node}`); + } else { + clientHeader.push(`gl-web/${this._gaxModule.version}`); + } + if (!opts.fallback) { + clientHeader.push(`grpc/${this._gaxGrpc.grpcVersion}`); + } else if (opts.fallback === 'rest') { + 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 = { + findingPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/scanConfigs/{scan_config}/scanRuns/{scan_run}/findings/{finding}' + ), + projectPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}' + ), + scanConfigPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/scanConfigs/{scan_config}' + ), + scanRunPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/scanConfigs/{scan_config}/scanRuns/{scan_run}' + ), + }; + + // 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 = { + listScanConfigs: new this._gaxModule.PageDescriptor( + 'pageToken', + 'nextPageToken', + 'scanConfigs' + ), + listScanRuns: new this._gaxModule.PageDescriptor( + 'pageToken', + 'nextPageToken', + 'scanRuns' + ), + listCrawledUrls: new this._gaxModule.PageDescriptor( + 'pageToken', + 'nextPageToken', + 'crawledUrls' + ), + listFindings: new this._gaxModule.PageDescriptor( + 'pageToken', + 'nextPageToken', + 'findings' + ), + }; + + // Put together the default options sent with requests. + this._defaults = this._gaxGrpc.constructSettings( + 'google.cloud.websecurityscanner.v1alpha.WebSecurityScanner', + 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.webSecurityScannerStub) { + return this.webSecurityScannerStub; + } + + // Put together the "service stub" for + // google.cloud.websecurityscanner.v1alpha.WebSecurityScanner. + this.webSecurityScannerStub = this._gaxGrpc.createStub( + this._opts.fallback + ? (this._protos as protobuf.Root).lookupService( + 'google.cloud.websecurityscanner.v1alpha.WebSecurityScanner' + ) + : // eslint-disable-next-line @typescript-eslint/no-explicit-any + (this._protos as any).google.cloud.websecurityscanner.v1alpha + .WebSecurityScanner, + 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 webSecurityScannerStubMethods = [ + 'createScanConfig', + 'deleteScanConfig', + 'getScanConfig', + 'listScanConfigs', + 'updateScanConfig', + 'startScanRun', + 'getScanRun', + 'listScanRuns', + 'stopScanRun', + 'listCrawledUrls', + 'getFinding', + 'listFindings', + 'listFindingTypeStats', + ]; + for (const methodName of webSecurityScannerStubMethods) { + const callPromise = this.webSecurityScannerStub.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.webSecurityScannerStub; + } + + /** + * The DNS address for this API service. + * @returns {string} The DNS address for this service. + */ + static get servicePath() { + return 'websecurityscanner.googleapis.com'; + } + + /** + * The DNS address for this API service - same as servicePath(), + * exists for compatibility reasons. + * @returns {string} The DNS address for this service. + */ + static get apiEndpoint() { + return 'websecurityscanner.googleapis.com'; + } + + /** + * The port for this API service. + * @returns {number} The default port for this service. + */ + static get port() { + return 443; + } + + /** + * The scopes needed to make gRPC calls for every method defined + * in this service. + * @returns {string[]} List of default scopes. + */ + static get scopes() { + return ['https://www.googleapis.com/auth/cloud-platform']; + } + + getProjectId(): Promise; + getProjectId(callback: Callback): void; + /** + * Return the project ID used by this class. + * @returns {Promise} A promise that resolves to string containing the project ID. + */ + getProjectId( + callback?: Callback + ): Promise | void { + if (callback) { + this.auth.getProjectId(callback); + return; + } + return this.auth.getProjectId(); + } + + // ------------------- + // -- Service calls -- + // ------------------- + /** + * Creates a new ScanConfig. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The parent resource name where the scan is created, which should be a + * project resource name in the format 'projects/{projectId}'. + * @param {google.cloud.websecurityscanner.v1alpha.ScanConfig} request.scanConfig + * Required. The ScanConfig 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 [ScanConfig]{@link google.cloud.websecurityscanner.v1alpha.ScanConfig}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example include:samples/generated/v1alpha/web_security_scanner.create_scan_config.js + * region_tag:websecurityscanner_v1alpha_generated_WebSecurityScanner_CreateScanConfig_async + */ + createScanConfig( + request?: protos.google.cloud.websecurityscanner.v1alpha.ICreateScanConfigRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.websecurityscanner.v1alpha.IScanConfig, + ( + | protos.google.cloud.websecurityscanner.v1alpha.ICreateScanConfigRequest + | undefined + ), + {} | undefined + ] + >; + createScanConfig( + request: protos.google.cloud.websecurityscanner.v1alpha.ICreateScanConfigRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.websecurityscanner.v1alpha.IScanConfig, + | protos.google.cloud.websecurityscanner.v1alpha.ICreateScanConfigRequest + | null + | undefined, + {} | null | undefined + > + ): void; + createScanConfig( + request: protos.google.cloud.websecurityscanner.v1alpha.ICreateScanConfigRequest, + callback: Callback< + protos.google.cloud.websecurityscanner.v1alpha.IScanConfig, + | protos.google.cloud.websecurityscanner.v1alpha.ICreateScanConfigRequest + | null + | undefined, + {} | null | undefined + > + ): void; + createScanConfig( + request?: protos.google.cloud.websecurityscanner.v1alpha.ICreateScanConfigRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.websecurityscanner.v1alpha.IScanConfig, + | protos.google.cloud.websecurityscanner.v1alpha.ICreateScanConfigRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.websecurityscanner.v1alpha.IScanConfig, + | protos.google.cloud.websecurityscanner.v1alpha.ICreateScanConfigRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.websecurityscanner.v1alpha.IScanConfig, + ( + | protos.google.cloud.websecurityscanner.v1alpha.ICreateScanConfigRequest + | undefined + ), + {} | undefined + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as 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.createScanConfig(request, options, callback); + } + /** + * Deletes an existing ScanConfig and its child resources. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The resource name of the ScanConfig to be deleted. The name follows the + * format of 'projects/{projectId}/scanConfigs/{scanConfigId}'. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [Empty]{@link google.protobuf.Empty}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example include:samples/generated/v1alpha/web_security_scanner.delete_scan_config.js + * region_tag:websecurityscanner_v1alpha_generated_WebSecurityScanner_DeleteScanConfig_async + */ + deleteScanConfig( + request?: protos.google.cloud.websecurityscanner.v1alpha.IDeleteScanConfigRequest, + options?: CallOptions + ): Promise< + [ + protos.google.protobuf.IEmpty, + ( + | protos.google.cloud.websecurityscanner.v1alpha.IDeleteScanConfigRequest + | undefined + ), + {} | undefined + ] + >; + deleteScanConfig( + request: protos.google.cloud.websecurityscanner.v1alpha.IDeleteScanConfigRequest, + options: CallOptions, + callback: Callback< + protos.google.protobuf.IEmpty, + | protos.google.cloud.websecurityscanner.v1alpha.IDeleteScanConfigRequest + | null + | undefined, + {} | null | undefined + > + ): void; + deleteScanConfig( + request: protos.google.cloud.websecurityscanner.v1alpha.IDeleteScanConfigRequest, + callback: Callback< + protos.google.protobuf.IEmpty, + | protos.google.cloud.websecurityscanner.v1alpha.IDeleteScanConfigRequest + | null + | undefined, + {} | null | undefined + > + ): void; + deleteScanConfig( + request?: protos.google.cloud.websecurityscanner.v1alpha.IDeleteScanConfigRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.protobuf.IEmpty, + | protos.google.cloud.websecurityscanner.v1alpha.IDeleteScanConfigRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.protobuf.IEmpty, + | protos.google.cloud.websecurityscanner.v1alpha.IDeleteScanConfigRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.protobuf.IEmpty, + ( + | protos.google.cloud.websecurityscanner.v1alpha.IDeleteScanConfigRequest + | undefined + ), + {} | undefined + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + 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.deleteScanConfig(request, options, callback); + } + /** + * Gets a ScanConfig. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The resource name of the ScanConfig to be returned. The name follows the + * format of 'projects/{projectId}/scanConfigs/{scanConfigId}'. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [ScanConfig]{@link google.cloud.websecurityscanner.v1alpha.ScanConfig}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example include:samples/generated/v1alpha/web_security_scanner.get_scan_config.js + * region_tag:websecurityscanner_v1alpha_generated_WebSecurityScanner_GetScanConfig_async + */ + getScanConfig( + request?: protos.google.cloud.websecurityscanner.v1alpha.IGetScanConfigRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.websecurityscanner.v1alpha.IScanConfig, + ( + | protos.google.cloud.websecurityscanner.v1alpha.IGetScanConfigRequest + | undefined + ), + {} | undefined + ] + >; + getScanConfig( + request: protos.google.cloud.websecurityscanner.v1alpha.IGetScanConfigRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.websecurityscanner.v1alpha.IScanConfig, + | protos.google.cloud.websecurityscanner.v1alpha.IGetScanConfigRequest + | null + | undefined, + {} | null | undefined + > + ): void; + getScanConfig( + request: protos.google.cloud.websecurityscanner.v1alpha.IGetScanConfigRequest, + callback: Callback< + protos.google.cloud.websecurityscanner.v1alpha.IScanConfig, + | protos.google.cloud.websecurityscanner.v1alpha.IGetScanConfigRequest + | null + | undefined, + {} | null | undefined + > + ): void; + getScanConfig( + request?: protos.google.cloud.websecurityscanner.v1alpha.IGetScanConfigRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.websecurityscanner.v1alpha.IScanConfig, + | protos.google.cloud.websecurityscanner.v1alpha.IGetScanConfigRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.websecurityscanner.v1alpha.IScanConfig, + | protos.google.cloud.websecurityscanner.v1alpha.IGetScanConfigRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.websecurityscanner.v1alpha.IScanConfig, + ( + | protos.google.cloud.websecurityscanner.v1alpha.IGetScanConfigRequest + | undefined + ), + {} | undefined + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + 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.getScanConfig(request, options, callback); + } + /** + * Updates a ScanConfig. This method support partial update of a ScanConfig. + * + * @param {Object} request + * The request object that will be sent. + * @param {google.cloud.websecurityscanner.v1alpha.ScanConfig} request.scanConfig + * Required. The ScanConfig to be updated. The name field must be set to identify the + * resource to be updated. The values of fields not covered by the mask + * will be ignored. + * @param {google.protobuf.FieldMask} request.updateMask + * Required. The update mask applies to the resource. For the `FieldMask` definition, + * see + * https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#fieldmask + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [ScanConfig]{@link google.cloud.websecurityscanner.v1alpha.ScanConfig}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example include:samples/generated/v1alpha/web_security_scanner.update_scan_config.js + * region_tag:websecurityscanner_v1alpha_generated_WebSecurityScanner_UpdateScanConfig_async + */ + updateScanConfig( + request?: protos.google.cloud.websecurityscanner.v1alpha.IUpdateScanConfigRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.websecurityscanner.v1alpha.IScanConfig, + ( + | protos.google.cloud.websecurityscanner.v1alpha.IUpdateScanConfigRequest + | undefined + ), + {} | undefined + ] + >; + updateScanConfig( + request: protos.google.cloud.websecurityscanner.v1alpha.IUpdateScanConfigRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.websecurityscanner.v1alpha.IScanConfig, + | protos.google.cloud.websecurityscanner.v1alpha.IUpdateScanConfigRequest + | null + | undefined, + {} | null | undefined + > + ): void; + updateScanConfig( + request: protos.google.cloud.websecurityscanner.v1alpha.IUpdateScanConfigRequest, + callback: Callback< + protos.google.cloud.websecurityscanner.v1alpha.IScanConfig, + | protos.google.cloud.websecurityscanner.v1alpha.IUpdateScanConfigRequest + | null + | undefined, + {} | null | undefined + > + ): void; + updateScanConfig( + request?: protos.google.cloud.websecurityscanner.v1alpha.IUpdateScanConfigRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.websecurityscanner.v1alpha.IScanConfig, + | protos.google.cloud.websecurityscanner.v1alpha.IUpdateScanConfigRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.websecurityscanner.v1alpha.IScanConfig, + | protos.google.cloud.websecurityscanner.v1alpha.IUpdateScanConfigRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.websecurityscanner.v1alpha.IScanConfig, + ( + | protos.google.cloud.websecurityscanner.v1alpha.IUpdateScanConfigRequest + | undefined + ), + {} | undefined + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + 'scan_config.name': request.scanConfig!.name ?? '', + }); + this.initialize(); + return this.innerApiCalls.updateScanConfig(request, options, callback); + } + /** + * Start a ScanRun according to the given ScanConfig. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The resource name of the ScanConfig to be used. The name follows the + * format of 'projects/{projectId}/scanConfigs/{scanConfigId}'. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [ScanRun]{@link google.cloud.websecurityscanner.v1alpha.ScanRun}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example include:samples/generated/v1alpha/web_security_scanner.start_scan_run.js + * region_tag:websecurityscanner_v1alpha_generated_WebSecurityScanner_StartScanRun_async + */ + startScanRun( + request?: protos.google.cloud.websecurityscanner.v1alpha.IStartScanRunRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.websecurityscanner.v1alpha.IScanRun, + ( + | protos.google.cloud.websecurityscanner.v1alpha.IStartScanRunRequest + | undefined + ), + {} | undefined + ] + >; + startScanRun( + request: protos.google.cloud.websecurityscanner.v1alpha.IStartScanRunRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.websecurityscanner.v1alpha.IScanRun, + | protos.google.cloud.websecurityscanner.v1alpha.IStartScanRunRequest + | null + | undefined, + {} | null | undefined + > + ): void; + startScanRun( + request: protos.google.cloud.websecurityscanner.v1alpha.IStartScanRunRequest, + callback: Callback< + protos.google.cloud.websecurityscanner.v1alpha.IScanRun, + | protos.google.cloud.websecurityscanner.v1alpha.IStartScanRunRequest + | null + | undefined, + {} | null | undefined + > + ): void; + startScanRun( + request?: protos.google.cloud.websecurityscanner.v1alpha.IStartScanRunRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.websecurityscanner.v1alpha.IScanRun, + | protos.google.cloud.websecurityscanner.v1alpha.IStartScanRunRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.websecurityscanner.v1alpha.IScanRun, + | protos.google.cloud.websecurityscanner.v1alpha.IStartScanRunRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.websecurityscanner.v1alpha.IScanRun, + ( + | protos.google.cloud.websecurityscanner.v1alpha.IStartScanRunRequest + | undefined + ), + {} | undefined + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + 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.startScanRun(request, options, callback); + } + /** + * Gets a ScanRun. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The resource name of the ScanRun to be returned. The name follows the + * format of + * 'projects/{projectId}/scanConfigs/{scanConfigId}/scanRuns/{scanRunId}'. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [ScanRun]{@link google.cloud.websecurityscanner.v1alpha.ScanRun}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example include:samples/generated/v1alpha/web_security_scanner.get_scan_run.js + * region_tag:websecurityscanner_v1alpha_generated_WebSecurityScanner_GetScanRun_async + */ + getScanRun( + request?: protos.google.cloud.websecurityscanner.v1alpha.IGetScanRunRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.websecurityscanner.v1alpha.IScanRun, + ( + | protos.google.cloud.websecurityscanner.v1alpha.IGetScanRunRequest + | undefined + ), + {} | undefined + ] + >; + getScanRun( + request: protos.google.cloud.websecurityscanner.v1alpha.IGetScanRunRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.websecurityscanner.v1alpha.IScanRun, + | protos.google.cloud.websecurityscanner.v1alpha.IGetScanRunRequest + | null + | undefined, + {} | null | undefined + > + ): void; + getScanRun( + request: protos.google.cloud.websecurityscanner.v1alpha.IGetScanRunRequest, + callback: Callback< + protos.google.cloud.websecurityscanner.v1alpha.IScanRun, + | protos.google.cloud.websecurityscanner.v1alpha.IGetScanRunRequest + | null + | undefined, + {} | null | undefined + > + ): void; + getScanRun( + request?: protos.google.cloud.websecurityscanner.v1alpha.IGetScanRunRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.websecurityscanner.v1alpha.IScanRun, + | protos.google.cloud.websecurityscanner.v1alpha.IGetScanRunRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.websecurityscanner.v1alpha.IScanRun, + | protos.google.cloud.websecurityscanner.v1alpha.IGetScanRunRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.websecurityscanner.v1alpha.IScanRun, + ( + | protos.google.cloud.websecurityscanner.v1alpha.IGetScanRunRequest + | undefined + ), + {} | undefined + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + 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.getScanRun(request, options, callback); + } + /** + * Stops a ScanRun. The stopped ScanRun is returned. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The resource name of the ScanRun to be stopped. The name follows the + * format of + * 'projects/{projectId}/scanConfigs/{scanConfigId}/scanRuns/{scanRunId}'. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [ScanRun]{@link google.cloud.websecurityscanner.v1alpha.ScanRun}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example include:samples/generated/v1alpha/web_security_scanner.stop_scan_run.js + * region_tag:websecurityscanner_v1alpha_generated_WebSecurityScanner_StopScanRun_async + */ + stopScanRun( + request?: protos.google.cloud.websecurityscanner.v1alpha.IStopScanRunRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.websecurityscanner.v1alpha.IScanRun, + ( + | protos.google.cloud.websecurityscanner.v1alpha.IStopScanRunRequest + | undefined + ), + {} | undefined + ] + >; + stopScanRun( + request: protos.google.cloud.websecurityscanner.v1alpha.IStopScanRunRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.websecurityscanner.v1alpha.IScanRun, + | protos.google.cloud.websecurityscanner.v1alpha.IStopScanRunRequest + | null + | undefined, + {} | null | undefined + > + ): void; + stopScanRun( + request: protos.google.cloud.websecurityscanner.v1alpha.IStopScanRunRequest, + callback: Callback< + protos.google.cloud.websecurityscanner.v1alpha.IScanRun, + | protos.google.cloud.websecurityscanner.v1alpha.IStopScanRunRequest + | null + | undefined, + {} | null | undefined + > + ): void; + stopScanRun( + request?: protos.google.cloud.websecurityscanner.v1alpha.IStopScanRunRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.websecurityscanner.v1alpha.IScanRun, + | protos.google.cloud.websecurityscanner.v1alpha.IStopScanRunRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.websecurityscanner.v1alpha.IScanRun, + | protos.google.cloud.websecurityscanner.v1alpha.IStopScanRunRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.websecurityscanner.v1alpha.IScanRun, + ( + | protos.google.cloud.websecurityscanner.v1alpha.IStopScanRunRequest + | undefined + ), + {} | undefined + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + 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.stopScanRun(request, options, callback); + } + /** + * Gets a Finding. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The resource name of the Finding to be returned. The name follows the + * format of + * 'projects/{projectId}/scanConfigs/{scanConfigId}/scanRuns/{scanRunId}/findings/{findingId}'. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [Finding]{@link google.cloud.websecurityscanner.v1alpha.Finding}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example include:samples/generated/v1alpha/web_security_scanner.get_finding.js + * region_tag:websecurityscanner_v1alpha_generated_WebSecurityScanner_GetFinding_async + */ + getFinding( + request?: protos.google.cloud.websecurityscanner.v1alpha.IGetFindingRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.websecurityscanner.v1alpha.IFinding, + ( + | protos.google.cloud.websecurityscanner.v1alpha.IGetFindingRequest + | undefined + ), + {} | undefined + ] + >; + getFinding( + request: protos.google.cloud.websecurityscanner.v1alpha.IGetFindingRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.websecurityscanner.v1alpha.IFinding, + | protos.google.cloud.websecurityscanner.v1alpha.IGetFindingRequest + | null + | undefined, + {} | null | undefined + > + ): void; + getFinding( + request: protos.google.cloud.websecurityscanner.v1alpha.IGetFindingRequest, + callback: Callback< + protos.google.cloud.websecurityscanner.v1alpha.IFinding, + | protos.google.cloud.websecurityscanner.v1alpha.IGetFindingRequest + | null + | undefined, + {} | null | undefined + > + ): void; + getFinding( + request?: protos.google.cloud.websecurityscanner.v1alpha.IGetFindingRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.websecurityscanner.v1alpha.IFinding, + | protos.google.cloud.websecurityscanner.v1alpha.IGetFindingRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.websecurityscanner.v1alpha.IFinding, + | protos.google.cloud.websecurityscanner.v1alpha.IGetFindingRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.websecurityscanner.v1alpha.IFinding, + ( + | protos.google.cloud.websecurityscanner.v1alpha.IGetFindingRequest + | undefined + ), + {} | undefined + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + 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.getFinding(request, options, callback); + } + /** + * List all FindingTypeStats under a given ScanRun. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The parent resource name, which should be a scan run resource name in the + * format + * 'projects/{projectId}/scanConfigs/{scanConfigId}/scanRuns/{scanRunId}'. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [ListFindingTypeStatsResponse]{@link google.cloud.websecurityscanner.v1alpha.ListFindingTypeStatsResponse}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example include:samples/generated/v1alpha/web_security_scanner.list_finding_type_stats.js + * region_tag:websecurityscanner_v1alpha_generated_WebSecurityScanner_ListFindingTypeStats_async + */ + listFindingTypeStats( + request?: protos.google.cloud.websecurityscanner.v1alpha.IListFindingTypeStatsRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.websecurityscanner.v1alpha.IListFindingTypeStatsResponse, + ( + | protos.google.cloud.websecurityscanner.v1alpha.IListFindingTypeStatsRequest + | undefined + ), + {} | undefined + ] + >; + listFindingTypeStats( + request: protos.google.cloud.websecurityscanner.v1alpha.IListFindingTypeStatsRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.websecurityscanner.v1alpha.IListFindingTypeStatsResponse, + | protos.google.cloud.websecurityscanner.v1alpha.IListFindingTypeStatsRequest + | null + | undefined, + {} | null | undefined + > + ): void; + listFindingTypeStats( + request: protos.google.cloud.websecurityscanner.v1alpha.IListFindingTypeStatsRequest, + callback: Callback< + protos.google.cloud.websecurityscanner.v1alpha.IListFindingTypeStatsResponse, + | protos.google.cloud.websecurityscanner.v1alpha.IListFindingTypeStatsRequest + | null + | undefined, + {} | null | undefined + > + ): void; + listFindingTypeStats( + request?: protos.google.cloud.websecurityscanner.v1alpha.IListFindingTypeStatsRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.websecurityscanner.v1alpha.IListFindingTypeStatsResponse, + | protos.google.cloud.websecurityscanner.v1alpha.IListFindingTypeStatsRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.websecurityscanner.v1alpha.IListFindingTypeStatsResponse, + | protos.google.cloud.websecurityscanner.v1alpha.IListFindingTypeStatsRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.websecurityscanner.v1alpha.IListFindingTypeStatsResponse, + ( + | protos.google.cloud.websecurityscanner.v1alpha.IListFindingTypeStatsRequest + | undefined + ), + {} | undefined + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as 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.listFindingTypeStats(request, options, callback); + } + + /** + * Lists ScanConfigs under a given project. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The parent resource name, which should be a project resource name in the + * format 'projects/{projectId}'. + * @param {string} request.pageToken + * A token identifying a page of results to be returned. This should be a + * `next_page_token` value returned from a previous List request. + * If unspecified, the first page of results is returned. + * @param {number} request.pageSize + * The maximum number of ScanConfigs to return, can be limited by server. + * If not specified or not positive, the implementation will select a + * reasonable value. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is Array of [ScanConfig]{@link google.cloud.websecurityscanner.v1alpha.ScanConfig}. + * 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 `listScanConfigsAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) + * for more details and examples. + */ + listScanConfigs( + request?: protos.google.cloud.websecurityscanner.v1alpha.IListScanConfigsRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.websecurityscanner.v1alpha.IScanConfig[], + protos.google.cloud.websecurityscanner.v1alpha.IListScanConfigsRequest | null, + protos.google.cloud.websecurityscanner.v1alpha.IListScanConfigsResponse + ] + >; + listScanConfigs( + request: protos.google.cloud.websecurityscanner.v1alpha.IListScanConfigsRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.cloud.websecurityscanner.v1alpha.IListScanConfigsRequest, + | protos.google.cloud.websecurityscanner.v1alpha.IListScanConfigsResponse + | null + | undefined, + protos.google.cloud.websecurityscanner.v1alpha.IScanConfig + > + ): void; + listScanConfigs( + request: protos.google.cloud.websecurityscanner.v1alpha.IListScanConfigsRequest, + callback: PaginationCallback< + protos.google.cloud.websecurityscanner.v1alpha.IListScanConfigsRequest, + | protos.google.cloud.websecurityscanner.v1alpha.IListScanConfigsResponse + | null + | undefined, + protos.google.cloud.websecurityscanner.v1alpha.IScanConfig + > + ): void; + listScanConfigs( + request?: protos.google.cloud.websecurityscanner.v1alpha.IListScanConfigsRequest, + optionsOrCallback?: + | CallOptions + | PaginationCallback< + protos.google.cloud.websecurityscanner.v1alpha.IListScanConfigsRequest, + | protos.google.cloud.websecurityscanner.v1alpha.IListScanConfigsResponse + | null + | undefined, + protos.google.cloud.websecurityscanner.v1alpha.IScanConfig + >, + callback?: PaginationCallback< + protos.google.cloud.websecurityscanner.v1alpha.IListScanConfigsRequest, + | protos.google.cloud.websecurityscanner.v1alpha.IListScanConfigsResponse + | null + | undefined, + protos.google.cloud.websecurityscanner.v1alpha.IScanConfig + > + ): Promise< + [ + protos.google.cloud.websecurityscanner.v1alpha.IScanConfig[], + protos.google.cloud.websecurityscanner.v1alpha.IListScanConfigsRequest | null, + protos.google.cloud.websecurityscanner.v1alpha.IListScanConfigsResponse + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as 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.listScanConfigs(request, options, callback); + } + + /** + * Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The parent resource name, which should be a project resource name in the + * format 'projects/{projectId}'. + * @param {string} request.pageToken + * A token identifying a page of results to be returned. This should be a + * `next_page_token` value returned from a previous List request. + * If unspecified, the first page of results is returned. + * @param {number} request.pageSize + * The maximum number of ScanConfigs to return, can be limited by server. + * If not specified or not positive, the implementation will select a + * reasonable value. + * @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 [ScanConfig]{@link google.cloud.websecurityscanner.v1alpha.ScanConfig} 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 `listScanConfigsAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) + * for more details and examples. + */ + listScanConfigsStream( + request?: protos.google.cloud.websecurityscanner.v1alpha.IListScanConfigsRequest, + 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['listScanConfigs']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.listScanConfigs.createStream( + this.innerApiCalls.listScanConfigs as GaxCall, + request, + callSettings + ); + } + + /** + * Equivalent to `listScanConfigs`, 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 name, which should be a project resource name in the + * format 'projects/{projectId}'. + * @param {string} request.pageToken + * A token identifying a page of results to be returned. This should be a + * `next_page_token` value returned from a previous List request. + * If unspecified, the first page of results is returned. + * @param {number} request.pageSize + * The maximum number of ScanConfigs to return, can be limited by server. + * If not specified or not positive, the implementation will select a + * reasonable value. + * @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 [async iteration](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols). + * When you iterate the returned iterable, each element will be an object representing + * [ScanConfig]{@link google.cloud.websecurityscanner.v1alpha.ScanConfig}. 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 + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) + * for more details and examples. + * @example include:samples/generated/v1alpha/web_security_scanner.list_scan_configs.js + * region_tag:websecurityscanner_v1alpha_generated_WebSecurityScanner_ListScanConfigs_async + */ + listScanConfigsAsync( + request?: protos.google.cloud.websecurityscanner.v1alpha.IListScanConfigsRequest, + 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['listScanConfigs']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.listScanConfigs.asyncIterate( + this.innerApiCalls['listScanConfigs'] as GaxCall, + request as {}, + callSettings + ) as AsyncIterable; + } + /** + * Lists ScanRuns under a given ScanConfig, in descending order of ScanRun + * stop time. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The parent resource name, which should be a scan resource name in the + * format 'projects/{projectId}/scanConfigs/{scanConfigId}'. + * @param {string} request.pageToken + * A token identifying a page of results to be returned. This should be a + * `next_page_token` value returned from a previous List request. + * If unspecified, the first page of results is returned. + * @param {number} request.pageSize + * The maximum number of ScanRuns to return, can be limited by server. + * If not specified or not positive, the implementation will select a + * reasonable value. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is Array of [ScanRun]{@link google.cloud.websecurityscanner.v1alpha.ScanRun}. + * 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 `listScanRunsAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) + * for more details and examples. + */ + listScanRuns( + request?: protos.google.cloud.websecurityscanner.v1alpha.IListScanRunsRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.websecurityscanner.v1alpha.IScanRun[], + protos.google.cloud.websecurityscanner.v1alpha.IListScanRunsRequest | null, + protos.google.cloud.websecurityscanner.v1alpha.IListScanRunsResponse + ] + >; + listScanRuns( + request: protos.google.cloud.websecurityscanner.v1alpha.IListScanRunsRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.cloud.websecurityscanner.v1alpha.IListScanRunsRequest, + | protos.google.cloud.websecurityscanner.v1alpha.IListScanRunsResponse + | null + | undefined, + protos.google.cloud.websecurityscanner.v1alpha.IScanRun + > + ): void; + listScanRuns( + request: protos.google.cloud.websecurityscanner.v1alpha.IListScanRunsRequest, + callback: PaginationCallback< + protos.google.cloud.websecurityscanner.v1alpha.IListScanRunsRequest, + | protos.google.cloud.websecurityscanner.v1alpha.IListScanRunsResponse + | null + | undefined, + protos.google.cloud.websecurityscanner.v1alpha.IScanRun + > + ): void; + listScanRuns( + request?: protos.google.cloud.websecurityscanner.v1alpha.IListScanRunsRequest, + optionsOrCallback?: + | CallOptions + | PaginationCallback< + protos.google.cloud.websecurityscanner.v1alpha.IListScanRunsRequest, + | protos.google.cloud.websecurityscanner.v1alpha.IListScanRunsResponse + | null + | undefined, + protos.google.cloud.websecurityscanner.v1alpha.IScanRun + >, + callback?: PaginationCallback< + protos.google.cloud.websecurityscanner.v1alpha.IListScanRunsRequest, + | protos.google.cloud.websecurityscanner.v1alpha.IListScanRunsResponse + | null + | undefined, + protos.google.cloud.websecurityscanner.v1alpha.IScanRun + > + ): Promise< + [ + protos.google.cloud.websecurityscanner.v1alpha.IScanRun[], + protos.google.cloud.websecurityscanner.v1alpha.IListScanRunsRequest | null, + protos.google.cloud.websecurityscanner.v1alpha.IListScanRunsResponse + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as 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.listScanRuns(request, options, callback); + } + + /** + * Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The parent resource name, which should be a scan resource name in the + * format 'projects/{projectId}/scanConfigs/{scanConfigId}'. + * @param {string} request.pageToken + * A token identifying a page of results to be returned. This should be a + * `next_page_token` value returned from a previous List request. + * If unspecified, the first page of results is returned. + * @param {number} request.pageSize + * The maximum number of ScanRuns to return, can be limited by server. + * If not specified or not positive, the implementation will select a + * reasonable value. + * @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 [ScanRun]{@link google.cloud.websecurityscanner.v1alpha.ScanRun} 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 `listScanRunsAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) + * for more details and examples. + */ + listScanRunsStream( + request?: protos.google.cloud.websecurityscanner.v1alpha.IListScanRunsRequest, + 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['listScanRuns']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.listScanRuns.createStream( + this.innerApiCalls.listScanRuns as GaxCall, + request, + callSettings + ); + } + + /** + * Equivalent to `listScanRuns`, 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 name, which should be a scan resource name in the + * format 'projects/{projectId}/scanConfigs/{scanConfigId}'. + * @param {string} request.pageToken + * A token identifying a page of results to be returned. This should be a + * `next_page_token` value returned from a previous List request. + * If unspecified, the first page of results is returned. + * @param {number} request.pageSize + * The maximum number of ScanRuns to return, can be limited by server. + * If not specified or not positive, the implementation will select a + * reasonable value. + * @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 [async iteration](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols). + * When you iterate the returned iterable, each element will be an object representing + * [ScanRun]{@link google.cloud.websecurityscanner.v1alpha.ScanRun}. 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 + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) + * for more details and examples. + * @example include:samples/generated/v1alpha/web_security_scanner.list_scan_runs.js + * region_tag:websecurityscanner_v1alpha_generated_WebSecurityScanner_ListScanRuns_async + */ + listScanRunsAsync( + request?: protos.google.cloud.websecurityscanner.v1alpha.IListScanRunsRequest, + 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['listScanRuns']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.listScanRuns.asyncIterate( + this.innerApiCalls['listScanRuns'] as GaxCall, + request as {}, + callSettings + ) as AsyncIterable; + } + /** + * List CrawledUrls under a given ScanRun. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The parent resource name, which should be a scan run resource name in the + * format + * 'projects/{projectId}/scanConfigs/{scanConfigId}/scanRuns/{scanRunId}'. + * @param {string} request.pageToken + * A token identifying a page of results to be returned. This should be a + * `next_page_token` value returned from a previous List request. + * If unspecified, the first page of results is returned. + * @param {number} request.pageSize + * The maximum number of CrawledUrls to return, can be limited by server. + * If not specified or not positive, the implementation will select a + * reasonable value. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is Array of [CrawledUrl]{@link google.cloud.websecurityscanner.v1alpha.CrawledUrl}. + * 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 `listCrawledUrlsAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) + * for more details and examples. + */ + listCrawledUrls( + request?: protos.google.cloud.websecurityscanner.v1alpha.IListCrawledUrlsRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.websecurityscanner.v1alpha.ICrawledUrl[], + protos.google.cloud.websecurityscanner.v1alpha.IListCrawledUrlsRequest | null, + protos.google.cloud.websecurityscanner.v1alpha.IListCrawledUrlsResponse + ] + >; + listCrawledUrls( + request: protos.google.cloud.websecurityscanner.v1alpha.IListCrawledUrlsRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.cloud.websecurityscanner.v1alpha.IListCrawledUrlsRequest, + | protos.google.cloud.websecurityscanner.v1alpha.IListCrawledUrlsResponse + | null + | undefined, + protos.google.cloud.websecurityscanner.v1alpha.ICrawledUrl + > + ): void; + listCrawledUrls( + request: protos.google.cloud.websecurityscanner.v1alpha.IListCrawledUrlsRequest, + callback: PaginationCallback< + protos.google.cloud.websecurityscanner.v1alpha.IListCrawledUrlsRequest, + | protos.google.cloud.websecurityscanner.v1alpha.IListCrawledUrlsResponse + | null + | undefined, + protos.google.cloud.websecurityscanner.v1alpha.ICrawledUrl + > + ): void; + listCrawledUrls( + request?: protos.google.cloud.websecurityscanner.v1alpha.IListCrawledUrlsRequest, + optionsOrCallback?: + | CallOptions + | PaginationCallback< + protos.google.cloud.websecurityscanner.v1alpha.IListCrawledUrlsRequest, + | protos.google.cloud.websecurityscanner.v1alpha.IListCrawledUrlsResponse + | null + | undefined, + protos.google.cloud.websecurityscanner.v1alpha.ICrawledUrl + >, + callback?: PaginationCallback< + protos.google.cloud.websecurityscanner.v1alpha.IListCrawledUrlsRequest, + | protos.google.cloud.websecurityscanner.v1alpha.IListCrawledUrlsResponse + | null + | undefined, + protos.google.cloud.websecurityscanner.v1alpha.ICrawledUrl + > + ): Promise< + [ + protos.google.cloud.websecurityscanner.v1alpha.ICrawledUrl[], + protos.google.cloud.websecurityscanner.v1alpha.IListCrawledUrlsRequest | null, + protos.google.cloud.websecurityscanner.v1alpha.IListCrawledUrlsResponse + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as 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.listCrawledUrls(request, options, callback); + } + + /** + * Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The parent resource name, which should be a scan run resource name in the + * format + * 'projects/{projectId}/scanConfigs/{scanConfigId}/scanRuns/{scanRunId}'. + * @param {string} request.pageToken + * A token identifying a page of results to be returned. This should be a + * `next_page_token` value returned from a previous List request. + * If unspecified, the first page of results is returned. + * @param {number} request.pageSize + * The maximum number of CrawledUrls to return, can be limited by server. + * If not specified or not positive, the implementation will select a + * reasonable value. + * @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 [CrawledUrl]{@link google.cloud.websecurityscanner.v1alpha.CrawledUrl} 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 `listCrawledUrlsAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) + * for more details and examples. + */ + listCrawledUrlsStream( + request?: protos.google.cloud.websecurityscanner.v1alpha.IListCrawledUrlsRequest, + 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['listCrawledUrls']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.listCrawledUrls.createStream( + this.innerApiCalls.listCrawledUrls as GaxCall, + request, + callSettings + ); + } + + /** + * Equivalent to `listCrawledUrls`, 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 name, which should be a scan run resource name in the + * format + * 'projects/{projectId}/scanConfigs/{scanConfigId}/scanRuns/{scanRunId}'. + * @param {string} request.pageToken + * A token identifying a page of results to be returned. This should be a + * `next_page_token` value returned from a previous List request. + * If unspecified, the first page of results is returned. + * @param {number} request.pageSize + * The maximum number of CrawledUrls to return, can be limited by server. + * If not specified or not positive, the implementation will select a + * reasonable value. + * @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 [async iteration](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols). + * When you iterate the returned iterable, each element will be an object representing + * [CrawledUrl]{@link google.cloud.websecurityscanner.v1alpha.CrawledUrl}. 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 + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) + * for more details and examples. + * @example include:samples/generated/v1alpha/web_security_scanner.list_crawled_urls.js + * region_tag:websecurityscanner_v1alpha_generated_WebSecurityScanner_ListCrawledUrls_async + */ + listCrawledUrlsAsync( + request?: protos.google.cloud.websecurityscanner.v1alpha.IListCrawledUrlsRequest, + 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['listCrawledUrls']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.listCrawledUrls.asyncIterate( + this.innerApiCalls['listCrawledUrls'] as GaxCall, + request as {}, + callSettings + ) as AsyncIterable; + } + /** + * List Findings under a given ScanRun. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The parent resource name, which should be a scan run resource name in the + * format + * 'projects/{projectId}/scanConfigs/{scanConfigId}/scanRuns/{scanRunId}'. + * @param {string} request.filter + * Required. The filter expression. The expression must be in the format: + * . + * Supported field: 'finding_type'. + * Supported operator: '='. + * @param {string} request.pageToken + * A token identifying a page of results to be returned. This should be a + * `next_page_token` value returned from a previous List request. + * If unspecified, the first page of results is returned. + * @param {number} request.pageSize + * The maximum number of Findings to return, can be limited by server. + * If not specified or not positive, the implementation will select a + * reasonable value. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is Array of [Finding]{@link google.cloud.websecurityscanner.v1alpha.Finding}. + * 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 `listFindingsAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) + * for more details and examples. + */ + listFindings( + request?: protos.google.cloud.websecurityscanner.v1alpha.IListFindingsRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.websecurityscanner.v1alpha.IFinding[], + protos.google.cloud.websecurityscanner.v1alpha.IListFindingsRequest | null, + protos.google.cloud.websecurityscanner.v1alpha.IListFindingsResponse + ] + >; + listFindings( + request: protos.google.cloud.websecurityscanner.v1alpha.IListFindingsRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.cloud.websecurityscanner.v1alpha.IListFindingsRequest, + | protos.google.cloud.websecurityscanner.v1alpha.IListFindingsResponse + | null + | undefined, + protos.google.cloud.websecurityscanner.v1alpha.IFinding + > + ): void; + listFindings( + request: protos.google.cloud.websecurityscanner.v1alpha.IListFindingsRequest, + callback: PaginationCallback< + protos.google.cloud.websecurityscanner.v1alpha.IListFindingsRequest, + | protos.google.cloud.websecurityscanner.v1alpha.IListFindingsResponse + | null + | undefined, + protos.google.cloud.websecurityscanner.v1alpha.IFinding + > + ): void; + listFindings( + request?: protos.google.cloud.websecurityscanner.v1alpha.IListFindingsRequest, + optionsOrCallback?: + | CallOptions + | PaginationCallback< + protos.google.cloud.websecurityscanner.v1alpha.IListFindingsRequest, + | protos.google.cloud.websecurityscanner.v1alpha.IListFindingsResponse + | null + | undefined, + protos.google.cloud.websecurityscanner.v1alpha.IFinding + >, + callback?: PaginationCallback< + protos.google.cloud.websecurityscanner.v1alpha.IListFindingsRequest, + | protos.google.cloud.websecurityscanner.v1alpha.IListFindingsResponse + | null + | undefined, + protos.google.cloud.websecurityscanner.v1alpha.IFinding + > + ): Promise< + [ + protos.google.cloud.websecurityscanner.v1alpha.IFinding[], + protos.google.cloud.websecurityscanner.v1alpha.IListFindingsRequest | null, + protos.google.cloud.websecurityscanner.v1alpha.IListFindingsResponse + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as 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.listFindings(request, options, callback); + } + + /** + * Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The parent resource name, which should be a scan run resource name in the + * format + * 'projects/{projectId}/scanConfigs/{scanConfigId}/scanRuns/{scanRunId}'. + * @param {string} request.filter + * Required. The filter expression. The expression must be in the format: + * . + * Supported field: 'finding_type'. + * Supported operator: '='. + * @param {string} request.pageToken + * A token identifying a page of results to be returned. This should be a + * `next_page_token` value returned from a previous List request. + * If unspecified, the first page of results is returned. + * @param {number} request.pageSize + * The maximum number of Findings to return, can be limited by server. + * If not specified or not positive, the implementation will select a + * reasonable value. + * @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 [Finding]{@link google.cloud.websecurityscanner.v1alpha.Finding} 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 `listFindingsAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) + * for more details and examples. + */ + listFindingsStream( + request?: protos.google.cloud.websecurityscanner.v1alpha.IListFindingsRequest, + 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['listFindings']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.listFindings.createStream( + this.innerApiCalls.listFindings as GaxCall, + request, + callSettings + ); + } + + /** + * Equivalent to `listFindings`, 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 name, which should be a scan run resource name in the + * format + * 'projects/{projectId}/scanConfigs/{scanConfigId}/scanRuns/{scanRunId}'. + * @param {string} request.filter + * Required. The filter expression. The expression must be in the format: + * . + * Supported field: 'finding_type'. + * Supported operator: '='. + * @param {string} request.pageToken + * A token identifying a page of results to be returned. This should be a + * `next_page_token` value returned from a previous List request. + * If unspecified, the first page of results is returned. + * @param {number} request.pageSize + * The maximum number of Findings to return, can be limited by server. + * If not specified or not positive, the implementation will select a + * reasonable value. + * @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 [async iteration](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols). + * When you iterate the returned iterable, each element will be an object representing + * [Finding]{@link google.cloud.websecurityscanner.v1alpha.Finding}. 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 + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) + * for more details and examples. + * @example include:samples/generated/v1alpha/web_security_scanner.list_findings.js + * region_tag:websecurityscanner_v1alpha_generated_WebSecurityScanner_ListFindings_async + */ + listFindingsAsync( + request?: protos.google.cloud.websecurityscanner.v1alpha.IListFindingsRequest, + 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['listFindings']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.listFindings.asyncIterate( + this.innerApiCalls['listFindings'] as GaxCall, + request as {}, + callSettings + ) as AsyncIterable; + } + // -------------------- + // -- Path templates -- + // -------------------- + + /** + * Return a fully-qualified finding resource name string. + * + * @param {string} project + * @param {string} scan_config + * @param {string} scan_run + * @param {string} finding + * @returns {string} Resource name string. + */ + findingPath( + project: string, + scanConfig: string, + scanRun: string, + finding: string + ) { + return this.pathTemplates.findingPathTemplate.render({ + project: project, + scan_config: scanConfig, + scan_run: scanRun, + finding: finding, + }); + } + + /** + * Parse the project from Finding resource. + * + * @param {string} findingName + * A fully-qualified path representing Finding resource. + * @returns {string} A string representing the project. + */ + matchProjectFromFindingName(findingName: string) { + return this.pathTemplates.findingPathTemplate.match(findingName).project; + } + + /** + * Parse the scan_config from Finding resource. + * + * @param {string} findingName + * A fully-qualified path representing Finding resource. + * @returns {string} A string representing the scan_config. + */ + matchScanConfigFromFindingName(findingName: string) { + return this.pathTemplates.findingPathTemplate.match(findingName) + .scan_config; + } + + /** + * Parse the scan_run from Finding resource. + * + * @param {string} findingName + * A fully-qualified path representing Finding resource. + * @returns {string} A string representing the scan_run. + */ + matchScanRunFromFindingName(findingName: string) { + return this.pathTemplates.findingPathTemplate.match(findingName).scan_run; + } + + /** + * Parse the finding from Finding resource. + * + * @param {string} findingName + * A fully-qualified path representing Finding resource. + * @returns {string} A string representing the finding. + */ + matchFindingFromFindingName(findingName: string) { + return this.pathTemplates.findingPathTemplate.match(findingName).finding; + } + + /** + * 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 scanConfig resource name string. + * + * @param {string} project + * @param {string} scan_config + * @returns {string} Resource name string. + */ + scanConfigPath(project: string, scanConfig: string) { + return this.pathTemplates.scanConfigPathTemplate.render({ + project: project, + scan_config: scanConfig, + }); + } + + /** + * Parse the project from ScanConfig resource. + * + * @param {string} scanConfigName + * A fully-qualified path representing ScanConfig resource. + * @returns {string} A string representing the project. + */ + matchProjectFromScanConfigName(scanConfigName: string) { + return this.pathTemplates.scanConfigPathTemplate.match(scanConfigName) + .project; + } + + /** + * Parse the scan_config from ScanConfig resource. + * + * @param {string} scanConfigName + * A fully-qualified path representing ScanConfig resource. + * @returns {string} A string representing the scan_config. + */ + matchScanConfigFromScanConfigName(scanConfigName: string) { + return this.pathTemplates.scanConfigPathTemplate.match(scanConfigName) + .scan_config; + } + + /** + * Return a fully-qualified scanRun resource name string. + * + * @param {string} project + * @param {string} scan_config + * @param {string} scan_run + * @returns {string} Resource name string. + */ + scanRunPath(project: string, scanConfig: string, scanRun: string) { + return this.pathTemplates.scanRunPathTemplate.render({ + project: project, + scan_config: scanConfig, + scan_run: scanRun, + }); + } + + /** + * Parse the project from ScanRun resource. + * + * @param {string} scanRunName + * A fully-qualified path representing ScanRun resource. + * @returns {string} A string representing the project. + */ + matchProjectFromScanRunName(scanRunName: string) { + return this.pathTemplates.scanRunPathTemplate.match(scanRunName).project; + } + + /** + * Parse the scan_config from ScanRun resource. + * + * @param {string} scanRunName + * A fully-qualified path representing ScanRun resource. + * @returns {string} A string representing the scan_config. + */ + matchScanConfigFromScanRunName(scanRunName: string) { + return this.pathTemplates.scanRunPathTemplate.match(scanRunName) + .scan_config; + } + + /** + * Parse the scan_run from ScanRun resource. + * + * @param {string} scanRunName + * A fully-qualified path representing ScanRun resource. + * @returns {string} A string representing the scan_run. + */ + matchScanRunFromScanRunName(scanRunName: string) { + return this.pathTemplates.scanRunPathTemplate.match(scanRunName).scan_run; + } + + /** + * 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.webSecurityScannerStub && !this._terminated) { + return this.webSecurityScannerStub.then(stub => { + this._terminated = true; + stub.close(); + }); + } + return Promise.resolve(); + } +} diff --git a/packages/google-cloud-websecurityscanner/src/v1alpha/web_security_scanner_client_config.json b/packages/google-cloud-websecurityscanner/src/v1alpha/web_security_scanner_client_config.json new file mode 100644 index 00000000000..288b9b02400 --- /dev/null +++ b/packages/google-cloud-websecurityscanner/src/v1alpha/web_security_scanner_client_config.json @@ -0,0 +1,91 @@ +{ + "interfaces": { + "google.cloud.websecurityscanner.v1alpha.WebSecurityScanner": { + "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": { + "CreateScanConfig": { + "timeout_millis": 600000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "DeleteScanConfig": { + "timeout_millis": 600000, + "retry_codes_name": "idempotent", + "retry_params_name": "default" + }, + "GetScanConfig": { + "timeout_millis": 600000, + "retry_codes_name": "idempotent", + "retry_params_name": "default" + }, + "ListScanConfigs": { + "timeout_millis": 600000, + "retry_codes_name": "idempotent", + "retry_params_name": "default" + }, + "UpdateScanConfig": { + "timeout_millis": 600000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "StartScanRun": { + "timeout_millis": 600000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "GetScanRun": { + "timeout_millis": 600000, + "retry_codes_name": "idempotent", + "retry_params_name": "default" + }, + "ListScanRuns": { + "timeout_millis": 600000, + "retry_codes_name": "idempotent", + "retry_params_name": "default" + }, + "StopScanRun": { + "timeout_millis": 600000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "ListCrawledUrls": { + "timeout_millis": 600000, + "retry_codes_name": "idempotent", + "retry_params_name": "default" + }, + "GetFinding": { + "timeout_millis": 600000, + "retry_codes_name": "idempotent", + "retry_params_name": "default" + }, + "ListFindings": { + "timeout_millis": 600000, + "retry_codes_name": "idempotent", + "retry_params_name": "default" + }, + "ListFindingTypeStats": { + "timeout_millis": 600000, + "retry_codes_name": "idempotent", + "retry_params_name": "default" + } + } + } + } +} diff --git a/packages/google-cloud-websecurityscanner/src/v1alpha/web_security_scanner_proto_list.json b/packages/google-cloud-websecurityscanner/src/v1alpha/web_security_scanner_proto_list.json new file mode 100644 index 00000000000..1696775c642 --- /dev/null +++ b/packages/google-cloud-websecurityscanner/src/v1alpha/web_security_scanner_proto_list.json @@ -0,0 +1,9 @@ +[ + "../../protos/google/cloud/websecurityscanner/v1alpha/crawled_url.proto", + "../../protos/google/cloud/websecurityscanner/v1alpha/finding.proto", + "../../protos/google/cloud/websecurityscanner/v1alpha/finding_addon.proto", + "../../protos/google/cloud/websecurityscanner/v1alpha/finding_type_stats.proto", + "../../protos/google/cloud/websecurityscanner/v1alpha/scan_config.proto", + "../../protos/google/cloud/websecurityscanner/v1alpha/scan_run.proto", + "../../protos/google/cloud/websecurityscanner/v1alpha/web_security_scanner.proto" +] diff --git a/packages/google-cloud-websecurityscanner/src/v1beta/gapic_metadata.json b/packages/google-cloud-websecurityscanner/src/v1beta/gapic_metadata.json new file mode 100644 index 00000000000..c531caa029b --- /dev/null +++ b/packages/google-cloud-websecurityscanner/src/v1beta/gapic_metadata.json @@ -0,0 +1,169 @@ +{ + "schema": "1.0", + "comment": "This file maps proto services/RPCs to the corresponding library clients/methods", + "language": "typescript", + "protoPackage": "google.cloud.websecurityscanner.v1beta", + "libraryPackage": "@google-cloud/web-security-scanner", + "services": { + "WebSecurityScanner": { + "clients": { + "grpc": { + "libraryClient": "WebSecurityScannerClient", + "rpcs": { + "CreateScanConfig": { + "methods": [ + "createScanConfig" + ] + }, + "DeleteScanConfig": { + "methods": [ + "deleteScanConfig" + ] + }, + "GetScanConfig": { + "methods": [ + "getScanConfig" + ] + }, + "UpdateScanConfig": { + "methods": [ + "updateScanConfig" + ] + }, + "StartScanRun": { + "methods": [ + "startScanRun" + ] + }, + "GetScanRun": { + "methods": [ + "getScanRun" + ] + }, + "StopScanRun": { + "methods": [ + "stopScanRun" + ] + }, + "GetFinding": { + "methods": [ + "getFinding" + ] + }, + "ListFindingTypeStats": { + "methods": [ + "listFindingTypeStats" + ] + }, + "ListScanConfigs": { + "methods": [ + "listScanConfigs", + "listScanConfigsStream", + "listScanConfigsAsync" + ] + }, + "ListScanRuns": { + "methods": [ + "listScanRuns", + "listScanRunsStream", + "listScanRunsAsync" + ] + }, + "ListCrawledUrls": { + "methods": [ + "listCrawledUrls", + "listCrawledUrlsStream", + "listCrawledUrlsAsync" + ] + }, + "ListFindings": { + "methods": [ + "listFindings", + "listFindingsStream", + "listFindingsAsync" + ] + } + } + }, + "grpc-fallback": { + "libraryClient": "WebSecurityScannerClient", + "rpcs": { + "CreateScanConfig": { + "methods": [ + "createScanConfig" + ] + }, + "DeleteScanConfig": { + "methods": [ + "deleteScanConfig" + ] + }, + "GetScanConfig": { + "methods": [ + "getScanConfig" + ] + }, + "UpdateScanConfig": { + "methods": [ + "updateScanConfig" + ] + }, + "StartScanRun": { + "methods": [ + "startScanRun" + ] + }, + "GetScanRun": { + "methods": [ + "getScanRun" + ] + }, + "StopScanRun": { + "methods": [ + "stopScanRun" + ] + }, + "GetFinding": { + "methods": [ + "getFinding" + ] + }, + "ListFindingTypeStats": { + "methods": [ + "listFindingTypeStats" + ] + }, + "ListScanConfigs": { + "methods": [ + "listScanConfigs", + "listScanConfigsStream", + "listScanConfigsAsync" + ] + }, + "ListScanRuns": { + "methods": [ + "listScanRuns", + "listScanRunsStream", + "listScanRunsAsync" + ] + }, + "ListCrawledUrls": { + "methods": [ + "listCrawledUrls", + "listCrawledUrlsStream", + "listCrawledUrlsAsync" + ] + }, + "ListFindings": { + "methods": [ + "listFindings", + "listFindingsStream", + "listFindingsAsync" + ] + } + } + } + } + } + } +} diff --git a/packages/google-cloud-websecurityscanner/src/v1beta/index.ts b/packages/google-cloud-websecurityscanner/src/v1beta/index.ts new file mode 100644 index 00000000000..515d3366d8a --- /dev/null +++ b/packages/google-cloud-websecurityscanner/src/v1beta/index.ts @@ -0,0 +1,19 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** 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 {WebSecurityScannerClient} from './web_security_scanner_client'; diff --git a/packages/google-cloud-websecurityscanner/src/v1beta/web_security_scanner_client.ts b/packages/google-cloud-websecurityscanner/src/v1beta/web_security_scanner_client.ts new file mode 100644 index 00000000000..f5b0c6da12e --- /dev/null +++ b/packages/google-cloud-websecurityscanner/src/v1beta/web_security_scanner_client.ts @@ -0,0 +1,2297 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + +/* global window */ +import type * as gax from 'google-gax'; +import type { + Callback, + CallOptions, + Descriptors, + ClientOptions, + PaginationCallback, + GaxCall, +} from 'google-gax'; +import {Transform} from 'stream'; +import * as protos from '../../protos/protos'; +import jsonProtos = require('../../protos/protos.json'); +/** + * Client JSON configuration object, loaded from + * `src/v1beta/web_security_scanner_client_config.json`. + * This file defines retry strategy and timeouts for all API methods in this library. + */ +import * as gapicConfig from './web_security_scanner_client_config.json'; +const version = require('../../../package.json').version; + +/** + * Cloud Web Security Scanner Service identifies security vulnerabilities in web + * applications hosted on Google Cloud Platform. It crawls your application, and + * attempts to exercise as many user inputs and event handlers as possible. + * @class + * @memberof v1beta + */ +export class WebSecurityScannerClient { + private _terminated = false; + private _opts: ClientOptions; + private _providedCustomServicePath: boolean; + private _gaxModule: typeof gax | typeof gax.fallback; + private _gaxGrpc: gax.GrpcClient | gax.fallback.GrpcClient; + private _protos: {}; + private _defaults: {[method: string]: gax.CallSettings}; + auth: gax.GoogleAuth; + descriptors: Descriptors = { + page: {}, + stream: {}, + longrunning: {}, + batching: {}, + }; + warn: (code: string, message: string, warnType?: string) => void; + innerApiCalls: {[name: string]: Function}; + pathTemplates: {[name: string]: gax.PathTemplate}; + webSecurityScannerStub?: Promise<{[name: string]: Function}>; + + /** + * Construct an instance of WebSecurityScannerClient. + * + * @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 | "rest"} [options.fallback] - Use HTTP fallback mode. + * Pass "rest" to use HTTP/1.1 REST API instead of gRPC. + * 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 WebSecurityScannerClient({fallback: 'rest'}, gax); + * ``` + */ + constructor( + opts?: ClientOptions, + gaxInstance?: typeof gax | typeof gax.fallback + ) { + // Ensure that options include all the required fields. + const staticMembers = this.constructor as typeof WebSecurityScannerClient; + const servicePath = + opts?.servicePath || opts?.apiEndpoint || staticMembers.servicePath; + this._providedCustomServicePath = !!( + opts?.servicePath || opts?.apiEndpoint + ); + const port = opts?.port || staticMembers.port; + const clientConfig = opts?.clientConfig ?? {}; + const fallback = + opts?.fallback ?? + (typeof window !== 'undefined' && typeof window?.fetch === 'function'); + opts = Object.assign({servicePath, port, clientConfig, fallback}, opts); + + // If scopes are unset in options and we're connecting to a non-default endpoint, set scopes just in case. + if (servicePath !== staticMembers.servicePath && !('scopes' in opts)) { + opts['scopes'] = staticMembers.scopes; + } + + // Load google-gax module synchronously if needed + if (!gaxInstance) { + gaxInstance = require('google-gax') as typeof gax; + } + + // Choose either gRPC or proto-over-HTTP implementation of google-gax. + this._gaxModule = opts.fallback ? gaxInstance.fallback : gaxInstance; + + // Create a `gaxGrpc` object, with any grpc-specific options sent to the client. + this._gaxGrpc = new this._gaxModule.GrpcClient(opts); + + // Save options to use in initialize() method. + this._opts = opts; + + // Save the auth object to the client, for use by other methods. + this.auth = this._gaxGrpc.auth as gax.GoogleAuth; + + // Set useJWTAccessWithScope on the auth object. + this.auth.useJWTAccessWithScope = true; + + // Set defaultServicePath on the auth object. + this.auth.defaultServicePath = staticMembers.servicePath; + + // Set the default scopes in auth client if needed. + if (servicePath === staticMembers.servicePath) { + this.auth.defaultScopes = staticMembers.scopes; + } + + // Determine the client header string. + const clientHeader = [`gax/${this._gaxModule.version}`, `gapic/${version}`]; + if (typeof process !== 'undefined' && 'versions' in process) { + clientHeader.push(`gl-node/${process.versions.node}`); + } else { + clientHeader.push(`gl-web/${this._gaxModule.version}`); + } + if (!opts.fallback) { + clientHeader.push(`grpc/${this._gaxGrpc.grpcVersion}`); + } else if (opts.fallback === 'rest') { + 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 = { + findingPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/scanConfigs/{scan_config}/scanRuns/{scan_run}/findings/{finding}' + ), + projectPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}' + ), + scanConfigPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/scanConfigs/{scan_config}' + ), + scanRunPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/scanConfigs/{scan_config}/scanRuns/{scan_run}' + ), + }; + + // 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 = { + listScanConfigs: new this._gaxModule.PageDescriptor( + 'pageToken', + 'nextPageToken', + 'scanConfigs' + ), + listScanRuns: new this._gaxModule.PageDescriptor( + 'pageToken', + 'nextPageToken', + 'scanRuns' + ), + listCrawledUrls: new this._gaxModule.PageDescriptor( + 'pageToken', + 'nextPageToken', + 'crawledUrls' + ), + listFindings: new this._gaxModule.PageDescriptor( + 'pageToken', + 'nextPageToken', + 'findings' + ), + }; + + // Put together the default options sent with requests. + this._defaults = this._gaxGrpc.constructSettings( + 'google.cloud.websecurityscanner.v1beta.WebSecurityScanner', + 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.webSecurityScannerStub) { + return this.webSecurityScannerStub; + } + + // Put together the "service stub" for + // google.cloud.websecurityscanner.v1beta.WebSecurityScanner. + this.webSecurityScannerStub = this._gaxGrpc.createStub( + this._opts.fallback + ? (this._protos as protobuf.Root).lookupService( + 'google.cloud.websecurityscanner.v1beta.WebSecurityScanner' + ) + : // eslint-disable-next-line @typescript-eslint/no-explicit-any + (this._protos as any).google.cloud.websecurityscanner.v1beta + .WebSecurityScanner, + 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 webSecurityScannerStubMethods = [ + 'createScanConfig', + 'deleteScanConfig', + 'getScanConfig', + 'listScanConfigs', + 'updateScanConfig', + 'startScanRun', + 'getScanRun', + 'listScanRuns', + 'stopScanRun', + 'listCrawledUrls', + 'getFinding', + 'listFindings', + 'listFindingTypeStats', + ]; + for (const methodName of webSecurityScannerStubMethods) { + const callPromise = this.webSecurityScannerStub.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.webSecurityScannerStub; + } + + /** + * The DNS address for this API service. + * @returns {string} The DNS address for this service. + */ + static get servicePath() { + return 'websecurityscanner.googleapis.com'; + } + + /** + * The DNS address for this API service - same as servicePath(), + * exists for compatibility reasons. + * @returns {string} The DNS address for this service. + */ + static get apiEndpoint() { + return 'websecurityscanner.googleapis.com'; + } + + /** + * The port for this API service. + * @returns {number} The default port for this service. + */ + static get port() { + return 443; + } + + /** + * The scopes needed to make gRPC calls for every method defined + * in this service. + * @returns {string[]} List of default scopes. + */ + static get scopes() { + return ['https://www.googleapis.com/auth/cloud-platform']; + } + + getProjectId(): Promise; + getProjectId(callback: Callback): void; + /** + * Return the project ID used by this class. + * @returns {Promise} A promise that resolves to string containing the project ID. + */ + getProjectId( + callback?: Callback + ): Promise | void { + if (callback) { + this.auth.getProjectId(callback); + return; + } + return this.auth.getProjectId(); + } + + // ------------------- + // -- Service calls -- + // ------------------- + /** + * Creates a new ScanConfig. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The parent resource name where the scan is created, which should be a + * project resource name in the format 'projects/{projectId}'. + * @param {google.cloud.websecurityscanner.v1beta.ScanConfig} request.scanConfig + * Required. The ScanConfig 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 [ScanConfig]{@link google.cloud.websecurityscanner.v1beta.ScanConfig}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example include:samples/generated/v1beta/web_security_scanner.create_scan_config.js + * region_tag:websecurityscanner_v1beta_generated_WebSecurityScanner_CreateScanConfig_async + */ + createScanConfig( + request?: protos.google.cloud.websecurityscanner.v1beta.ICreateScanConfigRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.websecurityscanner.v1beta.IScanConfig, + ( + | protos.google.cloud.websecurityscanner.v1beta.ICreateScanConfigRequest + | undefined + ), + {} | undefined + ] + >; + createScanConfig( + request: protos.google.cloud.websecurityscanner.v1beta.ICreateScanConfigRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.websecurityscanner.v1beta.IScanConfig, + | protos.google.cloud.websecurityscanner.v1beta.ICreateScanConfigRequest + | null + | undefined, + {} | null | undefined + > + ): void; + createScanConfig( + request: protos.google.cloud.websecurityscanner.v1beta.ICreateScanConfigRequest, + callback: Callback< + protos.google.cloud.websecurityscanner.v1beta.IScanConfig, + | protos.google.cloud.websecurityscanner.v1beta.ICreateScanConfigRequest + | null + | undefined, + {} | null | undefined + > + ): void; + createScanConfig( + request?: protos.google.cloud.websecurityscanner.v1beta.ICreateScanConfigRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.websecurityscanner.v1beta.IScanConfig, + | protos.google.cloud.websecurityscanner.v1beta.ICreateScanConfigRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.websecurityscanner.v1beta.IScanConfig, + | protos.google.cloud.websecurityscanner.v1beta.ICreateScanConfigRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.websecurityscanner.v1beta.IScanConfig, + ( + | protos.google.cloud.websecurityscanner.v1beta.ICreateScanConfigRequest + | undefined + ), + {} | undefined + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as 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.createScanConfig(request, options, callback); + } + /** + * Deletes an existing ScanConfig and its child resources. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The resource name of the ScanConfig to be deleted. The name follows the + * format of 'projects/{projectId}/scanConfigs/{scanConfigId}'. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [Empty]{@link google.protobuf.Empty}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example include:samples/generated/v1beta/web_security_scanner.delete_scan_config.js + * region_tag:websecurityscanner_v1beta_generated_WebSecurityScanner_DeleteScanConfig_async + */ + deleteScanConfig( + request?: protos.google.cloud.websecurityscanner.v1beta.IDeleteScanConfigRequest, + options?: CallOptions + ): Promise< + [ + protos.google.protobuf.IEmpty, + ( + | protos.google.cloud.websecurityscanner.v1beta.IDeleteScanConfigRequest + | undefined + ), + {} | undefined + ] + >; + deleteScanConfig( + request: protos.google.cloud.websecurityscanner.v1beta.IDeleteScanConfigRequest, + options: CallOptions, + callback: Callback< + protos.google.protobuf.IEmpty, + | protos.google.cloud.websecurityscanner.v1beta.IDeleteScanConfigRequest + | null + | undefined, + {} | null | undefined + > + ): void; + deleteScanConfig( + request: protos.google.cloud.websecurityscanner.v1beta.IDeleteScanConfigRequest, + callback: Callback< + protos.google.protobuf.IEmpty, + | protos.google.cloud.websecurityscanner.v1beta.IDeleteScanConfigRequest + | null + | undefined, + {} | null | undefined + > + ): void; + deleteScanConfig( + request?: protos.google.cloud.websecurityscanner.v1beta.IDeleteScanConfigRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.protobuf.IEmpty, + | protos.google.cloud.websecurityscanner.v1beta.IDeleteScanConfigRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.protobuf.IEmpty, + | protos.google.cloud.websecurityscanner.v1beta.IDeleteScanConfigRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.protobuf.IEmpty, + ( + | protos.google.cloud.websecurityscanner.v1beta.IDeleteScanConfigRequest + | undefined + ), + {} | undefined + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + 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.deleteScanConfig(request, options, callback); + } + /** + * Gets a ScanConfig. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The resource name of the ScanConfig to be returned. The name follows the + * format of 'projects/{projectId}/scanConfigs/{scanConfigId}'. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [ScanConfig]{@link google.cloud.websecurityscanner.v1beta.ScanConfig}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example include:samples/generated/v1beta/web_security_scanner.get_scan_config.js + * region_tag:websecurityscanner_v1beta_generated_WebSecurityScanner_GetScanConfig_async + */ + getScanConfig( + request?: protos.google.cloud.websecurityscanner.v1beta.IGetScanConfigRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.websecurityscanner.v1beta.IScanConfig, + ( + | protos.google.cloud.websecurityscanner.v1beta.IGetScanConfigRequest + | undefined + ), + {} | undefined + ] + >; + getScanConfig( + request: protos.google.cloud.websecurityscanner.v1beta.IGetScanConfigRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.websecurityscanner.v1beta.IScanConfig, + | protos.google.cloud.websecurityscanner.v1beta.IGetScanConfigRequest + | null + | undefined, + {} | null | undefined + > + ): void; + getScanConfig( + request: protos.google.cloud.websecurityscanner.v1beta.IGetScanConfigRequest, + callback: Callback< + protos.google.cloud.websecurityscanner.v1beta.IScanConfig, + | protos.google.cloud.websecurityscanner.v1beta.IGetScanConfigRequest + | null + | undefined, + {} | null | undefined + > + ): void; + getScanConfig( + request?: protos.google.cloud.websecurityscanner.v1beta.IGetScanConfigRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.websecurityscanner.v1beta.IScanConfig, + | protos.google.cloud.websecurityscanner.v1beta.IGetScanConfigRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.websecurityscanner.v1beta.IScanConfig, + | protos.google.cloud.websecurityscanner.v1beta.IGetScanConfigRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.websecurityscanner.v1beta.IScanConfig, + ( + | protos.google.cloud.websecurityscanner.v1beta.IGetScanConfigRequest + | undefined + ), + {} | undefined + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + 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.getScanConfig(request, options, callback); + } + /** + * Updates a ScanConfig. This method support partial update of a ScanConfig. + * + * @param {Object} request + * The request object that will be sent. + * @param {google.cloud.websecurityscanner.v1beta.ScanConfig} request.scanConfig + * Required. The ScanConfig to be updated. The name field must be set to identify the + * resource to be updated. The values of fields not covered by the mask + * will be ignored. + * @param {google.protobuf.FieldMask} request.updateMask + * Required. The update mask applies to the resource. For the `FieldMask` definition, + * see + * https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#fieldmask + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [ScanConfig]{@link google.cloud.websecurityscanner.v1beta.ScanConfig}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example include:samples/generated/v1beta/web_security_scanner.update_scan_config.js + * region_tag:websecurityscanner_v1beta_generated_WebSecurityScanner_UpdateScanConfig_async + */ + updateScanConfig( + request?: protos.google.cloud.websecurityscanner.v1beta.IUpdateScanConfigRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.websecurityscanner.v1beta.IScanConfig, + ( + | protos.google.cloud.websecurityscanner.v1beta.IUpdateScanConfigRequest + | undefined + ), + {} | undefined + ] + >; + updateScanConfig( + request: protos.google.cloud.websecurityscanner.v1beta.IUpdateScanConfigRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.websecurityscanner.v1beta.IScanConfig, + | protos.google.cloud.websecurityscanner.v1beta.IUpdateScanConfigRequest + | null + | undefined, + {} | null | undefined + > + ): void; + updateScanConfig( + request: protos.google.cloud.websecurityscanner.v1beta.IUpdateScanConfigRequest, + callback: Callback< + protos.google.cloud.websecurityscanner.v1beta.IScanConfig, + | protos.google.cloud.websecurityscanner.v1beta.IUpdateScanConfigRequest + | null + | undefined, + {} | null | undefined + > + ): void; + updateScanConfig( + request?: protos.google.cloud.websecurityscanner.v1beta.IUpdateScanConfigRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.websecurityscanner.v1beta.IScanConfig, + | protos.google.cloud.websecurityscanner.v1beta.IUpdateScanConfigRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.websecurityscanner.v1beta.IScanConfig, + | protos.google.cloud.websecurityscanner.v1beta.IUpdateScanConfigRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.websecurityscanner.v1beta.IScanConfig, + ( + | protos.google.cloud.websecurityscanner.v1beta.IUpdateScanConfigRequest + | undefined + ), + {} | undefined + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + 'scan_config.name': request.scanConfig!.name ?? '', + }); + this.initialize(); + return this.innerApiCalls.updateScanConfig(request, options, callback); + } + /** + * Start a ScanRun according to the given ScanConfig. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The resource name of the ScanConfig to be used. The name follows the + * format of 'projects/{projectId}/scanConfigs/{scanConfigId}'. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [ScanRun]{@link google.cloud.websecurityscanner.v1beta.ScanRun}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example include:samples/generated/v1beta/web_security_scanner.start_scan_run.js + * region_tag:websecurityscanner_v1beta_generated_WebSecurityScanner_StartScanRun_async + */ + startScanRun( + request?: protos.google.cloud.websecurityscanner.v1beta.IStartScanRunRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.websecurityscanner.v1beta.IScanRun, + ( + | protos.google.cloud.websecurityscanner.v1beta.IStartScanRunRequest + | undefined + ), + {} | undefined + ] + >; + startScanRun( + request: protos.google.cloud.websecurityscanner.v1beta.IStartScanRunRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.websecurityscanner.v1beta.IScanRun, + | protos.google.cloud.websecurityscanner.v1beta.IStartScanRunRequest + | null + | undefined, + {} | null | undefined + > + ): void; + startScanRun( + request: protos.google.cloud.websecurityscanner.v1beta.IStartScanRunRequest, + callback: Callback< + protos.google.cloud.websecurityscanner.v1beta.IScanRun, + | protos.google.cloud.websecurityscanner.v1beta.IStartScanRunRequest + | null + | undefined, + {} | null | undefined + > + ): void; + startScanRun( + request?: protos.google.cloud.websecurityscanner.v1beta.IStartScanRunRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.websecurityscanner.v1beta.IScanRun, + | protos.google.cloud.websecurityscanner.v1beta.IStartScanRunRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.websecurityscanner.v1beta.IScanRun, + | protos.google.cloud.websecurityscanner.v1beta.IStartScanRunRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.websecurityscanner.v1beta.IScanRun, + ( + | protos.google.cloud.websecurityscanner.v1beta.IStartScanRunRequest + | undefined + ), + {} | undefined + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + 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.startScanRun(request, options, callback); + } + /** + * Gets a ScanRun. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The resource name of the ScanRun to be returned. The name follows the + * format of + * 'projects/{projectId}/scanConfigs/{scanConfigId}/scanRuns/{scanRunId}'. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [ScanRun]{@link google.cloud.websecurityscanner.v1beta.ScanRun}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example include:samples/generated/v1beta/web_security_scanner.get_scan_run.js + * region_tag:websecurityscanner_v1beta_generated_WebSecurityScanner_GetScanRun_async + */ + getScanRun( + request?: protos.google.cloud.websecurityscanner.v1beta.IGetScanRunRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.websecurityscanner.v1beta.IScanRun, + ( + | protos.google.cloud.websecurityscanner.v1beta.IGetScanRunRequest + | undefined + ), + {} | undefined + ] + >; + getScanRun( + request: protos.google.cloud.websecurityscanner.v1beta.IGetScanRunRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.websecurityscanner.v1beta.IScanRun, + | protos.google.cloud.websecurityscanner.v1beta.IGetScanRunRequest + | null + | undefined, + {} | null | undefined + > + ): void; + getScanRun( + request: protos.google.cloud.websecurityscanner.v1beta.IGetScanRunRequest, + callback: Callback< + protos.google.cloud.websecurityscanner.v1beta.IScanRun, + | protos.google.cloud.websecurityscanner.v1beta.IGetScanRunRequest + | null + | undefined, + {} | null | undefined + > + ): void; + getScanRun( + request?: protos.google.cloud.websecurityscanner.v1beta.IGetScanRunRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.websecurityscanner.v1beta.IScanRun, + | protos.google.cloud.websecurityscanner.v1beta.IGetScanRunRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.websecurityscanner.v1beta.IScanRun, + | protos.google.cloud.websecurityscanner.v1beta.IGetScanRunRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.websecurityscanner.v1beta.IScanRun, + ( + | protos.google.cloud.websecurityscanner.v1beta.IGetScanRunRequest + | undefined + ), + {} | undefined + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + 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.getScanRun(request, options, callback); + } + /** + * Stops a ScanRun. The stopped ScanRun is returned. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The resource name of the ScanRun to be stopped. The name follows the + * format of + * 'projects/{projectId}/scanConfigs/{scanConfigId}/scanRuns/{scanRunId}'. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [ScanRun]{@link google.cloud.websecurityscanner.v1beta.ScanRun}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example include:samples/generated/v1beta/web_security_scanner.stop_scan_run.js + * region_tag:websecurityscanner_v1beta_generated_WebSecurityScanner_StopScanRun_async + */ + stopScanRun( + request?: protos.google.cloud.websecurityscanner.v1beta.IStopScanRunRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.websecurityscanner.v1beta.IScanRun, + ( + | protos.google.cloud.websecurityscanner.v1beta.IStopScanRunRequest + | undefined + ), + {} | undefined + ] + >; + stopScanRun( + request: protos.google.cloud.websecurityscanner.v1beta.IStopScanRunRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.websecurityscanner.v1beta.IScanRun, + | protos.google.cloud.websecurityscanner.v1beta.IStopScanRunRequest + | null + | undefined, + {} | null | undefined + > + ): void; + stopScanRun( + request: protos.google.cloud.websecurityscanner.v1beta.IStopScanRunRequest, + callback: Callback< + protos.google.cloud.websecurityscanner.v1beta.IScanRun, + | protos.google.cloud.websecurityscanner.v1beta.IStopScanRunRequest + | null + | undefined, + {} | null | undefined + > + ): void; + stopScanRun( + request?: protos.google.cloud.websecurityscanner.v1beta.IStopScanRunRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.websecurityscanner.v1beta.IScanRun, + | protos.google.cloud.websecurityscanner.v1beta.IStopScanRunRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.websecurityscanner.v1beta.IScanRun, + | protos.google.cloud.websecurityscanner.v1beta.IStopScanRunRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.websecurityscanner.v1beta.IScanRun, + ( + | protos.google.cloud.websecurityscanner.v1beta.IStopScanRunRequest + | undefined + ), + {} | undefined + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + 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.stopScanRun(request, options, callback); + } + /** + * Gets a Finding. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The resource name of the Finding to be returned. The name follows the + * format of + * 'projects/{projectId}/scanConfigs/{scanConfigId}/scanRuns/{scanRunId}/findings/{findingId}'. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [Finding]{@link google.cloud.websecurityscanner.v1beta.Finding}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example include:samples/generated/v1beta/web_security_scanner.get_finding.js + * region_tag:websecurityscanner_v1beta_generated_WebSecurityScanner_GetFinding_async + */ + getFinding( + request?: protos.google.cloud.websecurityscanner.v1beta.IGetFindingRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.websecurityscanner.v1beta.IFinding, + ( + | protos.google.cloud.websecurityscanner.v1beta.IGetFindingRequest + | undefined + ), + {} | undefined + ] + >; + getFinding( + request: protos.google.cloud.websecurityscanner.v1beta.IGetFindingRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.websecurityscanner.v1beta.IFinding, + | protos.google.cloud.websecurityscanner.v1beta.IGetFindingRequest + | null + | undefined, + {} | null | undefined + > + ): void; + getFinding( + request: protos.google.cloud.websecurityscanner.v1beta.IGetFindingRequest, + callback: Callback< + protos.google.cloud.websecurityscanner.v1beta.IFinding, + | protos.google.cloud.websecurityscanner.v1beta.IGetFindingRequest + | null + | undefined, + {} | null | undefined + > + ): void; + getFinding( + request?: protos.google.cloud.websecurityscanner.v1beta.IGetFindingRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.websecurityscanner.v1beta.IFinding, + | protos.google.cloud.websecurityscanner.v1beta.IGetFindingRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.websecurityscanner.v1beta.IFinding, + | protos.google.cloud.websecurityscanner.v1beta.IGetFindingRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.websecurityscanner.v1beta.IFinding, + ( + | protos.google.cloud.websecurityscanner.v1beta.IGetFindingRequest + | undefined + ), + {} | undefined + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + 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.getFinding(request, options, callback); + } + /** + * List all FindingTypeStats under a given ScanRun. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The parent resource name, which should be a scan run resource name in the + * format + * 'projects/{projectId}/scanConfigs/{scanConfigId}/scanRuns/{scanRunId}'. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [ListFindingTypeStatsResponse]{@link google.cloud.websecurityscanner.v1beta.ListFindingTypeStatsResponse}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example include:samples/generated/v1beta/web_security_scanner.list_finding_type_stats.js + * region_tag:websecurityscanner_v1beta_generated_WebSecurityScanner_ListFindingTypeStats_async + */ + listFindingTypeStats( + request?: protos.google.cloud.websecurityscanner.v1beta.IListFindingTypeStatsRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.websecurityscanner.v1beta.IListFindingTypeStatsResponse, + ( + | protos.google.cloud.websecurityscanner.v1beta.IListFindingTypeStatsRequest + | undefined + ), + {} | undefined + ] + >; + listFindingTypeStats( + request: protos.google.cloud.websecurityscanner.v1beta.IListFindingTypeStatsRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.websecurityscanner.v1beta.IListFindingTypeStatsResponse, + | protos.google.cloud.websecurityscanner.v1beta.IListFindingTypeStatsRequest + | null + | undefined, + {} | null | undefined + > + ): void; + listFindingTypeStats( + request: protos.google.cloud.websecurityscanner.v1beta.IListFindingTypeStatsRequest, + callback: Callback< + protos.google.cloud.websecurityscanner.v1beta.IListFindingTypeStatsResponse, + | protos.google.cloud.websecurityscanner.v1beta.IListFindingTypeStatsRequest + | null + | undefined, + {} | null | undefined + > + ): void; + listFindingTypeStats( + request?: protos.google.cloud.websecurityscanner.v1beta.IListFindingTypeStatsRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.websecurityscanner.v1beta.IListFindingTypeStatsResponse, + | protos.google.cloud.websecurityscanner.v1beta.IListFindingTypeStatsRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.websecurityscanner.v1beta.IListFindingTypeStatsResponse, + | protos.google.cloud.websecurityscanner.v1beta.IListFindingTypeStatsRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.websecurityscanner.v1beta.IListFindingTypeStatsResponse, + ( + | protos.google.cloud.websecurityscanner.v1beta.IListFindingTypeStatsRequest + | undefined + ), + {} | undefined + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as 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.listFindingTypeStats(request, options, callback); + } + + /** + * Lists ScanConfigs under a given project. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The parent resource name, which should be a project resource name in the + * format 'projects/{projectId}'. + * @param {string} request.pageToken + * A token identifying a page of results to be returned. This should be a + * `next_page_token` value returned from a previous List request. + * If unspecified, the first page of results is returned. + * @param {number} request.pageSize + * The maximum number of ScanConfigs to return, can be limited by server. + * If not specified or not positive, the implementation will select a + * reasonable value. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is Array of [ScanConfig]{@link google.cloud.websecurityscanner.v1beta.ScanConfig}. + * 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 `listScanConfigsAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) + * for more details and examples. + */ + listScanConfigs( + request?: protos.google.cloud.websecurityscanner.v1beta.IListScanConfigsRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.websecurityscanner.v1beta.IScanConfig[], + protos.google.cloud.websecurityscanner.v1beta.IListScanConfigsRequest | null, + protos.google.cloud.websecurityscanner.v1beta.IListScanConfigsResponse + ] + >; + listScanConfigs( + request: protos.google.cloud.websecurityscanner.v1beta.IListScanConfigsRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.cloud.websecurityscanner.v1beta.IListScanConfigsRequest, + | protos.google.cloud.websecurityscanner.v1beta.IListScanConfigsResponse + | null + | undefined, + protos.google.cloud.websecurityscanner.v1beta.IScanConfig + > + ): void; + listScanConfigs( + request: protos.google.cloud.websecurityscanner.v1beta.IListScanConfigsRequest, + callback: PaginationCallback< + protos.google.cloud.websecurityscanner.v1beta.IListScanConfigsRequest, + | protos.google.cloud.websecurityscanner.v1beta.IListScanConfigsResponse + | null + | undefined, + protos.google.cloud.websecurityscanner.v1beta.IScanConfig + > + ): void; + listScanConfigs( + request?: protos.google.cloud.websecurityscanner.v1beta.IListScanConfigsRequest, + optionsOrCallback?: + | CallOptions + | PaginationCallback< + protos.google.cloud.websecurityscanner.v1beta.IListScanConfigsRequest, + | protos.google.cloud.websecurityscanner.v1beta.IListScanConfigsResponse + | null + | undefined, + protos.google.cloud.websecurityscanner.v1beta.IScanConfig + >, + callback?: PaginationCallback< + protos.google.cloud.websecurityscanner.v1beta.IListScanConfigsRequest, + | protos.google.cloud.websecurityscanner.v1beta.IListScanConfigsResponse + | null + | undefined, + protos.google.cloud.websecurityscanner.v1beta.IScanConfig + > + ): Promise< + [ + protos.google.cloud.websecurityscanner.v1beta.IScanConfig[], + protos.google.cloud.websecurityscanner.v1beta.IListScanConfigsRequest | null, + protos.google.cloud.websecurityscanner.v1beta.IListScanConfigsResponse + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as 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.listScanConfigs(request, options, callback); + } + + /** + * Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The parent resource name, which should be a project resource name in the + * format 'projects/{projectId}'. + * @param {string} request.pageToken + * A token identifying a page of results to be returned. This should be a + * `next_page_token` value returned from a previous List request. + * If unspecified, the first page of results is returned. + * @param {number} request.pageSize + * The maximum number of ScanConfigs to return, can be limited by server. + * If not specified or not positive, the implementation will select a + * reasonable value. + * @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 [ScanConfig]{@link google.cloud.websecurityscanner.v1beta.ScanConfig} 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 `listScanConfigsAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) + * for more details and examples. + */ + listScanConfigsStream( + request?: protos.google.cloud.websecurityscanner.v1beta.IListScanConfigsRequest, + 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['listScanConfigs']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.listScanConfigs.createStream( + this.innerApiCalls.listScanConfigs as GaxCall, + request, + callSettings + ); + } + + /** + * Equivalent to `listScanConfigs`, 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 name, which should be a project resource name in the + * format 'projects/{projectId}'. + * @param {string} request.pageToken + * A token identifying a page of results to be returned. This should be a + * `next_page_token` value returned from a previous List request. + * If unspecified, the first page of results is returned. + * @param {number} request.pageSize + * The maximum number of ScanConfigs to return, can be limited by server. + * If not specified or not positive, the implementation will select a + * reasonable value. + * @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 [async iteration](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols). + * When you iterate the returned iterable, each element will be an object representing + * [ScanConfig]{@link google.cloud.websecurityscanner.v1beta.ScanConfig}. 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 + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) + * for more details and examples. + * @example include:samples/generated/v1beta/web_security_scanner.list_scan_configs.js + * region_tag:websecurityscanner_v1beta_generated_WebSecurityScanner_ListScanConfigs_async + */ + listScanConfigsAsync( + request?: protos.google.cloud.websecurityscanner.v1beta.IListScanConfigsRequest, + 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['listScanConfigs']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.listScanConfigs.asyncIterate( + this.innerApiCalls['listScanConfigs'] as GaxCall, + request as {}, + callSettings + ) as AsyncIterable; + } + /** + * Lists ScanRuns under a given ScanConfig, in descending order of ScanRun + * stop time. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The parent resource name, which should be a scan resource name in the + * format 'projects/{projectId}/scanConfigs/{scanConfigId}'. + * @param {string} request.pageToken + * A token identifying a page of results to be returned. This should be a + * `next_page_token` value returned from a previous List request. + * If unspecified, the first page of results is returned. + * @param {number} request.pageSize + * The maximum number of ScanRuns to return, can be limited by server. + * If not specified or not positive, the implementation will select a + * reasonable value. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is Array of [ScanRun]{@link google.cloud.websecurityscanner.v1beta.ScanRun}. + * 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 `listScanRunsAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) + * for more details and examples. + */ + listScanRuns( + request?: protos.google.cloud.websecurityscanner.v1beta.IListScanRunsRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.websecurityscanner.v1beta.IScanRun[], + protos.google.cloud.websecurityscanner.v1beta.IListScanRunsRequest | null, + protos.google.cloud.websecurityscanner.v1beta.IListScanRunsResponse + ] + >; + listScanRuns( + request: protos.google.cloud.websecurityscanner.v1beta.IListScanRunsRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.cloud.websecurityscanner.v1beta.IListScanRunsRequest, + | protos.google.cloud.websecurityscanner.v1beta.IListScanRunsResponse + | null + | undefined, + protos.google.cloud.websecurityscanner.v1beta.IScanRun + > + ): void; + listScanRuns( + request: protos.google.cloud.websecurityscanner.v1beta.IListScanRunsRequest, + callback: PaginationCallback< + protos.google.cloud.websecurityscanner.v1beta.IListScanRunsRequest, + | protos.google.cloud.websecurityscanner.v1beta.IListScanRunsResponse + | null + | undefined, + protos.google.cloud.websecurityscanner.v1beta.IScanRun + > + ): void; + listScanRuns( + request?: protos.google.cloud.websecurityscanner.v1beta.IListScanRunsRequest, + optionsOrCallback?: + | CallOptions + | PaginationCallback< + protos.google.cloud.websecurityscanner.v1beta.IListScanRunsRequest, + | protos.google.cloud.websecurityscanner.v1beta.IListScanRunsResponse + | null + | undefined, + protos.google.cloud.websecurityscanner.v1beta.IScanRun + >, + callback?: PaginationCallback< + protos.google.cloud.websecurityscanner.v1beta.IListScanRunsRequest, + | protos.google.cloud.websecurityscanner.v1beta.IListScanRunsResponse + | null + | undefined, + protos.google.cloud.websecurityscanner.v1beta.IScanRun + > + ): Promise< + [ + protos.google.cloud.websecurityscanner.v1beta.IScanRun[], + protos.google.cloud.websecurityscanner.v1beta.IListScanRunsRequest | null, + protos.google.cloud.websecurityscanner.v1beta.IListScanRunsResponse + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as 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.listScanRuns(request, options, callback); + } + + /** + * Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The parent resource name, which should be a scan resource name in the + * format 'projects/{projectId}/scanConfigs/{scanConfigId}'. + * @param {string} request.pageToken + * A token identifying a page of results to be returned. This should be a + * `next_page_token` value returned from a previous List request. + * If unspecified, the first page of results is returned. + * @param {number} request.pageSize + * The maximum number of ScanRuns to return, can be limited by server. + * If not specified or not positive, the implementation will select a + * reasonable value. + * @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 [ScanRun]{@link google.cloud.websecurityscanner.v1beta.ScanRun} 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 `listScanRunsAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) + * for more details and examples. + */ + listScanRunsStream( + request?: protos.google.cloud.websecurityscanner.v1beta.IListScanRunsRequest, + 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['listScanRuns']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.listScanRuns.createStream( + this.innerApiCalls.listScanRuns as GaxCall, + request, + callSettings + ); + } + + /** + * Equivalent to `listScanRuns`, 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 name, which should be a scan resource name in the + * format 'projects/{projectId}/scanConfigs/{scanConfigId}'. + * @param {string} request.pageToken + * A token identifying a page of results to be returned. This should be a + * `next_page_token` value returned from a previous List request. + * If unspecified, the first page of results is returned. + * @param {number} request.pageSize + * The maximum number of ScanRuns to return, can be limited by server. + * If not specified or not positive, the implementation will select a + * reasonable value. + * @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 [async iteration](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols). + * When you iterate the returned iterable, each element will be an object representing + * [ScanRun]{@link google.cloud.websecurityscanner.v1beta.ScanRun}. 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 + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) + * for more details and examples. + * @example include:samples/generated/v1beta/web_security_scanner.list_scan_runs.js + * region_tag:websecurityscanner_v1beta_generated_WebSecurityScanner_ListScanRuns_async + */ + listScanRunsAsync( + request?: protos.google.cloud.websecurityscanner.v1beta.IListScanRunsRequest, + 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['listScanRuns']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.listScanRuns.asyncIterate( + this.innerApiCalls['listScanRuns'] as GaxCall, + request as {}, + callSettings + ) as AsyncIterable; + } + /** + * List CrawledUrls under a given ScanRun. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The parent resource name, which should be a scan run resource name in the + * format + * 'projects/{projectId}/scanConfigs/{scanConfigId}/scanRuns/{scanRunId}'. + * @param {string} request.pageToken + * A token identifying a page of results to be returned. This should be a + * `next_page_token` value returned from a previous List request. + * If unspecified, the first page of results is returned. + * @param {number} request.pageSize + * The maximum number of CrawledUrls to return, can be limited by server. + * If not specified or not positive, the implementation will select a + * reasonable value. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is Array of [CrawledUrl]{@link google.cloud.websecurityscanner.v1beta.CrawledUrl}. + * 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 `listCrawledUrlsAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) + * for more details and examples. + */ + listCrawledUrls( + request?: protos.google.cloud.websecurityscanner.v1beta.IListCrawledUrlsRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.websecurityscanner.v1beta.ICrawledUrl[], + protos.google.cloud.websecurityscanner.v1beta.IListCrawledUrlsRequest | null, + protos.google.cloud.websecurityscanner.v1beta.IListCrawledUrlsResponse + ] + >; + listCrawledUrls( + request: protos.google.cloud.websecurityscanner.v1beta.IListCrawledUrlsRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.cloud.websecurityscanner.v1beta.IListCrawledUrlsRequest, + | protos.google.cloud.websecurityscanner.v1beta.IListCrawledUrlsResponse + | null + | undefined, + protos.google.cloud.websecurityscanner.v1beta.ICrawledUrl + > + ): void; + listCrawledUrls( + request: protos.google.cloud.websecurityscanner.v1beta.IListCrawledUrlsRequest, + callback: PaginationCallback< + protos.google.cloud.websecurityscanner.v1beta.IListCrawledUrlsRequest, + | protos.google.cloud.websecurityscanner.v1beta.IListCrawledUrlsResponse + | null + | undefined, + protos.google.cloud.websecurityscanner.v1beta.ICrawledUrl + > + ): void; + listCrawledUrls( + request?: protos.google.cloud.websecurityscanner.v1beta.IListCrawledUrlsRequest, + optionsOrCallback?: + | CallOptions + | PaginationCallback< + protos.google.cloud.websecurityscanner.v1beta.IListCrawledUrlsRequest, + | protos.google.cloud.websecurityscanner.v1beta.IListCrawledUrlsResponse + | null + | undefined, + protos.google.cloud.websecurityscanner.v1beta.ICrawledUrl + >, + callback?: PaginationCallback< + protos.google.cloud.websecurityscanner.v1beta.IListCrawledUrlsRequest, + | protos.google.cloud.websecurityscanner.v1beta.IListCrawledUrlsResponse + | null + | undefined, + protos.google.cloud.websecurityscanner.v1beta.ICrawledUrl + > + ): Promise< + [ + protos.google.cloud.websecurityscanner.v1beta.ICrawledUrl[], + protos.google.cloud.websecurityscanner.v1beta.IListCrawledUrlsRequest | null, + protos.google.cloud.websecurityscanner.v1beta.IListCrawledUrlsResponse + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as 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.listCrawledUrls(request, options, callback); + } + + /** + * Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The parent resource name, which should be a scan run resource name in the + * format + * 'projects/{projectId}/scanConfigs/{scanConfigId}/scanRuns/{scanRunId}'. + * @param {string} request.pageToken + * A token identifying a page of results to be returned. This should be a + * `next_page_token` value returned from a previous List request. + * If unspecified, the first page of results is returned. + * @param {number} request.pageSize + * The maximum number of CrawledUrls to return, can be limited by server. + * If not specified or not positive, the implementation will select a + * reasonable value. + * @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 [CrawledUrl]{@link google.cloud.websecurityscanner.v1beta.CrawledUrl} 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 `listCrawledUrlsAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) + * for more details and examples. + */ + listCrawledUrlsStream( + request?: protos.google.cloud.websecurityscanner.v1beta.IListCrawledUrlsRequest, + 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['listCrawledUrls']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.listCrawledUrls.createStream( + this.innerApiCalls.listCrawledUrls as GaxCall, + request, + callSettings + ); + } + + /** + * Equivalent to `listCrawledUrls`, 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 name, which should be a scan run resource name in the + * format + * 'projects/{projectId}/scanConfigs/{scanConfigId}/scanRuns/{scanRunId}'. + * @param {string} request.pageToken + * A token identifying a page of results to be returned. This should be a + * `next_page_token` value returned from a previous List request. + * If unspecified, the first page of results is returned. + * @param {number} request.pageSize + * The maximum number of CrawledUrls to return, can be limited by server. + * If not specified or not positive, the implementation will select a + * reasonable value. + * @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 [async iteration](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols). + * When you iterate the returned iterable, each element will be an object representing + * [CrawledUrl]{@link google.cloud.websecurityscanner.v1beta.CrawledUrl}. 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 + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) + * for more details and examples. + * @example include:samples/generated/v1beta/web_security_scanner.list_crawled_urls.js + * region_tag:websecurityscanner_v1beta_generated_WebSecurityScanner_ListCrawledUrls_async + */ + listCrawledUrlsAsync( + request?: protos.google.cloud.websecurityscanner.v1beta.IListCrawledUrlsRequest, + 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['listCrawledUrls']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.listCrawledUrls.asyncIterate( + this.innerApiCalls['listCrawledUrls'] as GaxCall, + request as {}, + callSettings + ) as AsyncIterable; + } + /** + * List Findings under a given ScanRun. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The parent resource name, which should be a scan run resource name in the + * format + * 'projects/{projectId}/scanConfigs/{scanConfigId}/scanRuns/{scanRunId}'. + * @param {string} request.filter + * Required. The filter expression. The expression must be in the format: + * . + * Supported field: 'finding_type'. + * Supported operator: '='. + * @param {string} request.pageToken + * A token identifying a page of results to be returned. This should be a + * `next_page_token` value returned from a previous List request. + * If unspecified, the first page of results is returned. + * @param {number} request.pageSize + * The maximum number of Findings to return, can be limited by server. + * If not specified or not positive, the implementation will select a + * reasonable value. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is Array of [Finding]{@link google.cloud.websecurityscanner.v1beta.Finding}. + * 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 `listFindingsAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) + * for more details and examples. + */ + listFindings( + request?: protos.google.cloud.websecurityscanner.v1beta.IListFindingsRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.websecurityscanner.v1beta.IFinding[], + protos.google.cloud.websecurityscanner.v1beta.IListFindingsRequest | null, + protos.google.cloud.websecurityscanner.v1beta.IListFindingsResponse + ] + >; + listFindings( + request: protos.google.cloud.websecurityscanner.v1beta.IListFindingsRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.cloud.websecurityscanner.v1beta.IListFindingsRequest, + | protos.google.cloud.websecurityscanner.v1beta.IListFindingsResponse + | null + | undefined, + protos.google.cloud.websecurityscanner.v1beta.IFinding + > + ): void; + listFindings( + request: protos.google.cloud.websecurityscanner.v1beta.IListFindingsRequest, + callback: PaginationCallback< + protos.google.cloud.websecurityscanner.v1beta.IListFindingsRequest, + | protos.google.cloud.websecurityscanner.v1beta.IListFindingsResponse + | null + | undefined, + protos.google.cloud.websecurityscanner.v1beta.IFinding + > + ): void; + listFindings( + request?: protos.google.cloud.websecurityscanner.v1beta.IListFindingsRequest, + optionsOrCallback?: + | CallOptions + | PaginationCallback< + protos.google.cloud.websecurityscanner.v1beta.IListFindingsRequest, + | protos.google.cloud.websecurityscanner.v1beta.IListFindingsResponse + | null + | undefined, + protos.google.cloud.websecurityscanner.v1beta.IFinding + >, + callback?: PaginationCallback< + protos.google.cloud.websecurityscanner.v1beta.IListFindingsRequest, + | protos.google.cloud.websecurityscanner.v1beta.IListFindingsResponse + | null + | undefined, + protos.google.cloud.websecurityscanner.v1beta.IFinding + > + ): Promise< + [ + protos.google.cloud.websecurityscanner.v1beta.IFinding[], + protos.google.cloud.websecurityscanner.v1beta.IListFindingsRequest | null, + protos.google.cloud.websecurityscanner.v1beta.IListFindingsResponse + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as 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.listFindings(request, options, callback); + } + + /** + * Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The parent resource name, which should be a scan run resource name in the + * format + * 'projects/{projectId}/scanConfigs/{scanConfigId}/scanRuns/{scanRunId}'. + * @param {string} request.filter + * Required. The filter expression. The expression must be in the format: + * . + * Supported field: 'finding_type'. + * Supported operator: '='. + * @param {string} request.pageToken + * A token identifying a page of results to be returned. This should be a + * `next_page_token` value returned from a previous List request. + * If unspecified, the first page of results is returned. + * @param {number} request.pageSize + * The maximum number of Findings to return, can be limited by server. + * If not specified or not positive, the implementation will select a + * reasonable value. + * @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 [Finding]{@link google.cloud.websecurityscanner.v1beta.Finding} 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 `listFindingsAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) + * for more details and examples. + */ + listFindingsStream( + request?: protos.google.cloud.websecurityscanner.v1beta.IListFindingsRequest, + 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['listFindings']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.listFindings.createStream( + this.innerApiCalls.listFindings as GaxCall, + request, + callSettings + ); + } + + /** + * Equivalent to `listFindings`, 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 name, which should be a scan run resource name in the + * format + * 'projects/{projectId}/scanConfigs/{scanConfigId}/scanRuns/{scanRunId}'. + * @param {string} request.filter + * Required. The filter expression. The expression must be in the format: + * . + * Supported field: 'finding_type'. + * Supported operator: '='. + * @param {string} request.pageToken + * A token identifying a page of results to be returned. This should be a + * `next_page_token` value returned from a previous List request. + * If unspecified, the first page of results is returned. + * @param {number} request.pageSize + * The maximum number of Findings to return, can be limited by server. + * If not specified or not positive, the implementation will select a + * reasonable value. + * @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 [async iteration](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols). + * When you iterate the returned iterable, each element will be an object representing + * [Finding]{@link google.cloud.websecurityscanner.v1beta.Finding}. 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 + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) + * for more details and examples. + * @example include:samples/generated/v1beta/web_security_scanner.list_findings.js + * region_tag:websecurityscanner_v1beta_generated_WebSecurityScanner_ListFindings_async + */ + listFindingsAsync( + request?: protos.google.cloud.websecurityscanner.v1beta.IListFindingsRequest, + 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['listFindings']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.listFindings.asyncIterate( + this.innerApiCalls['listFindings'] as GaxCall, + request as {}, + callSettings + ) as AsyncIterable; + } + // -------------------- + // -- Path templates -- + // -------------------- + + /** + * Return a fully-qualified finding resource name string. + * + * @param {string} project + * @param {string} scan_config + * @param {string} scan_run + * @param {string} finding + * @returns {string} Resource name string. + */ + findingPath( + project: string, + scanConfig: string, + scanRun: string, + finding: string + ) { + return this.pathTemplates.findingPathTemplate.render({ + project: project, + scan_config: scanConfig, + scan_run: scanRun, + finding: finding, + }); + } + + /** + * Parse the project from Finding resource. + * + * @param {string} findingName + * A fully-qualified path representing Finding resource. + * @returns {string} A string representing the project. + */ + matchProjectFromFindingName(findingName: string) { + return this.pathTemplates.findingPathTemplate.match(findingName).project; + } + + /** + * Parse the scan_config from Finding resource. + * + * @param {string} findingName + * A fully-qualified path representing Finding resource. + * @returns {string} A string representing the scan_config. + */ + matchScanConfigFromFindingName(findingName: string) { + return this.pathTemplates.findingPathTemplate.match(findingName) + .scan_config; + } + + /** + * Parse the scan_run from Finding resource. + * + * @param {string} findingName + * A fully-qualified path representing Finding resource. + * @returns {string} A string representing the scan_run. + */ + matchScanRunFromFindingName(findingName: string) { + return this.pathTemplates.findingPathTemplate.match(findingName).scan_run; + } + + /** + * Parse the finding from Finding resource. + * + * @param {string} findingName + * A fully-qualified path representing Finding resource. + * @returns {string} A string representing the finding. + */ + matchFindingFromFindingName(findingName: string) { + return this.pathTemplates.findingPathTemplate.match(findingName).finding; + } + + /** + * 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 scanConfig resource name string. + * + * @param {string} project + * @param {string} scan_config + * @returns {string} Resource name string. + */ + scanConfigPath(project: string, scanConfig: string) { + return this.pathTemplates.scanConfigPathTemplate.render({ + project: project, + scan_config: scanConfig, + }); + } + + /** + * Parse the project from ScanConfig resource. + * + * @param {string} scanConfigName + * A fully-qualified path representing ScanConfig resource. + * @returns {string} A string representing the project. + */ + matchProjectFromScanConfigName(scanConfigName: string) { + return this.pathTemplates.scanConfigPathTemplate.match(scanConfigName) + .project; + } + + /** + * Parse the scan_config from ScanConfig resource. + * + * @param {string} scanConfigName + * A fully-qualified path representing ScanConfig resource. + * @returns {string} A string representing the scan_config. + */ + matchScanConfigFromScanConfigName(scanConfigName: string) { + return this.pathTemplates.scanConfigPathTemplate.match(scanConfigName) + .scan_config; + } + + /** + * Return a fully-qualified scanRun resource name string. + * + * @param {string} project + * @param {string} scan_config + * @param {string} scan_run + * @returns {string} Resource name string. + */ + scanRunPath(project: string, scanConfig: string, scanRun: string) { + return this.pathTemplates.scanRunPathTemplate.render({ + project: project, + scan_config: scanConfig, + scan_run: scanRun, + }); + } + + /** + * Parse the project from ScanRun resource. + * + * @param {string} scanRunName + * A fully-qualified path representing ScanRun resource. + * @returns {string} A string representing the project. + */ + matchProjectFromScanRunName(scanRunName: string) { + return this.pathTemplates.scanRunPathTemplate.match(scanRunName).project; + } + + /** + * Parse the scan_config from ScanRun resource. + * + * @param {string} scanRunName + * A fully-qualified path representing ScanRun resource. + * @returns {string} A string representing the scan_config. + */ + matchScanConfigFromScanRunName(scanRunName: string) { + return this.pathTemplates.scanRunPathTemplate.match(scanRunName) + .scan_config; + } + + /** + * Parse the scan_run from ScanRun resource. + * + * @param {string} scanRunName + * A fully-qualified path representing ScanRun resource. + * @returns {string} A string representing the scan_run. + */ + matchScanRunFromScanRunName(scanRunName: string) { + return this.pathTemplates.scanRunPathTemplate.match(scanRunName).scan_run; + } + + /** + * 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.webSecurityScannerStub && !this._terminated) { + return this.webSecurityScannerStub.then(stub => { + this._terminated = true; + stub.close(); + }); + } + return Promise.resolve(); + } +} diff --git a/packages/google-cloud-websecurityscanner/src/v1beta/web_security_scanner_client_config.json b/packages/google-cloud-websecurityscanner/src/v1beta/web_security_scanner_client_config.json new file mode 100644 index 00000000000..ecb06a1b541 --- /dev/null +++ b/packages/google-cloud-websecurityscanner/src/v1beta/web_security_scanner_client_config.json @@ -0,0 +1,91 @@ +{ + "interfaces": { + "google.cloud.websecurityscanner.v1beta.WebSecurityScanner": { + "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": { + "CreateScanConfig": { + "timeout_millis": 600000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "DeleteScanConfig": { + "timeout_millis": 600000, + "retry_codes_name": "idempotent", + "retry_params_name": "default" + }, + "GetScanConfig": { + "timeout_millis": 600000, + "retry_codes_name": "idempotent", + "retry_params_name": "default" + }, + "ListScanConfigs": { + "timeout_millis": 600000, + "retry_codes_name": "idempotent", + "retry_params_name": "default" + }, + "UpdateScanConfig": { + "timeout_millis": 600000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "StartScanRun": { + "timeout_millis": 600000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "GetScanRun": { + "timeout_millis": 600000, + "retry_codes_name": "idempotent", + "retry_params_name": "default" + }, + "ListScanRuns": { + "timeout_millis": 600000, + "retry_codes_name": "idempotent", + "retry_params_name": "default" + }, + "StopScanRun": { + "timeout_millis": 600000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "ListCrawledUrls": { + "timeout_millis": 600000, + "retry_codes_name": "idempotent", + "retry_params_name": "default" + }, + "GetFinding": { + "timeout_millis": 600000, + "retry_codes_name": "idempotent", + "retry_params_name": "default" + }, + "ListFindings": { + "timeout_millis": 600000, + "retry_codes_name": "idempotent", + "retry_params_name": "default" + }, + "ListFindingTypeStats": { + "timeout_millis": 600000, + "retry_codes_name": "idempotent", + "retry_params_name": "default" + } + } + } + } +} diff --git a/packages/google-cloud-websecurityscanner/src/v1beta/web_security_scanner_proto_list.json b/packages/google-cloud-websecurityscanner/src/v1beta/web_security_scanner_proto_list.json new file mode 100644 index 00000000000..abb184881d5 --- /dev/null +++ b/packages/google-cloud-websecurityscanner/src/v1beta/web_security_scanner_proto_list.json @@ -0,0 +1,12 @@ +[ + "../../protos/google/cloud/websecurityscanner/v1beta/crawled_url.proto", + "../../protos/google/cloud/websecurityscanner/v1beta/finding.proto", + "../../protos/google/cloud/websecurityscanner/v1beta/finding_addon.proto", + "../../protos/google/cloud/websecurityscanner/v1beta/finding_type_stats.proto", + "../../protos/google/cloud/websecurityscanner/v1beta/scan_config.proto", + "../../protos/google/cloud/websecurityscanner/v1beta/scan_config_error.proto", + "../../protos/google/cloud/websecurityscanner/v1beta/scan_run.proto", + "../../protos/google/cloud/websecurityscanner/v1beta/scan_run_error_trace.proto", + "../../protos/google/cloud/websecurityscanner/v1beta/scan_run_warning_trace.proto", + "../../protos/google/cloud/websecurityscanner/v1beta/web_security_scanner.proto" +] diff --git a/packages/google-cloud-websecurityscanner/system-test/fixtures/sample/src/index.js b/packages/google-cloud-websecurityscanner/system-test/fixtures/sample/src/index.js new file mode 100644 index 00000000000..bdeac92f18e --- /dev/null +++ b/packages/google-cloud-websecurityscanner/system-test/fixtures/sample/src/index.js @@ -0,0 +1,27 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + +/* eslint-disable node/no-missing-require, no-unused-vars */ +const websecurityscanner = require('@google-cloud/web-security-scanner'); + +function main() { + const webSecurityScannerClient = + new websecurityscanner.WebSecurityScannerClient(); +} + +main(); diff --git a/packages/google-cloud-websecurityscanner/system-test/fixtures/sample/src/index.ts b/packages/google-cloud-websecurityscanner/system-test/fixtures/sample/src/index.ts new file mode 100644 index 00000000000..8bd7a239e41 --- /dev/null +++ b/packages/google-cloud-websecurityscanner/system-test/fixtures/sample/src/index.ts @@ -0,0 +1,32 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + +import {WebSecurityScannerClient} from '@google-cloud/web-security-scanner'; + +// check that the client class type name can be used +function doStuffWithWebSecurityScannerClient(client: WebSecurityScannerClient) { + client.close(); +} + +function main() { + // check that the client instance can be created + const webSecurityScannerClient = new WebSecurityScannerClient(); + doStuffWithWebSecurityScannerClient(webSecurityScannerClient); +} + +main(); diff --git a/packages/google-cloud-websecurityscanner/system-test/install.ts b/packages/google-cloud-websecurityscanner/system-test/install.ts new file mode 100644 index 00000000000..6dd1eaadafa --- /dev/null +++ b/packages/google-cloud-websecurityscanner/system-test/install.ts @@ -0,0 +1,51 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + +import {packNTest} from 'pack-n-play'; +import {readFileSync} from 'fs'; +import {describe, it} from 'mocha'; + +describe('📦 pack-n-play test', () => { + it('TypeScript code', async function () { + this.timeout(300000); + const options = { + packageDir: process.cwd(), + sample: { + description: 'TypeScript user can use the type definitions', + ts: readFileSync( + './system-test/fixtures/sample/src/index.ts' + ).toString(), + }, + }; + await packNTest(options); + }); + + it('JavaScript code', async function () { + this.timeout(300000); + const options = { + packageDir: process.cwd(), + sample: { + description: 'JavaScript user can use the library', + ts: readFileSync( + './system-test/fixtures/sample/src/index.js' + ).toString(), + }, + }; + await packNTest(options); + }); +}); diff --git a/packages/google-cloud-websecurityscanner/test/gapic_web_security_scanner_v1.ts b/packages/google-cloud-websecurityscanner/test/gapic_web_security_scanner_v1.ts new file mode 100644 index 00000000000..4e96de89603 --- /dev/null +++ b/packages/google-cloud-websecurityscanner/test/gapic_web_security_scanner_v1.ts @@ -0,0 +1,2806 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + +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 websecurityscannerModule from '../src'; + +import {PassThrough} from 'stream'; + +import {protobuf} from 'google-gax'; + +// Dynamically loaded proto JSON is needed to get the type information +// to fill in default values for request objects +const root = protobuf.Root.fromJSON( + require('../protos/protos.json') +).resolveAll(); + +// eslint-disable-next-line @typescript-eslint/no-unused-vars +function getTypeDefaultValue(typeName: string, fields: string[]) { + let type = root.lookupType(typeName) as protobuf.Type; + for (const field of fields.slice(0, -1)) { + type = type.fields[field]?.resolvedType as protobuf.Type; + } + return type.fields[fields[fields.length - 1]]?.defaultValue; +} + +function generateSampleMessage(instance: T) { + const filledObject = ( + instance.constructor as typeof protobuf.Message + ).toObject(instance as protobuf.Message, {defaults: true}); + return (instance.constructor as typeof protobuf.Message).fromObject( + filledObject + ) as T; +} + +function stubSimpleCall(response?: ResponseType, error?: Error) { + return error + ? sinon.stub().rejects(error) + : sinon.stub().resolves([response]); +} + +function stubSimpleCallWithCallback( + response?: ResponseType, + error?: Error +) { + return error + ? sinon.stub().callsArgWith(2, error) + : sinon.stub().callsArgWith(2, null, response); +} + +function stubPageStreamingCall( + responses?: ResponseType[], + error?: Error +) { + const pagingStub = sinon.stub(); + if (responses) { + for (let i = 0; i < responses.length; ++i) { + pagingStub.onCall(i).callsArgWith(2, null, responses[i]); + } + } + const transformStub = error + ? sinon.stub().callsArgWith(2, error) + : pagingStub; + const mockStream = new PassThrough({ + objectMode: true, + transform: transformStub, + }); + // trigger as many responses as needed + if (responses) { + for (let i = 0; i < responses.length; ++i) { + setImmediate(() => { + mockStream.write({}); + }); + } + setImmediate(() => { + mockStream.end(); + }); + } else { + setImmediate(() => { + mockStream.write({}); + }); + setImmediate(() => { + mockStream.end(); + }); + } + return sinon.stub().returns(mockStream); +} + +function stubAsyncIterationCall( + responses?: ResponseType[], + error?: Error +) { + let counter = 0; + const asyncIterable = { + [Symbol.asyncIterator]() { + return { + async next() { + if (error) { + return Promise.reject(error); + } + if (counter >= responses!.length) { + return Promise.resolve({done: true, value: undefined}); + } + return Promise.resolve({done: false, value: responses![counter++]}); + }, + }; + }, + }; + return sinon.stub().returns(asyncIterable); +} + +describe('v1.WebSecurityScannerClient', () => { + describe('Common methods', () => { + it('has servicePath', () => { + const servicePath = + websecurityscannerModule.v1.WebSecurityScannerClient.servicePath; + assert(servicePath); + }); + + it('has apiEndpoint', () => { + const apiEndpoint = + websecurityscannerModule.v1.WebSecurityScannerClient.apiEndpoint; + assert(apiEndpoint); + }); + + it('has port', () => { + const port = websecurityscannerModule.v1.WebSecurityScannerClient.port; + assert(port); + assert(typeof port === 'number'); + }); + + it('should create a client with no option', () => { + const client = new websecurityscannerModule.v1.WebSecurityScannerClient(); + assert(client); + }); + + it('should create a client with gRPC fallback', () => { + const client = new websecurityscannerModule.v1.WebSecurityScannerClient({ + fallback: true, + }); + assert(client); + }); + + it('has initialize method and supports deferred initialization', async () => { + const client = new websecurityscannerModule.v1.WebSecurityScannerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + assert.strictEqual(client.webSecurityScannerStub, undefined); + await client.initialize(); + assert(client.webSecurityScannerStub); + }); + + it('has close method for the initialized client', done => { + const client = new websecurityscannerModule.v1.WebSecurityScannerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + assert(client.webSecurityScannerStub); + client.close().then(() => { + done(); + }); + }); + + it('has close method for the non-initialized client', done => { + const client = new websecurityscannerModule.v1.WebSecurityScannerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + assert.strictEqual(client.webSecurityScannerStub, undefined); + client.close().then(() => { + done(); + }); + }); + + it('has getProjectId method', async () => { + const fakeProjectId = 'fake-project-id'; + const client = new websecurityscannerModule.v1.WebSecurityScannerClient({ + 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 websecurityscannerModule.v1.WebSecurityScannerClient({ + 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('createScanConfig', () => { + it('invokes createScanConfig without error', async () => { + const client = new websecurityscannerModule.v1.WebSecurityScannerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.websecurityscanner.v1.CreateScanConfigRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.websecurityscanner.v1.CreateScanConfigRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.websecurityscanner.v1.ScanConfig() + ); + client.innerApiCalls.createScanConfig = stubSimpleCall(expectedResponse); + const [response] = await client.createScanConfig(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.createScanConfig as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createScanConfig as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createScanConfig without error using callback', async () => { + const client = new websecurityscannerModule.v1.WebSecurityScannerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.websecurityscanner.v1.CreateScanConfigRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.websecurityscanner.v1.CreateScanConfigRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.websecurityscanner.v1.ScanConfig() + ); + client.innerApiCalls.createScanConfig = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.createScanConfig( + request, + ( + err?: Error | null, + result?: protos.google.cloud.websecurityscanner.v1.IScanConfig | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.createScanConfig as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createScanConfig as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createScanConfig with error', async () => { + const client = new websecurityscannerModule.v1.WebSecurityScannerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.websecurityscanner.v1.CreateScanConfigRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.websecurityscanner.v1.CreateScanConfigRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.createScanConfig = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.createScanConfig(request), expectedError); + const actualRequest = ( + client.innerApiCalls.createScanConfig as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createScanConfig as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createScanConfig with closed client', async () => { + const client = new websecurityscannerModule.v1.WebSecurityScannerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.websecurityscanner.v1.CreateScanConfigRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.websecurityscanner.v1.CreateScanConfigRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.createScanConfig(request), expectedError); + }); + }); + + describe('deleteScanConfig', () => { + it('invokes deleteScanConfig without error', async () => { + const client = new websecurityscannerModule.v1.WebSecurityScannerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.websecurityscanner.v1.DeleteScanConfigRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.websecurityscanner.v1.DeleteScanConfigRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty() + ); + client.innerApiCalls.deleteScanConfig = stubSimpleCall(expectedResponse); + const [response] = await client.deleteScanConfig(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.deleteScanConfig as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteScanConfig as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteScanConfig without error using callback', async () => { + const client = new websecurityscannerModule.v1.WebSecurityScannerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.websecurityscanner.v1.DeleteScanConfigRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.websecurityscanner.v1.DeleteScanConfigRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty() + ); + client.innerApiCalls.deleteScanConfig = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.deleteScanConfig( + 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.deleteScanConfig as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteScanConfig as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteScanConfig with error', async () => { + const client = new websecurityscannerModule.v1.WebSecurityScannerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.websecurityscanner.v1.DeleteScanConfigRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.websecurityscanner.v1.DeleteScanConfigRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.deleteScanConfig = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.deleteScanConfig(request), expectedError); + const actualRequest = ( + client.innerApiCalls.deleteScanConfig as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteScanConfig as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteScanConfig with closed client', async () => { + const client = new websecurityscannerModule.v1.WebSecurityScannerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.websecurityscanner.v1.DeleteScanConfigRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.websecurityscanner.v1.DeleteScanConfigRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.deleteScanConfig(request), expectedError); + }); + }); + + describe('getScanConfig', () => { + it('invokes getScanConfig without error', async () => { + const client = new websecurityscannerModule.v1.WebSecurityScannerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.websecurityscanner.v1.GetScanConfigRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.websecurityscanner.v1.GetScanConfigRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.websecurityscanner.v1.ScanConfig() + ); + client.innerApiCalls.getScanConfig = stubSimpleCall(expectedResponse); + const [response] = await client.getScanConfig(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.getScanConfig as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getScanConfig as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getScanConfig without error using callback', async () => { + const client = new websecurityscannerModule.v1.WebSecurityScannerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.websecurityscanner.v1.GetScanConfigRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.websecurityscanner.v1.GetScanConfigRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.websecurityscanner.v1.ScanConfig() + ); + client.innerApiCalls.getScanConfig = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getScanConfig( + request, + ( + err?: Error | null, + result?: protos.google.cloud.websecurityscanner.v1.IScanConfig | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.getScanConfig as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getScanConfig as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getScanConfig with error', async () => { + const client = new websecurityscannerModule.v1.WebSecurityScannerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.websecurityscanner.v1.GetScanConfigRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.websecurityscanner.v1.GetScanConfigRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.getScanConfig = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.getScanConfig(request), expectedError); + const actualRequest = ( + client.innerApiCalls.getScanConfig as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getScanConfig as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getScanConfig with closed client', async () => { + const client = new websecurityscannerModule.v1.WebSecurityScannerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.websecurityscanner.v1.GetScanConfigRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.websecurityscanner.v1.GetScanConfigRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.getScanConfig(request), expectedError); + }); + }); + + describe('updateScanConfig', () => { + it('invokes updateScanConfig without error', async () => { + const client = new websecurityscannerModule.v1.WebSecurityScannerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.websecurityscanner.v1.UpdateScanConfigRequest() + ); + request.scanConfig ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.websecurityscanner.v1.UpdateScanConfigRequest', + ['scanConfig', 'name'] + ); + request.scanConfig.name = defaultValue1; + const expectedHeaderRequestParams = `scan_config.name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.websecurityscanner.v1.ScanConfig() + ); + client.innerApiCalls.updateScanConfig = stubSimpleCall(expectedResponse); + const [response] = await client.updateScanConfig(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.updateScanConfig as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateScanConfig as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateScanConfig without error using callback', async () => { + const client = new websecurityscannerModule.v1.WebSecurityScannerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.websecurityscanner.v1.UpdateScanConfigRequest() + ); + request.scanConfig ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.websecurityscanner.v1.UpdateScanConfigRequest', + ['scanConfig', 'name'] + ); + request.scanConfig.name = defaultValue1; + const expectedHeaderRequestParams = `scan_config.name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.websecurityscanner.v1.ScanConfig() + ); + client.innerApiCalls.updateScanConfig = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.updateScanConfig( + request, + ( + err?: Error | null, + result?: protos.google.cloud.websecurityscanner.v1.IScanConfig | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.updateScanConfig as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateScanConfig as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateScanConfig with error', async () => { + const client = new websecurityscannerModule.v1.WebSecurityScannerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.websecurityscanner.v1.UpdateScanConfigRequest() + ); + request.scanConfig ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.websecurityscanner.v1.UpdateScanConfigRequest', + ['scanConfig', 'name'] + ); + request.scanConfig.name = defaultValue1; + const expectedHeaderRequestParams = `scan_config.name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.updateScanConfig = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.updateScanConfig(request), expectedError); + const actualRequest = ( + client.innerApiCalls.updateScanConfig as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateScanConfig as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateScanConfig with closed client', async () => { + const client = new websecurityscannerModule.v1.WebSecurityScannerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.websecurityscanner.v1.UpdateScanConfigRequest() + ); + request.scanConfig ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.websecurityscanner.v1.UpdateScanConfigRequest', + ['scanConfig', 'name'] + ); + request.scanConfig.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.updateScanConfig(request), expectedError); + }); + }); + + describe('startScanRun', () => { + it('invokes startScanRun without error', async () => { + const client = new websecurityscannerModule.v1.WebSecurityScannerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.websecurityscanner.v1.StartScanRunRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.websecurityscanner.v1.StartScanRunRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.websecurityscanner.v1.ScanRun() + ); + client.innerApiCalls.startScanRun = stubSimpleCall(expectedResponse); + const [response] = await client.startScanRun(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.startScanRun as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.startScanRun as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes startScanRun without error using callback', async () => { + const client = new websecurityscannerModule.v1.WebSecurityScannerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.websecurityscanner.v1.StartScanRunRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.websecurityscanner.v1.StartScanRunRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.websecurityscanner.v1.ScanRun() + ); + client.innerApiCalls.startScanRun = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.startScanRun( + request, + ( + err?: Error | null, + result?: protos.google.cloud.websecurityscanner.v1.IScanRun | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.startScanRun as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.startScanRun as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes startScanRun with error', async () => { + const client = new websecurityscannerModule.v1.WebSecurityScannerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.websecurityscanner.v1.StartScanRunRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.websecurityscanner.v1.StartScanRunRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.startScanRun = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.startScanRun(request), expectedError); + const actualRequest = ( + client.innerApiCalls.startScanRun as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.startScanRun as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes startScanRun with closed client', async () => { + const client = new websecurityscannerModule.v1.WebSecurityScannerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.websecurityscanner.v1.StartScanRunRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.websecurityscanner.v1.StartScanRunRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.startScanRun(request), expectedError); + }); + }); + + describe('getScanRun', () => { + it('invokes getScanRun without error', async () => { + const client = new websecurityscannerModule.v1.WebSecurityScannerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.websecurityscanner.v1.GetScanRunRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.websecurityscanner.v1.GetScanRunRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.websecurityscanner.v1.ScanRun() + ); + client.innerApiCalls.getScanRun = stubSimpleCall(expectedResponse); + const [response] = await client.getScanRun(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.getScanRun as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getScanRun as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getScanRun without error using callback', async () => { + const client = new websecurityscannerModule.v1.WebSecurityScannerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.websecurityscanner.v1.GetScanRunRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.websecurityscanner.v1.GetScanRunRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.websecurityscanner.v1.ScanRun() + ); + client.innerApiCalls.getScanRun = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getScanRun( + request, + ( + err?: Error | null, + result?: protos.google.cloud.websecurityscanner.v1.IScanRun | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.getScanRun as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getScanRun as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getScanRun with error', async () => { + const client = new websecurityscannerModule.v1.WebSecurityScannerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.websecurityscanner.v1.GetScanRunRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.websecurityscanner.v1.GetScanRunRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.getScanRun = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.getScanRun(request), expectedError); + const actualRequest = ( + client.innerApiCalls.getScanRun as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getScanRun as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getScanRun with closed client', async () => { + const client = new websecurityscannerModule.v1.WebSecurityScannerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.websecurityscanner.v1.GetScanRunRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.websecurityscanner.v1.GetScanRunRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.getScanRun(request), expectedError); + }); + }); + + describe('stopScanRun', () => { + it('invokes stopScanRun without error', async () => { + const client = new websecurityscannerModule.v1.WebSecurityScannerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.websecurityscanner.v1.StopScanRunRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.websecurityscanner.v1.StopScanRunRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.websecurityscanner.v1.ScanRun() + ); + client.innerApiCalls.stopScanRun = stubSimpleCall(expectedResponse); + const [response] = await client.stopScanRun(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.stopScanRun as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.stopScanRun as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes stopScanRun without error using callback', async () => { + const client = new websecurityscannerModule.v1.WebSecurityScannerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.websecurityscanner.v1.StopScanRunRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.websecurityscanner.v1.StopScanRunRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.websecurityscanner.v1.ScanRun() + ); + client.innerApiCalls.stopScanRun = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.stopScanRun( + request, + ( + err?: Error | null, + result?: protos.google.cloud.websecurityscanner.v1.IScanRun | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.stopScanRun as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.stopScanRun as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes stopScanRun with error', async () => { + const client = new websecurityscannerModule.v1.WebSecurityScannerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.websecurityscanner.v1.StopScanRunRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.websecurityscanner.v1.StopScanRunRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.stopScanRun = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.stopScanRun(request), expectedError); + const actualRequest = ( + client.innerApiCalls.stopScanRun as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.stopScanRun as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes stopScanRun with closed client', async () => { + const client = new websecurityscannerModule.v1.WebSecurityScannerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.websecurityscanner.v1.StopScanRunRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.websecurityscanner.v1.StopScanRunRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.stopScanRun(request), expectedError); + }); + }); + + describe('getFinding', () => { + it('invokes getFinding without error', async () => { + const client = new websecurityscannerModule.v1.WebSecurityScannerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.websecurityscanner.v1.GetFindingRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.websecurityscanner.v1.GetFindingRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.websecurityscanner.v1.Finding() + ); + client.innerApiCalls.getFinding = stubSimpleCall(expectedResponse); + const [response] = await client.getFinding(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.getFinding as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getFinding as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getFinding without error using callback', async () => { + const client = new websecurityscannerModule.v1.WebSecurityScannerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.websecurityscanner.v1.GetFindingRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.websecurityscanner.v1.GetFindingRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.websecurityscanner.v1.Finding() + ); + client.innerApiCalls.getFinding = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getFinding( + request, + ( + err?: Error | null, + result?: protos.google.cloud.websecurityscanner.v1.IFinding | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.getFinding as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getFinding as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getFinding with error', async () => { + const client = new websecurityscannerModule.v1.WebSecurityScannerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.websecurityscanner.v1.GetFindingRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.websecurityscanner.v1.GetFindingRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.getFinding = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.getFinding(request), expectedError); + const actualRequest = ( + client.innerApiCalls.getFinding as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getFinding as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getFinding with closed client', async () => { + const client = new websecurityscannerModule.v1.WebSecurityScannerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.websecurityscanner.v1.GetFindingRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.websecurityscanner.v1.GetFindingRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.getFinding(request), expectedError); + }); + }); + + describe('listFindingTypeStats', () => { + it('invokes listFindingTypeStats without error', async () => { + const client = new websecurityscannerModule.v1.WebSecurityScannerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.websecurityscanner.v1.ListFindingTypeStatsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.websecurityscanner.v1.ListFindingTypeStatsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.websecurityscanner.v1.ListFindingTypeStatsResponse() + ); + client.innerApiCalls.listFindingTypeStats = + stubSimpleCall(expectedResponse); + const [response] = await client.listFindingTypeStats(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.listFindingTypeStats as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listFindingTypeStats as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listFindingTypeStats without error using callback', async () => { + const client = new websecurityscannerModule.v1.WebSecurityScannerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.websecurityscanner.v1.ListFindingTypeStatsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.websecurityscanner.v1.ListFindingTypeStatsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.websecurityscanner.v1.ListFindingTypeStatsResponse() + ); + client.innerApiCalls.listFindingTypeStats = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.listFindingTypeStats( + request, + ( + err?: Error | null, + result?: protos.google.cloud.websecurityscanner.v1.IListFindingTypeStatsResponse | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.listFindingTypeStats as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listFindingTypeStats as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listFindingTypeStats with error', async () => { + const client = new websecurityscannerModule.v1.WebSecurityScannerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.websecurityscanner.v1.ListFindingTypeStatsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.websecurityscanner.v1.ListFindingTypeStatsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.listFindingTypeStats = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.listFindingTypeStats(request), expectedError); + const actualRequest = ( + client.innerApiCalls.listFindingTypeStats as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listFindingTypeStats as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listFindingTypeStats with closed client', async () => { + const client = new websecurityscannerModule.v1.WebSecurityScannerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.websecurityscanner.v1.ListFindingTypeStatsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.websecurityscanner.v1.ListFindingTypeStatsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.listFindingTypeStats(request), expectedError); + }); + }); + + describe('listScanConfigs', () => { + it('invokes listScanConfigs without error', async () => { + const client = new websecurityscannerModule.v1.WebSecurityScannerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.websecurityscanner.v1.ListScanConfigsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.websecurityscanner.v1.ListScanConfigsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.websecurityscanner.v1.ScanConfig() + ), + generateSampleMessage( + new protos.google.cloud.websecurityscanner.v1.ScanConfig() + ), + generateSampleMessage( + new protos.google.cloud.websecurityscanner.v1.ScanConfig() + ), + ]; + client.innerApiCalls.listScanConfigs = stubSimpleCall(expectedResponse); + const [response] = await client.listScanConfigs(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.listScanConfigs as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listScanConfigs as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listScanConfigs without error using callback', async () => { + const client = new websecurityscannerModule.v1.WebSecurityScannerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.websecurityscanner.v1.ListScanConfigsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.websecurityscanner.v1.ListScanConfigsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.websecurityscanner.v1.ScanConfig() + ), + generateSampleMessage( + new protos.google.cloud.websecurityscanner.v1.ScanConfig() + ), + generateSampleMessage( + new protos.google.cloud.websecurityscanner.v1.ScanConfig() + ), + ]; + client.innerApiCalls.listScanConfigs = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.listScanConfigs( + request, + ( + err?: Error | null, + result?: + | protos.google.cloud.websecurityscanner.v1.IScanConfig[] + | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.listScanConfigs as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listScanConfigs as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listScanConfigs with error', async () => { + const client = new websecurityscannerModule.v1.WebSecurityScannerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.websecurityscanner.v1.ListScanConfigsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.websecurityscanner.v1.ListScanConfigsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.listScanConfigs = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.listScanConfigs(request), expectedError); + const actualRequest = ( + client.innerApiCalls.listScanConfigs as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listScanConfigs as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listScanConfigsStream without error', async () => { + const client = new websecurityscannerModule.v1.WebSecurityScannerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.websecurityscanner.v1.ListScanConfigsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.websecurityscanner.v1.ListScanConfigsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.websecurityscanner.v1.ScanConfig() + ), + generateSampleMessage( + new protos.google.cloud.websecurityscanner.v1.ScanConfig() + ), + generateSampleMessage( + new protos.google.cloud.websecurityscanner.v1.ScanConfig() + ), + ]; + client.descriptors.page.listScanConfigs.createStream = + stubPageStreamingCall(expectedResponse); + const stream = client.listScanConfigsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.websecurityscanner.v1.ScanConfig[] = + []; + stream.on( + 'data', + (response: protos.google.cloud.websecurityscanner.v1.ScanConfig) => { + 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.listScanConfigs.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.listScanConfigs, request) + ); + assert( + (client.descriptors.page.listScanConfigs.createStream as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('invokes listScanConfigsStream with error', async () => { + const client = new websecurityscannerModule.v1.WebSecurityScannerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.websecurityscanner.v1.ListScanConfigsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.websecurityscanner.v1.ListScanConfigsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.descriptors.page.listScanConfigs.createStream = + stubPageStreamingCall(undefined, expectedError); + const stream = client.listScanConfigsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.websecurityscanner.v1.ScanConfig[] = + []; + stream.on( + 'data', + (response: protos.google.cloud.websecurityscanner.v1.ScanConfig) => { + responses.push(response); + } + ); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(promise, expectedError); + assert( + (client.descriptors.page.listScanConfigs.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.listScanConfigs, request) + ); + assert( + (client.descriptors.page.listScanConfigs.createStream as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with listScanConfigs without error', async () => { + const client = new websecurityscannerModule.v1.WebSecurityScannerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.websecurityscanner.v1.ListScanConfigsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.websecurityscanner.v1.ListScanConfigsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.websecurityscanner.v1.ScanConfig() + ), + generateSampleMessage( + new protos.google.cloud.websecurityscanner.v1.ScanConfig() + ), + generateSampleMessage( + new protos.google.cloud.websecurityscanner.v1.ScanConfig() + ), + ]; + client.descriptors.page.listScanConfigs.asyncIterate = + stubAsyncIterationCall(expectedResponse); + const responses: protos.google.cloud.websecurityscanner.v1.IScanConfig[] = + []; + const iterable = client.listScanConfigsAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + ( + client.descriptors.page.listScanConfigs.asyncIterate as SinonStub + ).getCall(0).args[1], + request + ); + assert( + (client.descriptors.page.listScanConfigs.asyncIterate as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with listScanConfigs with error', async () => { + const client = new websecurityscannerModule.v1.WebSecurityScannerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.websecurityscanner.v1.ListScanConfigsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.websecurityscanner.v1.ListScanConfigsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.descriptors.page.listScanConfigs.asyncIterate = + stubAsyncIterationCall(undefined, expectedError); + const iterable = client.listScanConfigsAsync(request); + await assert.rejects(async () => { + const responses: protos.google.cloud.websecurityscanner.v1.IScanConfig[] = + []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + ( + client.descriptors.page.listScanConfigs.asyncIterate as SinonStub + ).getCall(0).args[1], + request + ); + assert( + (client.descriptors.page.listScanConfigs.asyncIterate as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + }); + + describe('listScanRuns', () => { + it('invokes listScanRuns without error', async () => { + const client = new websecurityscannerModule.v1.WebSecurityScannerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.websecurityscanner.v1.ListScanRunsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.websecurityscanner.v1.ListScanRunsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.websecurityscanner.v1.ScanRun() + ), + generateSampleMessage( + new protos.google.cloud.websecurityscanner.v1.ScanRun() + ), + generateSampleMessage( + new protos.google.cloud.websecurityscanner.v1.ScanRun() + ), + ]; + client.innerApiCalls.listScanRuns = stubSimpleCall(expectedResponse); + const [response] = await client.listScanRuns(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.listScanRuns as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listScanRuns as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listScanRuns without error using callback', async () => { + const client = new websecurityscannerModule.v1.WebSecurityScannerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.websecurityscanner.v1.ListScanRunsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.websecurityscanner.v1.ListScanRunsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.websecurityscanner.v1.ScanRun() + ), + generateSampleMessage( + new protos.google.cloud.websecurityscanner.v1.ScanRun() + ), + generateSampleMessage( + new protos.google.cloud.websecurityscanner.v1.ScanRun() + ), + ]; + client.innerApiCalls.listScanRuns = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.listScanRuns( + request, + ( + err?: Error | null, + result?: protos.google.cloud.websecurityscanner.v1.IScanRun[] | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.listScanRuns as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listScanRuns as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listScanRuns with error', async () => { + const client = new websecurityscannerModule.v1.WebSecurityScannerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.websecurityscanner.v1.ListScanRunsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.websecurityscanner.v1.ListScanRunsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.listScanRuns = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.listScanRuns(request), expectedError); + const actualRequest = ( + client.innerApiCalls.listScanRuns as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listScanRuns as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listScanRunsStream without error', async () => { + const client = new websecurityscannerModule.v1.WebSecurityScannerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.websecurityscanner.v1.ListScanRunsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.websecurityscanner.v1.ListScanRunsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.websecurityscanner.v1.ScanRun() + ), + generateSampleMessage( + new protos.google.cloud.websecurityscanner.v1.ScanRun() + ), + generateSampleMessage( + new protos.google.cloud.websecurityscanner.v1.ScanRun() + ), + ]; + client.descriptors.page.listScanRuns.createStream = + stubPageStreamingCall(expectedResponse); + const stream = client.listScanRunsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.websecurityscanner.v1.ScanRun[] = + []; + stream.on( + 'data', + (response: protos.google.cloud.websecurityscanner.v1.ScanRun) => { + 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.listScanRuns.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.listScanRuns, request) + ); + assert( + (client.descriptors.page.listScanRuns.createStream as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('invokes listScanRunsStream with error', async () => { + const client = new websecurityscannerModule.v1.WebSecurityScannerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.websecurityscanner.v1.ListScanRunsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.websecurityscanner.v1.ListScanRunsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.descriptors.page.listScanRuns.createStream = stubPageStreamingCall( + undefined, + expectedError + ); + const stream = client.listScanRunsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.websecurityscanner.v1.ScanRun[] = + []; + stream.on( + 'data', + (response: protos.google.cloud.websecurityscanner.v1.ScanRun) => { + responses.push(response); + } + ); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(promise, expectedError); + assert( + (client.descriptors.page.listScanRuns.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.listScanRuns, request) + ); + assert( + (client.descriptors.page.listScanRuns.createStream as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with listScanRuns without error', async () => { + const client = new websecurityscannerModule.v1.WebSecurityScannerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.websecurityscanner.v1.ListScanRunsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.websecurityscanner.v1.ListScanRunsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.websecurityscanner.v1.ScanRun() + ), + generateSampleMessage( + new protos.google.cloud.websecurityscanner.v1.ScanRun() + ), + generateSampleMessage( + new protos.google.cloud.websecurityscanner.v1.ScanRun() + ), + ]; + client.descriptors.page.listScanRuns.asyncIterate = + stubAsyncIterationCall(expectedResponse); + const responses: protos.google.cloud.websecurityscanner.v1.IScanRun[] = + []; + const iterable = client.listScanRunsAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + ( + client.descriptors.page.listScanRuns.asyncIterate as SinonStub + ).getCall(0).args[1], + request + ); + assert( + (client.descriptors.page.listScanRuns.asyncIterate as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with listScanRuns with error', async () => { + const client = new websecurityscannerModule.v1.WebSecurityScannerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.websecurityscanner.v1.ListScanRunsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.websecurityscanner.v1.ListScanRunsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.descriptors.page.listScanRuns.asyncIterate = + stubAsyncIterationCall(undefined, expectedError); + const iterable = client.listScanRunsAsync(request); + await assert.rejects(async () => { + const responses: protos.google.cloud.websecurityscanner.v1.IScanRun[] = + []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + ( + client.descriptors.page.listScanRuns.asyncIterate as SinonStub + ).getCall(0).args[1], + request + ); + assert( + (client.descriptors.page.listScanRuns.asyncIterate as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + }); + + describe('listCrawledUrls', () => { + it('invokes listCrawledUrls without error', async () => { + const client = new websecurityscannerModule.v1.WebSecurityScannerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.websecurityscanner.v1.ListCrawledUrlsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.websecurityscanner.v1.ListCrawledUrlsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.websecurityscanner.v1.CrawledUrl() + ), + generateSampleMessage( + new protos.google.cloud.websecurityscanner.v1.CrawledUrl() + ), + generateSampleMessage( + new protos.google.cloud.websecurityscanner.v1.CrawledUrl() + ), + ]; + client.innerApiCalls.listCrawledUrls = stubSimpleCall(expectedResponse); + const [response] = await client.listCrawledUrls(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.listCrawledUrls as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listCrawledUrls as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listCrawledUrls without error using callback', async () => { + const client = new websecurityscannerModule.v1.WebSecurityScannerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.websecurityscanner.v1.ListCrawledUrlsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.websecurityscanner.v1.ListCrawledUrlsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.websecurityscanner.v1.CrawledUrl() + ), + generateSampleMessage( + new protos.google.cloud.websecurityscanner.v1.CrawledUrl() + ), + generateSampleMessage( + new protos.google.cloud.websecurityscanner.v1.CrawledUrl() + ), + ]; + client.innerApiCalls.listCrawledUrls = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.listCrawledUrls( + request, + ( + err?: Error | null, + result?: + | protos.google.cloud.websecurityscanner.v1.ICrawledUrl[] + | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.listCrawledUrls as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listCrawledUrls as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listCrawledUrls with error', async () => { + const client = new websecurityscannerModule.v1.WebSecurityScannerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.websecurityscanner.v1.ListCrawledUrlsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.websecurityscanner.v1.ListCrawledUrlsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.listCrawledUrls = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.listCrawledUrls(request), expectedError); + const actualRequest = ( + client.innerApiCalls.listCrawledUrls as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listCrawledUrls as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listCrawledUrlsStream without error', async () => { + const client = new websecurityscannerModule.v1.WebSecurityScannerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.websecurityscanner.v1.ListCrawledUrlsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.websecurityscanner.v1.ListCrawledUrlsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.websecurityscanner.v1.CrawledUrl() + ), + generateSampleMessage( + new protos.google.cloud.websecurityscanner.v1.CrawledUrl() + ), + generateSampleMessage( + new protos.google.cloud.websecurityscanner.v1.CrawledUrl() + ), + ]; + client.descriptors.page.listCrawledUrls.createStream = + stubPageStreamingCall(expectedResponse); + const stream = client.listCrawledUrlsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.websecurityscanner.v1.CrawledUrl[] = + []; + stream.on( + 'data', + (response: protos.google.cloud.websecurityscanner.v1.CrawledUrl) => { + 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.listCrawledUrls.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.listCrawledUrls, request) + ); + assert( + (client.descriptors.page.listCrawledUrls.createStream as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('invokes listCrawledUrlsStream with error', async () => { + const client = new websecurityscannerModule.v1.WebSecurityScannerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.websecurityscanner.v1.ListCrawledUrlsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.websecurityscanner.v1.ListCrawledUrlsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.descriptors.page.listCrawledUrls.createStream = + stubPageStreamingCall(undefined, expectedError); + const stream = client.listCrawledUrlsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.websecurityscanner.v1.CrawledUrl[] = + []; + stream.on( + 'data', + (response: protos.google.cloud.websecurityscanner.v1.CrawledUrl) => { + responses.push(response); + } + ); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(promise, expectedError); + assert( + (client.descriptors.page.listCrawledUrls.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.listCrawledUrls, request) + ); + assert( + (client.descriptors.page.listCrawledUrls.createStream as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with listCrawledUrls without error', async () => { + const client = new websecurityscannerModule.v1.WebSecurityScannerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.websecurityscanner.v1.ListCrawledUrlsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.websecurityscanner.v1.ListCrawledUrlsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.websecurityscanner.v1.CrawledUrl() + ), + generateSampleMessage( + new protos.google.cloud.websecurityscanner.v1.CrawledUrl() + ), + generateSampleMessage( + new protos.google.cloud.websecurityscanner.v1.CrawledUrl() + ), + ]; + client.descriptors.page.listCrawledUrls.asyncIterate = + stubAsyncIterationCall(expectedResponse); + const responses: protos.google.cloud.websecurityscanner.v1.ICrawledUrl[] = + []; + const iterable = client.listCrawledUrlsAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + ( + client.descriptors.page.listCrawledUrls.asyncIterate as SinonStub + ).getCall(0).args[1], + request + ); + assert( + (client.descriptors.page.listCrawledUrls.asyncIterate as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with listCrawledUrls with error', async () => { + const client = new websecurityscannerModule.v1.WebSecurityScannerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.websecurityscanner.v1.ListCrawledUrlsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.websecurityscanner.v1.ListCrawledUrlsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.descriptors.page.listCrawledUrls.asyncIterate = + stubAsyncIterationCall(undefined, expectedError); + const iterable = client.listCrawledUrlsAsync(request); + await assert.rejects(async () => { + const responses: protos.google.cloud.websecurityscanner.v1.ICrawledUrl[] = + []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + ( + client.descriptors.page.listCrawledUrls.asyncIterate as SinonStub + ).getCall(0).args[1], + request + ); + assert( + (client.descriptors.page.listCrawledUrls.asyncIterate as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + }); + + describe('listFindings', () => { + it('invokes listFindings without error', async () => { + const client = new websecurityscannerModule.v1.WebSecurityScannerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.websecurityscanner.v1.ListFindingsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.websecurityscanner.v1.ListFindingsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.websecurityscanner.v1.Finding() + ), + generateSampleMessage( + new protos.google.cloud.websecurityscanner.v1.Finding() + ), + generateSampleMessage( + new protos.google.cloud.websecurityscanner.v1.Finding() + ), + ]; + client.innerApiCalls.listFindings = stubSimpleCall(expectedResponse); + const [response] = await client.listFindings(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.listFindings as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listFindings as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listFindings without error using callback', async () => { + const client = new websecurityscannerModule.v1.WebSecurityScannerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.websecurityscanner.v1.ListFindingsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.websecurityscanner.v1.ListFindingsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.websecurityscanner.v1.Finding() + ), + generateSampleMessage( + new protos.google.cloud.websecurityscanner.v1.Finding() + ), + generateSampleMessage( + new protos.google.cloud.websecurityscanner.v1.Finding() + ), + ]; + client.innerApiCalls.listFindings = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.listFindings( + request, + ( + err?: Error | null, + result?: protos.google.cloud.websecurityscanner.v1.IFinding[] | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.listFindings as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listFindings as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listFindings with error', async () => { + const client = new websecurityscannerModule.v1.WebSecurityScannerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.websecurityscanner.v1.ListFindingsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.websecurityscanner.v1.ListFindingsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.listFindings = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.listFindings(request), expectedError); + const actualRequest = ( + client.innerApiCalls.listFindings as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listFindings as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listFindingsStream without error', async () => { + const client = new websecurityscannerModule.v1.WebSecurityScannerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.websecurityscanner.v1.ListFindingsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.websecurityscanner.v1.ListFindingsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.websecurityscanner.v1.Finding() + ), + generateSampleMessage( + new protos.google.cloud.websecurityscanner.v1.Finding() + ), + generateSampleMessage( + new protos.google.cloud.websecurityscanner.v1.Finding() + ), + ]; + client.descriptors.page.listFindings.createStream = + stubPageStreamingCall(expectedResponse); + const stream = client.listFindingsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.websecurityscanner.v1.Finding[] = + []; + stream.on( + 'data', + (response: protos.google.cloud.websecurityscanner.v1.Finding) => { + 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.listFindings.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.listFindings, request) + ); + assert( + (client.descriptors.page.listFindings.createStream as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('invokes listFindingsStream with error', async () => { + const client = new websecurityscannerModule.v1.WebSecurityScannerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.websecurityscanner.v1.ListFindingsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.websecurityscanner.v1.ListFindingsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.descriptors.page.listFindings.createStream = stubPageStreamingCall( + undefined, + expectedError + ); + const stream = client.listFindingsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.websecurityscanner.v1.Finding[] = + []; + stream.on( + 'data', + (response: protos.google.cloud.websecurityscanner.v1.Finding) => { + responses.push(response); + } + ); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(promise, expectedError); + assert( + (client.descriptors.page.listFindings.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.listFindings, request) + ); + assert( + (client.descriptors.page.listFindings.createStream as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with listFindings without error', async () => { + const client = new websecurityscannerModule.v1.WebSecurityScannerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.websecurityscanner.v1.ListFindingsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.websecurityscanner.v1.ListFindingsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.websecurityscanner.v1.Finding() + ), + generateSampleMessage( + new protos.google.cloud.websecurityscanner.v1.Finding() + ), + generateSampleMessage( + new protos.google.cloud.websecurityscanner.v1.Finding() + ), + ]; + client.descriptors.page.listFindings.asyncIterate = + stubAsyncIterationCall(expectedResponse); + const responses: protos.google.cloud.websecurityscanner.v1.IFinding[] = + []; + const iterable = client.listFindingsAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + ( + client.descriptors.page.listFindings.asyncIterate as SinonStub + ).getCall(0).args[1], + request + ); + assert( + (client.descriptors.page.listFindings.asyncIterate as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with listFindings with error', async () => { + const client = new websecurityscannerModule.v1.WebSecurityScannerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.websecurityscanner.v1.ListFindingsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.websecurityscanner.v1.ListFindingsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.descriptors.page.listFindings.asyncIterate = + stubAsyncIterationCall(undefined, expectedError); + const iterable = client.listFindingsAsync(request); + await assert.rejects(async () => { + const responses: protos.google.cloud.websecurityscanner.v1.IFinding[] = + []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + ( + client.descriptors.page.listFindings.asyncIterate as SinonStub + ).getCall(0).args[1], + request + ); + assert( + (client.descriptors.page.listFindings.asyncIterate as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + }); + + describe('Path templates', () => { + describe('finding', () => { + const fakePath = '/rendered/path/finding'; + const expectedParameters = { + project: 'projectValue', + scan_config: 'scanConfigValue', + scan_run: 'scanRunValue', + finding: 'findingValue', + }; + const client = new websecurityscannerModule.v1.WebSecurityScannerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.findingPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.findingPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('findingPath', () => { + const result = client.findingPath( + 'projectValue', + 'scanConfigValue', + 'scanRunValue', + 'findingValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.findingPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromFindingName', () => { + const result = client.matchProjectFromFindingName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.findingPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchScanConfigFromFindingName', () => { + const result = client.matchScanConfigFromFindingName(fakePath); + assert.strictEqual(result, 'scanConfigValue'); + assert( + (client.pathTemplates.findingPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchScanRunFromFindingName', () => { + const result = client.matchScanRunFromFindingName(fakePath); + assert.strictEqual(result, 'scanRunValue'); + assert( + (client.pathTemplates.findingPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchFindingFromFindingName', () => { + const result = client.matchFindingFromFindingName(fakePath); + assert.strictEqual(result, 'findingValue'); + assert( + (client.pathTemplates.findingPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + }); +}); diff --git a/packages/google-cloud-websecurityscanner/test/gapic_web_security_scanner_v1alpha.ts b/packages/google-cloud-websecurityscanner/test/gapic_web_security_scanner_v1alpha.ts new file mode 100644 index 00000000000..838d86eba4e --- /dev/null +++ b/packages/google-cloud-websecurityscanner/test/gapic_web_security_scanner_v1alpha.ts @@ -0,0 +1,3053 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + +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 websecurityscannerModule 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.WebSecurityScannerClient', () => { + describe('Common methods', () => { + it('has servicePath', () => { + const servicePath = + websecurityscannerModule.v1alpha.WebSecurityScannerClient.servicePath; + assert(servicePath); + }); + + it('has apiEndpoint', () => { + const apiEndpoint = + websecurityscannerModule.v1alpha.WebSecurityScannerClient.apiEndpoint; + assert(apiEndpoint); + }); + + it('has port', () => { + const port = + websecurityscannerModule.v1alpha.WebSecurityScannerClient.port; + assert(port); + assert(typeof port === 'number'); + }); + + it('should create a client with no option', () => { + const client = + new websecurityscannerModule.v1alpha.WebSecurityScannerClient(); + assert(client); + }); + + it('should create a client with gRPC fallback', () => { + const client = + new websecurityscannerModule.v1alpha.WebSecurityScannerClient({ + fallback: true, + }); + assert(client); + }); + + it('has initialize method and supports deferred initialization', async () => { + const client = + new websecurityscannerModule.v1alpha.WebSecurityScannerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + assert.strictEqual(client.webSecurityScannerStub, undefined); + await client.initialize(); + assert(client.webSecurityScannerStub); + }); + + it('has close method for the initialized client', done => { + const client = + new websecurityscannerModule.v1alpha.WebSecurityScannerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + assert(client.webSecurityScannerStub); + client.close().then(() => { + done(); + }); + }); + + it('has close method for the non-initialized client', done => { + const client = + new websecurityscannerModule.v1alpha.WebSecurityScannerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + assert.strictEqual(client.webSecurityScannerStub, undefined); + client.close().then(() => { + done(); + }); + }); + + it('has getProjectId method', async () => { + const fakeProjectId = 'fake-project-id'; + const client = + new websecurityscannerModule.v1alpha.WebSecurityScannerClient({ + 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 websecurityscannerModule.v1alpha.WebSecurityScannerClient({ + 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('createScanConfig', () => { + it('invokes createScanConfig without error', async () => { + const client = + new websecurityscannerModule.v1alpha.WebSecurityScannerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.websecurityscanner.v1alpha.CreateScanConfigRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.websecurityscanner.v1alpha.CreateScanConfigRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.websecurityscanner.v1alpha.ScanConfig() + ); + client.innerApiCalls.createScanConfig = stubSimpleCall(expectedResponse); + const [response] = await client.createScanConfig(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.createScanConfig as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createScanConfig as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createScanConfig without error using callback', async () => { + const client = + new websecurityscannerModule.v1alpha.WebSecurityScannerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.websecurityscanner.v1alpha.CreateScanConfigRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.websecurityscanner.v1alpha.CreateScanConfigRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.websecurityscanner.v1alpha.ScanConfig() + ); + client.innerApiCalls.createScanConfig = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.createScanConfig( + request, + ( + err?: Error | null, + result?: protos.google.cloud.websecurityscanner.v1alpha.IScanConfig | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.createScanConfig as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createScanConfig as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createScanConfig with error', async () => { + const client = + new websecurityscannerModule.v1alpha.WebSecurityScannerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.websecurityscanner.v1alpha.CreateScanConfigRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.websecurityscanner.v1alpha.CreateScanConfigRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.createScanConfig = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.createScanConfig(request), expectedError); + const actualRequest = ( + client.innerApiCalls.createScanConfig as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createScanConfig as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createScanConfig with closed client', async () => { + const client = + new websecurityscannerModule.v1alpha.WebSecurityScannerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.websecurityscanner.v1alpha.CreateScanConfigRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.websecurityscanner.v1alpha.CreateScanConfigRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.createScanConfig(request), expectedError); + }); + }); + + describe('deleteScanConfig', () => { + it('invokes deleteScanConfig without error', async () => { + const client = + new websecurityscannerModule.v1alpha.WebSecurityScannerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.websecurityscanner.v1alpha.DeleteScanConfigRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.websecurityscanner.v1alpha.DeleteScanConfigRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty() + ); + client.innerApiCalls.deleteScanConfig = stubSimpleCall(expectedResponse); + const [response] = await client.deleteScanConfig(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.deleteScanConfig as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteScanConfig as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteScanConfig without error using callback', async () => { + const client = + new websecurityscannerModule.v1alpha.WebSecurityScannerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.websecurityscanner.v1alpha.DeleteScanConfigRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.websecurityscanner.v1alpha.DeleteScanConfigRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty() + ); + client.innerApiCalls.deleteScanConfig = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.deleteScanConfig( + 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.deleteScanConfig as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteScanConfig as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteScanConfig with error', async () => { + const client = + new websecurityscannerModule.v1alpha.WebSecurityScannerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.websecurityscanner.v1alpha.DeleteScanConfigRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.websecurityscanner.v1alpha.DeleteScanConfigRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.deleteScanConfig = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.deleteScanConfig(request), expectedError); + const actualRequest = ( + client.innerApiCalls.deleteScanConfig as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteScanConfig as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteScanConfig with closed client', async () => { + const client = + new websecurityscannerModule.v1alpha.WebSecurityScannerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.websecurityscanner.v1alpha.DeleteScanConfigRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.websecurityscanner.v1alpha.DeleteScanConfigRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.deleteScanConfig(request), expectedError); + }); + }); + + describe('getScanConfig', () => { + it('invokes getScanConfig without error', async () => { + const client = + new websecurityscannerModule.v1alpha.WebSecurityScannerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.websecurityscanner.v1alpha.GetScanConfigRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.websecurityscanner.v1alpha.GetScanConfigRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.websecurityscanner.v1alpha.ScanConfig() + ); + client.innerApiCalls.getScanConfig = stubSimpleCall(expectedResponse); + const [response] = await client.getScanConfig(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.getScanConfig as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getScanConfig as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getScanConfig without error using callback', async () => { + const client = + new websecurityscannerModule.v1alpha.WebSecurityScannerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.websecurityscanner.v1alpha.GetScanConfigRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.websecurityscanner.v1alpha.GetScanConfigRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.websecurityscanner.v1alpha.ScanConfig() + ); + client.innerApiCalls.getScanConfig = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getScanConfig( + request, + ( + err?: Error | null, + result?: protos.google.cloud.websecurityscanner.v1alpha.IScanConfig | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.getScanConfig as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getScanConfig as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getScanConfig with error', async () => { + const client = + new websecurityscannerModule.v1alpha.WebSecurityScannerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.websecurityscanner.v1alpha.GetScanConfigRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.websecurityscanner.v1alpha.GetScanConfigRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.getScanConfig = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.getScanConfig(request), expectedError); + const actualRequest = ( + client.innerApiCalls.getScanConfig as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getScanConfig as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getScanConfig with closed client', async () => { + const client = + new websecurityscannerModule.v1alpha.WebSecurityScannerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.websecurityscanner.v1alpha.GetScanConfigRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.websecurityscanner.v1alpha.GetScanConfigRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.getScanConfig(request), expectedError); + }); + }); + + describe('updateScanConfig', () => { + it('invokes updateScanConfig without error', async () => { + const client = + new websecurityscannerModule.v1alpha.WebSecurityScannerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.websecurityscanner.v1alpha.UpdateScanConfigRequest() + ); + request.scanConfig ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.websecurityscanner.v1alpha.UpdateScanConfigRequest', + ['scanConfig', 'name'] + ); + request.scanConfig.name = defaultValue1; + const expectedHeaderRequestParams = `scan_config.name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.websecurityscanner.v1alpha.ScanConfig() + ); + client.innerApiCalls.updateScanConfig = stubSimpleCall(expectedResponse); + const [response] = await client.updateScanConfig(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.updateScanConfig as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateScanConfig as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateScanConfig without error using callback', async () => { + const client = + new websecurityscannerModule.v1alpha.WebSecurityScannerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.websecurityscanner.v1alpha.UpdateScanConfigRequest() + ); + request.scanConfig ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.websecurityscanner.v1alpha.UpdateScanConfigRequest', + ['scanConfig', 'name'] + ); + request.scanConfig.name = defaultValue1; + const expectedHeaderRequestParams = `scan_config.name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.websecurityscanner.v1alpha.ScanConfig() + ); + client.innerApiCalls.updateScanConfig = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.updateScanConfig( + request, + ( + err?: Error | null, + result?: protos.google.cloud.websecurityscanner.v1alpha.IScanConfig | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.updateScanConfig as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateScanConfig as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateScanConfig with error', async () => { + const client = + new websecurityscannerModule.v1alpha.WebSecurityScannerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.websecurityscanner.v1alpha.UpdateScanConfigRequest() + ); + request.scanConfig ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.websecurityscanner.v1alpha.UpdateScanConfigRequest', + ['scanConfig', 'name'] + ); + request.scanConfig.name = defaultValue1; + const expectedHeaderRequestParams = `scan_config.name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.updateScanConfig = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.updateScanConfig(request), expectedError); + const actualRequest = ( + client.innerApiCalls.updateScanConfig as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateScanConfig as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateScanConfig with closed client', async () => { + const client = + new websecurityscannerModule.v1alpha.WebSecurityScannerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.websecurityscanner.v1alpha.UpdateScanConfigRequest() + ); + request.scanConfig ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.websecurityscanner.v1alpha.UpdateScanConfigRequest', + ['scanConfig', 'name'] + ); + request.scanConfig.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.updateScanConfig(request), expectedError); + }); + }); + + describe('startScanRun', () => { + it('invokes startScanRun without error', async () => { + const client = + new websecurityscannerModule.v1alpha.WebSecurityScannerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.websecurityscanner.v1alpha.StartScanRunRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.websecurityscanner.v1alpha.StartScanRunRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.websecurityscanner.v1alpha.ScanRun() + ); + client.innerApiCalls.startScanRun = stubSimpleCall(expectedResponse); + const [response] = await client.startScanRun(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.startScanRun as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.startScanRun as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes startScanRun without error using callback', async () => { + const client = + new websecurityscannerModule.v1alpha.WebSecurityScannerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.websecurityscanner.v1alpha.StartScanRunRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.websecurityscanner.v1alpha.StartScanRunRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.websecurityscanner.v1alpha.ScanRun() + ); + client.innerApiCalls.startScanRun = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.startScanRun( + request, + ( + err?: Error | null, + result?: protos.google.cloud.websecurityscanner.v1alpha.IScanRun | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.startScanRun as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.startScanRun as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes startScanRun with error', async () => { + const client = + new websecurityscannerModule.v1alpha.WebSecurityScannerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.websecurityscanner.v1alpha.StartScanRunRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.websecurityscanner.v1alpha.StartScanRunRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.startScanRun = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.startScanRun(request), expectedError); + const actualRequest = ( + client.innerApiCalls.startScanRun as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.startScanRun as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes startScanRun with closed client', async () => { + const client = + new websecurityscannerModule.v1alpha.WebSecurityScannerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.websecurityscanner.v1alpha.StartScanRunRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.websecurityscanner.v1alpha.StartScanRunRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.startScanRun(request), expectedError); + }); + }); + + describe('getScanRun', () => { + it('invokes getScanRun without error', async () => { + const client = + new websecurityscannerModule.v1alpha.WebSecurityScannerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.websecurityscanner.v1alpha.GetScanRunRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.websecurityscanner.v1alpha.GetScanRunRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.websecurityscanner.v1alpha.ScanRun() + ); + client.innerApiCalls.getScanRun = stubSimpleCall(expectedResponse); + const [response] = await client.getScanRun(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.getScanRun as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getScanRun as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getScanRun without error using callback', async () => { + const client = + new websecurityscannerModule.v1alpha.WebSecurityScannerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.websecurityscanner.v1alpha.GetScanRunRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.websecurityscanner.v1alpha.GetScanRunRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.websecurityscanner.v1alpha.ScanRun() + ); + client.innerApiCalls.getScanRun = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getScanRun( + request, + ( + err?: Error | null, + result?: protos.google.cloud.websecurityscanner.v1alpha.IScanRun | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.getScanRun as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getScanRun as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getScanRun with error', async () => { + const client = + new websecurityscannerModule.v1alpha.WebSecurityScannerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.websecurityscanner.v1alpha.GetScanRunRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.websecurityscanner.v1alpha.GetScanRunRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.getScanRun = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.getScanRun(request), expectedError); + const actualRequest = ( + client.innerApiCalls.getScanRun as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getScanRun as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getScanRun with closed client', async () => { + const client = + new websecurityscannerModule.v1alpha.WebSecurityScannerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.websecurityscanner.v1alpha.GetScanRunRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.websecurityscanner.v1alpha.GetScanRunRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.getScanRun(request), expectedError); + }); + }); + + describe('stopScanRun', () => { + it('invokes stopScanRun without error', async () => { + const client = + new websecurityscannerModule.v1alpha.WebSecurityScannerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.websecurityscanner.v1alpha.StopScanRunRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.websecurityscanner.v1alpha.StopScanRunRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.websecurityscanner.v1alpha.ScanRun() + ); + client.innerApiCalls.stopScanRun = stubSimpleCall(expectedResponse); + const [response] = await client.stopScanRun(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.stopScanRun as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.stopScanRun as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes stopScanRun without error using callback', async () => { + const client = + new websecurityscannerModule.v1alpha.WebSecurityScannerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.websecurityscanner.v1alpha.StopScanRunRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.websecurityscanner.v1alpha.StopScanRunRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.websecurityscanner.v1alpha.ScanRun() + ); + client.innerApiCalls.stopScanRun = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.stopScanRun( + request, + ( + err?: Error | null, + result?: protos.google.cloud.websecurityscanner.v1alpha.IScanRun | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.stopScanRun as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.stopScanRun as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes stopScanRun with error', async () => { + const client = + new websecurityscannerModule.v1alpha.WebSecurityScannerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.websecurityscanner.v1alpha.StopScanRunRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.websecurityscanner.v1alpha.StopScanRunRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.stopScanRun = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.stopScanRun(request), expectedError); + const actualRequest = ( + client.innerApiCalls.stopScanRun as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.stopScanRun as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes stopScanRun with closed client', async () => { + const client = + new websecurityscannerModule.v1alpha.WebSecurityScannerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.websecurityscanner.v1alpha.StopScanRunRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.websecurityscanner.v1alpha.StopScanRunRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.stopScanRun(request), expectedError); + }); + }); + + describe('getFinding', () => { + it('invokes getFinding without error', async () => { + const client = + new websecurityscannerModule.v1alpha.WebSecurityScannerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.websecurityscanner.v1alpha.GetFindingRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.websecurityscanner.v1alpha.GetFindingRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.websecurityscanner.v1alpha.Finding() + ); + client.innerApiCalls.getFinding = stubSimpleCall(expectedResponse); + const [response] = await client.getFinding(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.getFinding as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getFinding as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getFinding without error using callback', async () => { + const client = + new websecurityscannerModule.v1alpha.WebSecurityScannerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.websecurityscanner.v1alpha.GetFindingRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.websecurityscanner.v1alpha.GetFindingRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.websecurityscanner.v1alpha.Finding() + ); + client.innerApiCalls.getFinding = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getFinding( + request, + ( + err?: Error | null, + result?: protos.google.cloud.websecurityscanner.v1alpha.IFinding | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.getFinding as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getFinding as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getFinding with error', async () => { + const client = + new websecurityscannerModule.v1alpha.WebSecurityScannerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.websecurityscanner.v1alpha.GetFindingRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.websecurityscanner.v1alpha.GetFindingRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.getFinding = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.getFinding(request), expectedError); + const actualRequest = ( + client.innerApiCalls.getFinding as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getFinding as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getFinding with closed client', async () => { + const client = + new websecurityscannerModule.v1alpha.WebSecurityScannerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.websecurityscanner.v1alpha.GetFindingRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.websecurityscanner.v1alpha.GetFindingRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.getFinding(request), expectedError); + }); + }); + + describe('listFindingTypeStats', () => { + it('invokes listFindingTypeStats without error', async () => { + const client = + new websecurityscannerModule.v1alpha.WebSecurityScannerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.websecurityscanner.v1alpha.ListFindingTypeStatsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.websecurityscanner.v1alpha.ListFindingTypeStatsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.websecurityscanner.v1alpha.ListFindingTypeStatsResponse() + ); + client.innerApiCalls.listFindingTypeStats = + stubSimpleCall(expectedResponse); + const [response] = await client.listFindingTypeStats(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.listFindingTypeStats as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listFindingTypeStats as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listFindingTypeStats without error using callback', async () => { + const client = + new websecurityscannerModule.v1alpha.WebSecurityScannerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.websecurityscanner.v1alpha.ListFindingTypeStatsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.websecurityscanner.v1alpha.ListFindingTypeStatsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.websecurityscanner.v1alpha.ListFindingTypeStatsResponse() + ); + client.innerApiCalls.listFindingTypeStats = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.listFindingTypeStats( + request, + ( + err?: Error | null, + result?: protos.google.cloud.websecurityscanner.v1alpha.IListFindingTypeStatsResponse | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.listFindingTypeStats as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listFindingTypeStats as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listFindingTypeStats with error', async () => { + const client = + new websecurityscannerModule.v1alpha.WebSecurityScannerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.websecurityscanner.v1alpha.ListFindingTypeStatsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.websecurityscanner.v1alpha.ListFindingTypeStatsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.listFindingTypeStats = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.listFindingTypeStats(request), expectedError); + const actualRequest = ( + client.innerApiCalls.listFindingTypeStats as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listFindingTypeStats as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listFindingTypeStats with closed client', async () => { + const client = + new websecurityscannerModule.v1alpha.WebSecurityScannerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.websecurityscanner.v1alpha.ListFindingTypeStatsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.websecurityscanner.v1alpha.ListFindingTypeStatsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.listFindingTypeStats(request), expectedError); + }); + }); + + describe('listScanConfigs', () => { + it('invokes listScanConfigs without error', async () => { + const client = + new websecurityscannerModule.v1alpha.WebSecurityScannerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.websecurityscanner.v1alpha.ListScanConfigsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.websecurityscanner.v1alpha.ListScanConfigsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.websecurityscanner.v1alpha.ScanConfig() + ), + generateSampleMessage( + new protos.google.cloud.websecurityscanner.v1alpha.ScanConfig() + ), + generateSampleMessage( + new protos.google.cloud.websecurityscanner.v1alpha.ScanConfig() + ), + ]; + client.innerApiCalls.listScanConfigs = stubSimpleCall(expectedResponse); + const [response] = await client.listScanConfigs(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.listScanConfigs as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listScanConfigs as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listScanConfigs without error using callback', async () => { + const client = + new websecurityscannerModule.v1alpha.WebSecurityScannerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.websecurityscanner.v1alpha.ListScanConfigsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.websecurityscanner.v1alpha.ListScanConfigsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.websecurityscanner.v1alpha.ScanConfig() + ), + generateSampleMessage( + new protos.google.cloud.websecurityscanner.v1alpha.ScanConfig() + ), + generateSampleMessage( + new protos.google.cloud.websecurityscanner.v1alpha.ScanConfig() + ), + ]; + client.innerApiCalls.listScanConfigs = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.listScanConfigs( + request, + ( + err?: Error | null, + result?: + | protos.google.cloud.websecurityscanner.v1alpha.IScanConfig[] + | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.listScanConfigs as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listScanConfigs as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listScanConfigs with error', async () => { + const client = + new websecurityscannerModule.v1alpha.WebSecurityScannerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.websecurityscanner.v1alpha.ListScanConfigsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.websecurityscanner.v1alpha.ListScanConfigsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.listScanConfigs = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.listScanConfigs(request), expectedError); + const actualRequest = ( + client.innerApiCalls.listScanConfigs as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listScanConfigs as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listScanConfigsStream without error', async () => { + const client = + new websecurityscannerModule.v1alpha.WebSecurityScannerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.websecurityscanner.v1alpha.ListScanConfigsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.websecurityscanner.v1alpha.ListScanConfigsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.websecurityscanner.v1alpha.ScanConfig() + ), + generateSampleMessage( + new protos.google.cloud.websecurityscanner.v1alpha.ScanConfig() + ), + generateSampleMessage( + new protos.google.cloud.websecurityscanner.v1alpha.ScanConfig() + ), + ]; + client.descriptors.page.listScanConfigs.createStream = + stubPageStreamingCall(expectedResponse); + const stream = client.listScanConfigsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.websecurityscanner.v1alpha.ScanConfig[] = + []; + stream.on( + 'data', + ( + response: protos.google.cloud.websecurityscanner.v1alpha.ScanConfig + ) => { + 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.listScanConfigs.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.listScanConfigs, request) + ); + assert( + (client.descriptors.page.listScanConfigs.createStream as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('invokes listScanConfigsStream with error', async () => { + const client = + new websecurityscannerModule.v1alpha.WebSecurityScannerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.websecurityscanner.v1alpha.ListScanConfigsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.websecurityscanner.v1alpha.ListScanConfigsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.descriptors.page.listScanConfigs.createStream = + stubPageStreamingCall(undefined, expectedError); + const stream = client.listScanConfigsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.websecurityscanner.v1alpha.ScanConfig[] = + []; + stream.on( + 'data', + ( + response: protos.google.cloud.websecurityscanner.v1alpha.ScanConfig + ) => { + responses.push(response); + } + ); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(promise, expectedError); + assert( + (client.descriptors.page.listScanConfigs.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.listScanConfigs, request) + ); + assert( + (client.descriptors.page.listScanConfigs.createStream as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with listScanConfigs without error', async () => { + const client = + new websecurityscannerModule.v1alpha.WebSecurityScannerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.websecurityscanner.v1alpha.ListScanConfigsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.websecurityscanner.v1alpha.ListScanConfigsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.websecurityscanner.v1alpha.ScanConfig() + ), + generateSampleMessage( + new protos.google.cloud.websecurityscanner.v1alpha.ScanConfig() + ), + generateSampleMessage( + new protos.google.cloud.websecurityscanner.v1alpha.ScanConfig() + ), + ]; + client.descriptors.page.listScanConfigs.asyncIterate = + stubAsyncIterationCall(expectedResponse); + const responses: protos.google.cloud.websecurityscanner.v1alpha.IScanConfig[] = + []; + const iterable = client.listScanConfigsAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + ( + client.descriptors.page.listScanConfigs.asyncIterate as SinonStub + ).getCall(0).args[1], + request + ); + assert( + (client.descriptors.page.listScanConfigs.asyncIterate as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with listScanConfigs with error', async () => { + const client = + new websecurityscannerModule.v1alpha.WebSecurityScannerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.websecurityscanner.v1alpha.ListScanConfigsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.websecurityscanner.v1alpha.ListScanConfigsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.descriptors.page.listScanConfigs.asyncIterate = + stubAsyncIterationCall(undefined, expectedError); + const iterable = client.listScanConfigsAsync(request); + await assert.rejects(async () => { + const responses: protos.google.cloud.websecurityscanner.v1alpha.IScanConfig[] = + []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + ( + client.descriptors.page.listScanConfigs.asyncIterate as SinonStub + ).getCall(0).args[1], + request + ); + assert( + (client.descriptors.page.listScanConfigs.asyncIterate as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + }); + + describe('listScanRuns', () => { + it('invokes listScanRuns without error', async () => { + const client = + new websecurityscannerModule.v1alpha.WebSecurityScannerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.websecurityscanner.v1alpha.ListScanRunsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.websecurityscanner.v1alpha.ListScanRunsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.websecurityscanner.v1alpha.ScanRun() + ), + generateSampleMessage( + new protos.google.cloud.websecurityscanner.v1alpha.ScanRun() + ), + generateSampleMessage( + new protos.google.cloud.websecurityscanner.v1alpha.ScanRun() + ), + ]; + client.innerApiCalls.listScanRuns = stubSimpleCall(expectedResponse); + const [response] = await client.listScanRuns(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.listScanRuns as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listScanRuns as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listScanRuns without error using callback', async () => { + const client = + new websecurityscannerModule.v1alpha.WebSecurityScannerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.websecurityscanner.v1alpha.ListScanRunsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.websecurityscanner.v1alpha.ListScanRunsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.websecurityscanner.v1alpha.ScanRun() + ), + generateSampleMessage( + new protos.google.cloud.websecurityscanner.v1alpha.ScanRun() + ), + generateSampleMessage( + new protos.google.cloud.websecurityscanner.v1alpha.ScanRun() + ), + ]; + client.innerApiCalls.listScanRuns = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.listScanRuns( + request, + ( + err?: Error | null, + result?: + | protos.google.cloud.websecurityscanner.v1alpha.IScanRun[] + | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.listScanRuns as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listScanRuns as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listScanRuns with error', async () => { + const client = + new websecurityscannerModule.v1alpha.WebSecurityScannerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.websecurityscanner.v1alpha.ListScanRunsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.websecurityscanner.v1alpha.ListScanRunsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.listScanRuns = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.listScanRuns(request), expectedError); + const actualRequest = ( + client.innerApiCalls.listScanRuns as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listScanRuns as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listScanRunsStream without error', async () => { + const client = + new websecurityscannerModule.v1alpha.WebSecurityScannerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.websecurityscanner.v1alpha.ListScanRunsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.websecurityscanner.v1alpha.ListScanRunsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.websecurityscanner.v1alpha.ScanRun() + ), + generateSampleMessage( + new protos.google.cloud.websecurityscanner.v1alpha.ScanRun() + ), + generateSampleMessage( + new protos.google.cloud.websecurityscanner.v1alpha.ScanRun() + ), + ]; + client.descriptors.page.listScanRuns.createStream = + stubPageStreamingCall(expectedResponse); + const stream = client.listScanRunsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.websecurityscanner.v1alpha.ScanRun[] = + []; + stream.on( + 'data', + ( + response: protos.google.cloud.websecurityscanner.v1alpha.ScanRun + ) => { + 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.listScanRuns.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.listScanRuns, request) + ); + assert( + (client.descriptors.page.listScanRuns.createStream as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('invokes listScanRunsStream with error', async () => { + const client = + new websecurityscannerModule.v1alpha.WebSecurityScannerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.websecurityscanner.v1alpha.ListScanRunsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.websecurityscanner.v1alpha.ListScanRunsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.descriptors.page.listScanRuns.createStream = stubPageStreamingCall( + undefined, + expectedError + ); + const stream = client.listScanRunsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.websecurityscanner.v1alpha.ScanRun[] = + []; + stream.on( + 'data', + ( + response: protos.google.cloud.websecurityscanner.v1alpha.ScanRun + ) => { + responses.push(response); + } + ); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(promise, expectedError); + assert( + (client.descriptors.page.listScanRuns.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.listScanRuns, request) + ); + assert( + (client.descriptors.page.listScanRuns.createStream as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with listScanRuns without error', async () => { + const client = + new websecurityscannerModule.v1alpha.WebSecurityScannerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.websecurityscanner.v1alpha.ListScanRunsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.websecurityscanner.v1alpha.ListScanRunsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.websecurityscanner.v1alpha.ScanRun() + ), + generateSampleMessage( + new protos.google.cloud.websecurityscanner.v1alpha.ScanRun() + ), + generateSampleMessage( + new protos.google.cloud.websecurityscanner.v1alpha.ScanRun() + ), + ]; + client.descriptors.page.listScanRuns.asyncIterate = + stubAsyncIterationCall(expectedResponse); + const responses: protos.google.cloud.websecurityscanner.v1alpha.IScanRun[] = + []; + const iterable = client.listScanRunsAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + ( + client.descriptors.page.listScanRuns.asyncIterate as SinonStub + ).getCall(0).args[1], + request + ); + assert( + (client.descriptors.page.listScanRuns.asyncIterate as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with listScanRuns with error', async () => { + const client = + new websecurityscannerModule.v1alpha.WebSecurityScannerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.websecurityscanner.v1alpha.ListScanRunsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.websecurityscanner.v1alpha.ListScanRunsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.descriptors.page.listScanRuns.asyncIterate = + stubAsyncIterationCall(undefined, expectedError); + const iterable = client.listScanRunsAsync(request); + await assert.rejects(async () => { + const responses: protos.google.cloud.websecurityscanner.v1alpha.IScanRun[] = + []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + ( + client.descriptors.page.listScanRuns.asyncIterate as SinonStub + ).getCall(0).args[1], + request + ); + assert( + (client.descriptors.page.listScanRuns.asyncIterate as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + }); + + describe('listCrawledUrls', () => { + it('invokes listCrawledUrls without error', async () => { + const client = + new websecurityscannerModule.v1alpha.WebSecurityScannerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.websecurityscanner.v1alpha.ListCrawledUrlsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.websecurityscanner.v1alpha.ListCrawledUrlsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.websecurityscanner.v1alpha.CrawledUrl() + ), + generateSampleMessage( + new protos.google.cloud.websecurityscanner.v1alpha.CrawledUrl() + ), + generateSampleMessage( + new protos.google.cloud.websecurityscanner.v1alpha.CrawledUrl() + ), + ]; + client.innerApiCalls.listCrawledUrls = stubSimpleCall(expectedResponse); + const [response] = await client.listCrawledUrls(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.listCrawledUrls as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listCrawledUrls as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listCrawledUrls without error using callback', async () => { + const client = + new websecurityscannerModule.v1alpha.WebSecurityScannerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.websecurityscanner.v1alpha.ListCrawledUrlsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.websecurityscanner.v1alpha.ListCrawledUrlsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.websecurityscanner.v1alpha.CrawledUrl() + ), + generateSampleMessage( + new protos.google.cloud.websecurityscanner.v1alpha.CrawledUrl() + ), + generateSampleMessage( + new protos.google.cloud.websecurityscanner.v1alpha.CrawledUrl() + ), + ]; + client.innerApiCalls.listCrawledUrls = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.listCrawledUrls( + request, + ( + err?: Error | null, + result?: + | protos.google.cloud.websecurityscanner.v1alpha.ICrawledUrl[] + | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.listCrawledUrls as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listCrawledUrls as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listCrawledUrls with error', async () => { + const client = + new websecurityscannerModule.v1alpha.WebSecurityScannerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.websecurityscanner.v1alpha.ListCrawledUrlsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.websecurityscanner.v1alpha.ListCrawledUrlsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.listCrawledUrls = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.listCrawledUrls(request), expectedError); + const actualRequest = ( + client.innerApiCalls.listCrawledUrls as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listCrawledUrls as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listCrawledUrlsStream without error', async () => { + const client = + new websecurityscannerModule.v1alpha.WebSecurityScannerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.websecurityscanner.v1alpha.ListCrawledUrlsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.websecurityscanner.v1alpha.ListCrawledUrlsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.websecurityscanner.v1alpha.CrawledUrl() + ), + generateSampleMessage( + new protos.google.cloud.websecurityscanner.v1alpha.CrawledUrl() + ), + generateSampleMessage( + new protos.google.cloud.websecurityscanner.v1alpha.CrawledUrl() + ), + ]; + client.descriptors.page.listCrawledUrls.createStream = + stubPageStreamingCall(expectedResponse); + const stream = client.listCrawledUrlsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.websecurityscanner.v1alpha.CrawledUrl[] = + []; + stream.on( + 'data', + ( + response: protos.google.cloud.websecurityscanner.v1alpha.CrawledUrl + ) => { + 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.listCrawledUrls.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.listCrawledUrls, request) + ); + assert( + (client.descriptors.page.listCrawledUrls.createStream as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('invokes listCrawledUrlsStream with error', async () => { + const client = + new websecurityscannerModule.v1alpha.WebSecurityScannerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.websecurityscanner.v1alpha.ListCrawledUrlsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.websecurityscanner.v1alpha.ListCrawledUrlsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.descriptors.page.listCrawledUrls.createStream = + stubPageStreamingCall(undefined, expectedError); + const stream = client.listCrawledUrlsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.websecurityscanner.v1alpha.CrawledUrl[] = + []; + stream.on( + 'data', + ( + response: protos.google.cloud.websecurityscanner.v1alpha.CrawledUrl + ) => { + responses.push(response); + } + ); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(promise, expectedError); + assert( + (client.descriptors.page.listCrawledUrls.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.listCrawledUrls, request) + ); + assert( + (client.descriptors.page.listCrawledUrls.createStream as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with listCrawledUrls without error', async () => { + const client = + new websecurityscannerModule.v1alpha.WebSecurityScannerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.websecurityscanner.v1alpha.ListCrawledUrlsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.websecurityscanner.v1alpha.ListCrawledUrlsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.websecurityscanner.v1alpha.CrawledUrl() + ), + generateSampleMessage( + new protos.google.cloud.websecurityscanner.v1alpha.CrawledUrl() + ), + generateSampleMessage( + new protos.google.cloud.websecurityscanner.v1alpha.CrawledUrl() + ), + ]; + client.descriptors.page.listCrawledUrls.asyncIterate = + stubAsyncIterationCall(expectedResponse); + const responses: protos.google.cloud.websecurityscanner.v1alpha.ICrawledUrl[] = + []; + const iterable = client.listCrawledUrlsAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + ( + client.descriptors.page.listCrawledUrls.asyncIterate as SinonStub + ).getCall(0).args[1], + request + ); + assert( + (client.descriptors.page.listCrawledUrls.asyncIterate as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with listCrawledUrls with error', async () => { + const client = + new websecurityscannerModule.v1alpha.WebSecurityScannerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.websecurityscanner.v1alpha.ListCrawledUrlsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.websecurityscanner.v1alpha.ListCrawledUrlsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.descriptors.page.listCrawledUrls.asyncIterate = + stubAsyncIterationCall(undefined, expectedError); + const iterable = client.listCrawledUrlsAsync(request); + await assert.rejects(async () => { + const responses: protos.google.cloud.websecurityscanner.v1alpha.ICrawledUrl[] = + []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + ( + client.descriptors.page.listCrawledUrls.asyncIterate as SinonStub + ).getCall(0).args[1], + request + ); + assert( + (client.descriptors.page.listCrawledUrls.asyncIterate as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + }); + + describe('listFindings', () => { + it('invokes listFindings without error', async () => { + const client = + new websecurityscannerModule.v1alpha.WebSecurityScannerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.websecurityscanner.v1alpha.ListFindingsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.websecurityscanner.v1alpha.ListFindingsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.websecurityscanner.v1alpha.Finding() + ), + generateSampleMessage( + new protos.google.cloud.websecurityscanner.v1alpha.Finding() + ), + generateSampleMessage( + new protos.google.cloud.websecurityscanner.v1alpha.Finding() + ), + ]; + client.innerApiCalls.listFindings = stubSimpleCall(expectedResponse); + const [response] = await client.listFindings(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.listFindings as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listFindings as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listFindings without error using callback', async () => { + const client = + new websecurityscannerModule.v1alpha.WebSecurityScannerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.websecurityscanner.v1alpha.ListFindingsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.websecurityscanner.v1alpha.ListFindingsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.websecurityscanner.v1alpha.Finding() + ), + generateSampleMessage( + new protos.google.cloud.websecurityscanner.v1alpha.Finding() + ), + generateSampleMessage( + new protos.google.cloud.websecurityscanner.v1alpha.Finding() + ), + ]; + client.innerApiCalls.listFindings = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.listFindings( + request, + ( + err?: Error | null, + result?: + | protos.google.cloud.websecurityscanner.v1alpha.IFinding[] + | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.listFindings as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listFindings as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listFindings with error', async () => { + const client = + new websecurityscannerModule.v1alpha.WebSecurityScannerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.websecurityscanner.v1alpha.ListFindingsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.websecurityscanner.v1alpha.ListFindingsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.listFindings = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.listFindings(request), expectedError); + const actualRequest = ( + client.innerApiCalls.listFindings as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listFindings as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listFindingsStream without error', async () => { + const client = + new websecurityscannerModule.v1alpha.WebSecurityScannerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.websecurityscanner.v1alpha.ListFindingsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.websecurityscanner.v1alpha.ListFindingsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.websecurityscanner.v1alpha.Finding() + ), + generateSampleMessage( + new protos.google.cloud.websecurityscanner.v1alpha.Finding() + ), + generateSampleMessage( + new protos.google.cloud.websecurityscanner.v1alpha.Finding() + ), + ]; + client.descriptors.page.listFindings.createStream = + stubPageStreamingCall(expectedResponse); + const stream = client.listFindingsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.websecurityscanner.v1alpha.Finding[] = + []; + stream.on( + 'data', + ( + response: protos.google.cloud.websecurityscanner.v1alpha.Finding + ) => { + 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.listFindings.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.listFindings, request) + ); + assert( + (client.descriptors.page.listFindings.createStream as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('invokes listFindingsStream with error', async () => { + const client = + new websecurityscannerModule.v1alpha.WebSecurityScannerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.websecurityscanner.v1alpha.ListFindingsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.websecurityscanner.v1alpha.ListFindingsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.descriptors.page.listFindings.createStream = stubPageStreamingCall( + undefined, + expectedError + ); + const stream = client.listFindingsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.websecurityscanner.v1alpha.Finding[] = + []; + stream.on( + 'data', + ( + response: protos.google.cloud.websecurityscanner.v1alpha.Finding + ) => { + responses.push(response); + } + ); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(promise, expectedError); + assert( + (client.descriptors.page.listFindings.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.listFindings, request) + ); + assert( + (client.descriptors.page.listFindings.createStream as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with listFindings without error', async () => { + const client = + new websecurityscannerModule.v1alpha.WebSecurityScannerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.websecurityscanner.v1alpha.ListFindingsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.websecurityscanner.v1alpha.ListFindingsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.websecurityscanner.v1alpha.Finding() + ), + generateSampleMessage( + new protos.google.cloud.websecurityscanner.v1alpha.Finding() + ), + generateSampleMessage( + new protos.google.cloud.websecurityscanner.v1alpha.Finding() + ), + ]; + client.descriptors.page.listFindings.asyncIterate = + stubAsyncIterationCall(expectedResponse); + const responses: protos.google.cloud.websecurityscanner.v1alpha.IFinding[] = + []; + const iterable = client.listFindingsAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + ( + client.descriptors.page.listFindings.asyncIterate as SinonStub + ).getCall(0).args[1], + request + ); + assert( + (client.descriptors.page.listFindings.asyncIterate as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with listFindings with error', async () => { + const client = + new websecurityscannerModule.v1alpha.WebSecurityScannerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.websecurityscanner.v1alpha.ListFindingsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.websecurityscanner.v1alpha.ListFindingsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.descriptors.page.listFindings.asyncIterate = + stubAsyncIterationCall(undefined, expectedError); + const iterable = client.listFindingsAsync(request); + await assert.rejects(async () => { + const responses: protos.google.cloud.websecurityscanner.v1alpha.IFinding[] = + []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + ( + client.descriptors.page.listFindings.asyncIterate as SinonStub + ).getCall(0).args[1], + request + ); + assert( + (client.descriptors.page.listFindings.asyncIterate as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + }); + + describe('Path templates', () => { + describe('finding', () => { + const fakePath = '/rendered/path/finding'; + const expectedParameters = { + project: 'projectValue', + scan_config: 'scanConfigValue', + scan_run: 'scanRunValue', + finding: 'findingValue', + }; + const client = + new websecurityscannerModule.v1alpha.WebSecurityScannerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.findingPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.findingPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('findingPath', () => { + const result = client.findingPath( + 'projectValue', + 'scanConfigValue', + 'scanRunValue', + 'findingValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.findingPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromFindingName', () => { + const result = client.matchProjectFromFindingName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.findingPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchScanConfigFromFindingName', () => { + const result = client.matchScanConfigFromFindingName(fakePath); + assert.strictEqual(result, 'scanConfigValue'); + assert( + (client.pathTemplates.findingPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchScanRunFromFindingName', () => { + const result = client.matchScanRunFromFindingName(fakePath); + assert.strictEqual(result, 'scanRunValue'); + assert( + (client.pathTemplates.findingPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchFindingFromFindingName', () => { + const result = client.matchFindingFromFindingName(fakePath); + assert.strictEqual(result, 'findingValue'); + assert( + (client.pathTemplates.findingPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('project', () => { + const fakePath = '/rendered/path/project'; + const expectedParameters = { + project: 'projectValue', + }; + const client = + new websecurityscannerModule.v1alpha.WebSecurityScannerClient({ + 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('scanConfig', () => { + const fakePath = '/rendered/path/scanConfig'; + const expectedParameters = { + project: 'projectValue', + scan_config: 'scanConfigValue', + }; + const client = + new websecurityscannerModule.v1alpha.WebSecurityScannerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.scanConfigPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.scanConfigPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('scanConfigPath', () => { + const result = client.scanConfigPath('projectValue', 'scanConfigValue'); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.scanConfigPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromScanConfigName', () => { + const result = client.matchProjectFromScanConfigName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.scanConfigPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchScanConfigFromScanConfigName', () => { + const result = client.matchScanConfigFromScanConfigName(fakePath); + assert.strictEqual(result, 'scanConfigValue'); + assert( + (client.pathTemplates.scanConfigPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('scanRun', () => { + const fakePath = '/rendered/path/scanRun'; + const expectedParameters = { + project: 'projectValue', + scan_config: 'scanConfigValue', + scan_run: 'scanRunValue', + }; + const client = + new websecurityscannerModule.v1alpha.WebSecurityScannerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.scanRunPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.scanRunPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('scanRunPath', () => { + const result = client.scanRunPath( + 'projectValue', + 'scanConfigValue', + 'scanRunValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.scanRunPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromScanRunName', () => { + const result = client.matchProjectFromScanRunName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.scanRunPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchScanConfigFromScanRunName', () => { + const result = client.matchScanConfigFromScanRunName(fakePath); + assert.strictEqual(result, 'scanConfigValue'); + assert( + (client.pathTemplates.scanRunPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchScanRunFromScanRunName', () => { + const result = client.matchScanRunFromScanRunName(fakePath); + assert.strictEqual(result, 'scanRunValue'); + assert( + (client.pathTemplates.scanRunPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + }); +}); diff --git a/packages/google-cloud-websecurityscanner/test/gapic_web_security_scanner_v1beta.ts b/packages/google-cloud-websecurityscanner/test/gapic_web_security_scanner_v1beta.ts new file mode 100644 index 00000000000..dcfddd9ddff --- /dev/null +++ b/packages/google-cloud-websecurityscanner/test/gapic_web_security_scanner_v1beta.ts @@ -0,0 +1,3045 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + +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 websecurityscannerModule 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.WebSecurityScannerClient', () => { + describe('Common methods', () => { + it('has servicePath', () => { + const servicePath = + websecurityscannerModule.v1beta.WebSecurityScannerClient.servicePath; + assert(servicePath); + }); + + it('has apiEndpoint', () => { + const apiEndpoint = + websecurityscannerModule.v1beta.WebSecurityScannerClient.apiEndpoint; + assert(apiEndpoint); + }); + + it('has port', () => { + const port = + websecurityscannerModule.v1beta.WebSecurityScannerClient.port; + assert(port); + assert(typeof port === 'number'); + }); + + it('should create a client with no option', () => { + const client = + new websecurityscannerModule.v1beta.WebSecurityScannerClient(); + assert(client); + }); + + it('should create a client with gRPC fallback', () => { + const client = + new websecurityscannerModule.v1beta.WebSecurityScannerClient({ + fallback: true, + }); + assert(client); + }); + + it('has initialize method and supports deferred initialization', async () => { + const client = + new websecurityscannerModule.v1beta.WebSecurityScannerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + assert.strictEqual(client.webSecurityScannerStub, undefined); + await client.initialize(); + assert(client.webSecurityScannerStub); + }); + + it('has close method for the initialized client', done => { + const client = + new websecurityscannerModule.v1beta.WebSecurityScannerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + assert(client.webSecurityScannerStub); + client.close().then(() => { + done(); + }); + }); + + it('has close method for the non-initialized client', done => { + const client = + new websecurityscannerModule.v1beta.WebSecurityScannerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + assert.strictEqual(client.webSecurityScannerStub, undefined); + client.close().then(() => { + done(); + }); + }); + + it('has getProjectId method', async () => { + const fakeProjectId = 'fake-project-id'; + const client = + new websecurityscannerModule.v1beta.WebSecurityScannerClient({ + 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 websecurityscannerModule.v1beta.WebSecurityScannerClient({ + 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('createScanConfig', () => { + it('invokes createScanConfig without error', async () => { + const client = + new websecurityscannerModule.v1beta.WebSecurityScannerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.websecurityscanner.v1beta.CreateScanConfigRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.websecurityscanner.v1beta.CreateScanConfigRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.websecurityscanner.v1beta.ScanConfig() + ); + client.innerApiCalls.createScanConfig = stubSimpleCall(expectedResponse); + const [response] = await client.createScanConfig(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.createScanConfig as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createScanConfig as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createScanConfig without error using callback', async () => { + const client = + new websecurityscannerModule.v1beta.WebSecurityScannerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.websecurityscanner.v1beta.CreateScanConfigRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.websecurityscanner.v1beta.CreateScanConfigRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.websecurityscanner.v1beta.ScanConfig() + ); + client.innerApiCalls.createScanConfig = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.createScanConfig( + request, + ( + err?: Error | null, + result?: protos.google.cloud.websecurityscanner.v1beta.IScanConfig | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.createScanConfig as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createScanConfig as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createScanConfig with error', async () => { + const client = + new websecurityscannerModule.v1beta.WebSecurityScannerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.websecurityscanner.v1beta.CreateScanConfigRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.websecurityscanner.v1beta.CreateScanConfigRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.createScanConfig = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.createScanConfig(request), expectedError); + const actualRequest = ( + client.innerApiCalls.createScanConfig as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createScanConfig as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createScanConfig with closed client', async () => { + const client = + new websecurityscannerModule.v1beta.WebSecurityScannerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.websecurityscanner.v1beta.CreateScanConfigRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.websecurityscanner.v1beta.CreateScanConfigRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.createScanConfig(request), expectedError); + }); + }); + + describe('deleteScanConfig', () => { + it('invokes deleteScanConfig without error', async () => { + const client = + new websecurityscannerModule.v1beta.WebSecurityScannerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.websecurityscanner.v1beta.DeleteScanConfigRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.websecurityscanner.v1beta.DeleteScanConfigRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty() + ); + client.innerApiCalls.deleteScanConfig = stubSimpleCall(expectedResponse); + const [response] = await client.deleteScanConfig(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.deleteScanConfig as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteScanConfig as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteScanConfig without error using callback', async () => { + const client = + new websecurityscannerModule.v1beta.WebSecurityScannerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.websecurityscanner.v1beta.DeleteScanConfigRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.websecurityscanner.v1beta.DeleteScanConfigRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty() + ); + client.innerApiCalls.deleteScanConfig = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.deleteScanConfig( + 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.deleteScanConfig as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteScanConfig as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteScanConfig with error', async () => { + const client = + new websecurityscannerModule.v1beta.WebSecurityScannerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.websecurityscanner.v1beta.DeleteScanConfigRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.websecurityscanner.v1beta.DeleteScanConfigRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.deleteScanConfig = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.deleteScanConfig(request), expectedError); + const actualRequest = ( + client.innerApiCalls.deleteScanConfig as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteScanConfig as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteScanConfig with closed client', async () => { + const client = + new websecurityscannerModule.v1beta.WebSecurityScannerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.websecurityscanner.v1beta.DeleteScanConfigRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.websecurityscanner.v1beta.DeleteScanConfigRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.deleteScanConfig(request), expectedError); + }); + }); + + describe('getScanConfig', () => { + it('invokes getScanConfig without error', async () => { + const client = + new websecurityscannerModule.v1beta.WebSecurityScannerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.websecurityscanner.v1beta.GetScanConfigRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.websecurityscanner.v1beta.GetScanConfigRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.websecurityscanner.v1beta.ScanConfig() + ); + client.innerApiCalls.getScanConfig = stubSimpleCall(expectedResponse); + const [response] = await client.getScanConfig(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.getScanConfig as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getScanConfig as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getScanConfig without error using callback', async () => { + const client = + new websecurityscannerModule.v1beta.WebSecurityScannerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.websecurityscanner.v1beta.GetScanConfigRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.websecurityscanner.v1beta.GetScanConfigRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.websecurityscanner.v1beta.ScanConfig() + ); + client.innerApiCalls.getScanConfig = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getScanConfig( + request, + ( + err?: Error | null, + result?: protos.google.cloud.websecurityscanner.v1beta.IScanConfig | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.getScanConfig as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getScanConfig as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getScanConfig with error', async () => { + const client = + new websecurityscannerModule.v1beta.WebSecurityScannerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.websecurityscanner.v1beta.GetScanConfigRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.websecurityscanner.v1beta.GetScanConfigRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.getScanConfig = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.getScanConfig(request), expectedError); + const actualRequest = ( + client.innerApiCalls.getScanConfig as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getScanConfig as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getScanConfig with closed client', async () => { + const client = + new websecurityscannerModule.v1beta.WebSecurityScannerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.websecurityscanner.v1beta.GetScanConfigRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.websecurityscanner.v1beta.GetScanConfigRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.getScanConfig(request), expectedError); + }); + }); + + describe('updateScanConfig', () => { + it('invokes updateScanConfig without error', async () => { + const client = + new websecurityscannerModule.v1beta.WebSecurityScannerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.websecurityscanner.v1beta.UpdateScanConfigRequest() + ); + request.scanConfig ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.websecurityscanner.v1beta.UpdateScanConfigRequest', + ['scanConfig', 'name'] + ); + request.scanConfig.name = defaultValue1; + const expectedHeaderRequestParams = `scan_config.name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.websecurityscanner.v1beta.ScanConfig() + ); + client.innerApiCalls.updateScanConfig = stubSimpleCall(expectedResponse); + const [response] = await client.updateScanConfig(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.updateScanConfig as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateScanConfig as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateScanConfig without error using callback', async () => { + const client = + new websecurityscannerModule.v1beta.WebSecurityScannerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.websecurityscanner.v1beta.UpdateScanConfigRequest() + ); + request.scanConfig ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.websecurityscanner.v1beta.UpdateScanConfigRequest', + ['scanConfig', 'name'] + ); + request.scanConfig.name = defaultValue1; + const expectedHeaderRequestParams = `scan_config.name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.websecurityscanner.v1beta.ScanConfig() + ); + client.innerApiCalls.updateScanConfig = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.updateScanConfig( + request, + ( + err?: Error | null, + result?: protos.google.cloud.websecurityscanner.v1beta.IScanConfig | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.updateScanConfig as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateScanConfig as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateScanConfig with error', async () => { + const client = + new websecurityscannerModule.v1beta.WebSecurityScannerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.websecurityscanner.v1beta.UpdateScanConfigRequest() + ); + request.scanConfig ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.websecurityscanner.v1beta.UpdateScanConfigRequest', + ['scanConfig', 'name'] + ); + request.scanConfig.name = defaultValue1; + const expectedHeaderRequestParams = `scan_config.name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.updateScanConfig = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.updateScanConfig(request), expectedError); + const actualRequest = ( + client.innerApiCalls.updateScanConfig as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateScanConfig as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateScanConfig with closed client', async () => { + const client = + new websecurityscannerModule.v1beta.WebSecurityScannerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.websecurityscanner.v1beta.UpdateScanConfigRequest() + ); + request.scanConfig ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.websecurityscanner.v1beta.UpdateScanConfigRequest', + ['scanConfig', 'name'] + ); + request.scanConfig.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.updateScanConfig(request), expectedError); + }); + }); + + describe('startScanRun', () => { + it('invokes startScanRun without error', async () => { + const client = + new websecurityscannerModule.v1beta.WebSecurityScannerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.websecurityscanner.v1beta.StartScanRunRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.websecurityscanner.v1beta.StartScanRunRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.websecurityscanner.v1beta.ScanRun() + ); + client.innerApiCalls.startScanRun = stubSimpleCall(expectedResponse); + const [response] = await client.startScanRun(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.startScanRun as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.startScanRun as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes startScanRun without error using callback', async () => { + const client = + new websecurityscannerModule.v1beta.WebSecurityScannerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.websecurityscanner.v1beta.StartScanRunRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.websecurityscanner.v1beta.StartScanRunRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.websecurityscanner.v1beta.ScanRun() + ); + client.innerApiCalls.startScanRun = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.startScanRun( + request, + ( + err?: Error | null, + result?: protos.google.cloud.websecurityscanner.v1beta.IScanRun | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.startScanRun as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.startScanRun as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes startScanRun with error', async () => { + const client = + new websecurityscannerModule.v1beta.WebSecurityScannerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.websecurityscanner.v1beta.StartScanRunRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.websecurityscanner.v1beta.StartScanRunRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.startScanRun = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.startScanRun(request), expectedError); + const actualRequest = ( + client.innerApiCalls.startScanRun as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.startScanRun as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes startScanRun with closed client', async () => { + const client = + new websecurityscannerModule.v1beta.WebSecurityScannerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.websecurityscanner.v1beta.StartScanRunRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.websecurityscanner.v1beta.StartScanRunRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.startScanRun(request), expectedError); + }); + }); + + describe('getScanRun', () => { + it('invokes getScanRun without error', async () => { + const client = + new websecurityscannerModule.v1beta.WebSecurityScannerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.websecurityscanner.v1beta.GetScanRunRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.websecurityscanner.v1beta.GetScanRunRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.websecurityscanner.v1beta.ScanRun() + ); + client.innerApiCalls.getScanRun = stubSimpleCall(expectedResponse); + const [response] = await client.getScanRun(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.getScanRun as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getScanRun as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getScanRun without error using callback', async () => { + const client = + new websecurityscannerModule.v1beta.WebSecurityScannerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.websecurityscanner.v1beta.GetScanRunRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.websecurityscanner.v1beta.GetScanRunRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.websecurityscanner.v1beta.ScanRun() + ); + client.innerApiCalls.getScanRun = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getScanRun( + request, + ( + err?: Error | null, + result?: protos.google.cloud.websecurityscanner.v1beta.IScanRun | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.getScanRun as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getScanRun as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getScanRun with error', async () => { + const client = + new websecurityscannerModule.v1beta.WebSecurityScannerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.websecurityscanner.v1beta.GetScanRunRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.websecurityscanner.v1beta.GetScanRunRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.getScanRun = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.getScanRun(request), expectedError); + const actualRequest = ( + client.innerApiCalls.getScanRun as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getScanRun as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getScanRun with closed client', async () => { + const client = + new websecurityscannerModule.v1beta.WebSecurityScannerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.websecurityscanner.v1beta.GetScanRunRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.websecurityscanner.v1beta.GetScanRunRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.getScanRun(request), expectedError); + }); + }); + + describe('stopScanRun', () => { + it('invokes stopScanRun without error', async () => { + const client = + new websecurityscannerModule.v1beta.WebSecurityScannerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.websecurityscanner.v1beta.StopScanRunRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.websecurityscanner.v1beta.StopScanRunRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.websecurityscanner.v1beta.ScanRun() + ); + client.innerApiCalls.stopScanRun = stubSimpleCall(expectedResponse); + const [response] = await client.stopScanRun(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.stopScanRun as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.stopScanRun as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes stopScanRun without error using callback', async () => { + const client = + new websecurityscannerModule.v1beta.WebSecurityScannerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.websecurityscanner.v1beta.StopScanRunRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.websecurityscanner.v1beta.StopScanRunRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.websecurityscanner.v1beta.ScanRun() + ); + client.innerApiCalls.stopScanRun = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.stopScanRun( + request, + ( + err?: Error | null, + result?: protos.google.cloud.websecurityscanner.v1beta.IScanRun | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.stopScanRun as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.stopScanRun as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes stopScanRun with error', async () => { + const client = + new websecurityscannerModule.v1beta.WebSecurityScannerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.websecurityscanner.v1beta.StopScanRunRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.websecurityscanner.v1beta.StopScanRunRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.stopScanRun = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.stopScanRun(request), expectedError); + const actualRequest = ( + client.innerApiCalls.stopScanRun as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.stopScanRun as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes stopScanRun with closed client', async () => { + const client = + new websecurityscannerModule.v1beta.WebSecurityScannerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.websecurityscanner.v1beta.StopScanRunRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.websecurityscanner.v1beta.StopScanRunRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.stopScanRun(request), expectedError); + }); + }); + + describe('getFinding', () => { + it('invokes getFinding without error', async () => { + const client = + new websecurityscannerModule.v1beta.WebSecurityScannerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.websecurityscanner.v1beta.GetFindingRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.websecurityscanner.v1beta.GetFindingRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.websecurityscanner.v1beta.Finding() + ); + client.innerApiCalls.getFinding = stubSimpleCall(expectedResponse); + const [response] = await client.getFinding(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.getFinding as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getFinding as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getFinding without error using callback', async () => { + const client = + new websecurityscannerModule.v1beta.WebSecurityScannerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.websecurityscanner.v1beta.GetFindingRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.websecurityscanner.v1beta.GetFindingRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.websecurityscanner.v1beta.Finding() + ); + client.innerApiCalls.getFinding = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getFinding( + request, + ( + err?: Error | null, + result?: protos.google.cloud.websecurityscanner.v1beta.IFinding | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.getFinding as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getFinding as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getFinding with error', async () => { + const client = + new websecurityscannerModule.v1beta.WebSecurityScannerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.websecurityscanner.v1beta.GetFindingRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.websecurityscanner.v1beta.GetFindingRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.getFinding = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.getFinding(request), expectedError); + const actualRequest = ( + client.innerApiCalls.getFinding as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getFinding as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getFinding with closed client', async () => { + const client = + new websecurityscannerModule.v1beta.WebSecurityScannerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.websecurityscanner.v1beta.GetFindingRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.websecurityscanner.v1beta.GetFindingRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.getFinding(request), expectedError); + }); + }); + + describe('listFindingTypeStats', () => { + it('invokes listFindingTypeStats without error', async () => { + const client = + new websecurityscannerModule.v1beta.WebSecurityScannerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.websecurityscanner.v1beta.ListFindingTypeStatsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.websecurityscanner.v1beta.ListFindingTypeStatsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.websecurityscanner.v1beta.ListFindingTypeStatsResponse() + ); + client.innerApiCalls.listFindingTypeStats = + stubSimpleCall(expectedResponse); + const [response] = await client.listFindingTypeStats(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.listFindingTypeStats as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listFindingTypeStats as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listFindingTypeStats without error using callback', async () => { + const client = + new websecurityscannerModule.v1beta.WebSecurityScannerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.websecurityscanner.v1beta.ListFindingTypeStatsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.websecurityscanner.v1beta.ListFindingTypeStatsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.websecurityscanner.v1beta.ListFindingTypeStatsResponse() + ); + client.innerApiCalls.listFindingTypeStats = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.listFindingTypeStats( + request, + ( + err?: Error | null, + result?: protos.google.cloud.websecurityscanner.v1beta.IListFindingTypeStatsResponse | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.listFindingTypeStats as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listFindingTypeStats as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listFindingTypeStats with error', async () => { + const client = + new websecurityscannerModule.v1beta.WebSecurityScannerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.websecurityscanner.v1beta.ListFindingTypeStatsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.websecurityscanner.v1beta.ListFindingTypeStatsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.listFindingTypeStats = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.listFindingTypeStats(request), expectedError); + const actualRequest = ( + client.innerApiCalls.listFindingTypeStats as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listFindingTypeStats as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listFindingTypeStats with closed client', async () => { + const client = + new websecurityscannerModule.v1beta.WebSecurityScannerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.websecurityscanner.v1beta.ListFindingTypeStatsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.websecurityscanner.v1beta.ListFindingTypeStatsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.listFindingTypeStats(request), expectedError); + }); + }); + + describe('listScanConfigs', () => { + it('invokes listScanConfigs without error', async () => { + const client = + new websecurityscannerModule.v1beta.WebSecurityScannerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.websecurityscanner.v1beta.ListScanConfigsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.websecurityscanner.v1beta.ListScanConfigsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.websecurityscanner.v1beta.ScanConfig() + ), + generateSampleMessage( + new protos.google.cloud.websecurityscanner.v1beta.ScanConfig() + ), + generateSampleMessage( + new protos.google.cloud.websecurityscanner.v1beta.ScanConfig() + ), + ]; + client.innerApiCalls.listScanConfigs = stubSimpleCall(expectedResponse); + const [response] = await client.listScanConfigs(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.listScanConfigs as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listScanConfigs as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listScanConfigs without error using callback', async () => { + const client = + new websecurityscannerModule.v1beta.WebSecurityScannerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.websecurityscanner.v1beta.ListScanConfigsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.websecurityscanner.v1beta.ListScanConfigsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.websecurityscanner.v1beta.ScanConfig() + ), + generateSampleMessage( + new protos.google.cloud.websecurityscanner.v1beta.ScanConfig() + ), + generateSampleMessage( + new protos.google.cloud.websecurityscanner.v1beta.ScanConfig() + ), + ]; + client.innerApiCalls.listScanConfigs = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.listScanConfigs( + request, + ( + err?: Error | null, + result?: + | protos.google.cloud.websecurityscanner.v1beta.IScanConfig[] + | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.listScanConfigs as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listScanConfigs as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listScanConfigs with error', async () => { + const client = + new websecurityscannerModule.v1beta.WebSecurityScannerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.websecurityscanner.v1beta.ListScanConfigsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.websecurityscanner.v1beta.ListScanConfigsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.listScanConfigs = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.listScanConfigs(request), expectedError); + const actualRequest = ( + client.innerApiCalls.listScanConfigs as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listScanConfigs as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listScanConfigsStream without error', async () => { + const client = + new websecurityscannerModule.v1beta.WebSecurityScannerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.websecurityscanner.v1beta.ListScanConfigsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.websecurityscanner.v1beta.ListScanConfigsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.websecurityscanner.v1beta.ScanConfig() + ), + generateSampleMessage( + new protos.google.cloud.websecurityscanner.v1beta.ScanConfig() + ), + generateSampleMessage( + new protos.google.cloud.websecurityscanner.v1beta.ScanConfig() + ), + ]; + client.descriptors.page.listScanConfigs.createStream = + stubPageStreamingCall(expectedResponse); + const stream = client.listScanConfigsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.websecurityscanner.v1beta.ScanConfig[] = + []; + stream.on( + 'data', + ( + response: protos.google.cloud.websecurityscanner.v1beta.ScanConfig + ) => { + 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.listScanConfigs.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.listScanConfigs, request) + ); + assert( + (client.descriptors.page.listScanConfigs.createStream as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('invokes listScanConfigsStream with error', async () => { + const client = + new websecurityscannerModule.v1beta.WebSecurityScannerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.websecurityscanner.v1beta.ListScanConfigsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.websecurityscanner.v1beta.ListScanConfigsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.descriptors.page.listScanConfigs.createStream = + stubPageStreamingCall(undefined, expectedError); + const stream = client.listScanConfigsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.websecurityscanner.v1beta.ScanConfig[] = + []; + stream.on( + 'data', + ( + response: protos.google.cloud.websecurityscanner.v1beta.ScanConfig + ) => { + responses.push(response); + } + ); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(promise, expectedError); + assert( + (client.descriptors.page.listScanConfigs.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.listScanConfigs, request) + ); + assert( + (client.descriptors.page.listScanConfigs.createStream as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with listScanConfigs without error', async () => { + const client = + new websecurityscannerModule.v1beta.WebSecurityScannerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.websecurityscanner.v1beta.ListScanConfigsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.websecurityscanner.v1beta.ListScanConfigsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.websecurityscanner.v1beta.ScanConfig() + ), + generateSampleMessage( + new protos.google.cloud.websecurityscanner.v1beta.ScanConfig() + ), + generateSampleMessage( + new protos.google.cloud.websecurityscanner.v1beta.ScanConfig() + ), + ]; + client.descriptors.page.listScanConfigs.asyncIterate = + stubAsyncIterationCall(expectedResponse); + const responses: protos.google.cloud.websecurityscanner.v1beta.IScanConfig[] = + []; + const iterable = client.listScanConfigsAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + ( + client.descriptors.page.listScanConfigs.asyncIterate as SinonStub + ).getCall(0).args[1], + request + ); + assert( + (client.descriptors.page.listScanConfigs.asyncIterate as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with listScanConfigs with error', async () => { + const client = + new websecurityscannerModule.v1beta.WebSecurityScannerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.websecurityscanner.v1beta.ListScanConfigsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.websecurityscanner.v1beta.ListScanConfigsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.descriptors.page.listScanConfigs.asyncIterate = + stubAsyncIterationCall(undefined, expectedError); + const iterable = client.listScanConfigsAsync(request); + await assert.rejects(async () => { + const responses: protos.google.cloud.websecurityscanner.v1beta.IScanConfig[] = + []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + ( + client.descriptors.page.listScanConfigs.asyncIterate as SinonStub + ).getCall(0).args[1], + request + ); + assert( + (client.descriptors.page.listScanConfigs.asyncIterate as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + }); + + describe('listScanRuns', () => { + it('invokes listScanRuns without error', async () => { + const client = + new websecurityscannerModule.v1beta.WebSecurityScannerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.websecurityscanner.v1beta.ListScanRunsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.websecurityscanner.v1beta.ListScanRunsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.websecurityscanner.v1beta.ScanRun() + ), + generateSampleMessage( + new protos.google.cloud.websecurityscanner.v1beta.ScanRun() + ), + generateSampleMessage( + new protos.google.cloud.websecurityscanner.v1beta.ScanRun() + ), + ]; + client.innerApiCalls.listScanRuns = stubSimpleCall(expectedResponse); + const [response] = await client.listScanRuns(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.listScanRuns as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listScanRuns as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listScanRuns without error using callback', async () => { + const client = + new websecurityscannerModule.v1beta.WebSecurityScannerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.websecurityscanner.v1beta.ListScanRunsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.websecurityscanner.v1beta.ListScanRunsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.websecurityscanner.v1beta.ScanRun() + ), + generateSampleMessage( + new protos.google.cloud.websecurityscanner.v1beta.ScanRun() + ), + generateSampleMessage( + new protos.google.cloud.websecurityscanner.v1beta.ScanRun() + ), + ]; + client.innerApiCalls.listScanRuns = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.listScanRuns( + request, + ( + err?: Error | null, + result?: + | protos.google.cloud.websecurityscanner.v1beta.IScanRun[] + | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.listScanRuns as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listScanRuns as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listScanRuns with error', async () => { + const client = + new websecurityscannerModule.v1beta.WebSecurityScannerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.websecurityscanner.v1beta.ListScanRunsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.websecurityscanner.v1beta.ListScanRunsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.listScanRuns = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.listScanRuns(request), expectedError); + const actualRequest = ( + client.innerApiCalls.listScanRuns as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listScanRuns as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listScanRunsStream without error', async () => { + const client = + new websecurityscannerModule.v1beta.WebSecurityScannerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.websecurityscanner.v1beta.ListScanRunsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.websecurityscanner.v1beta.ListScanRunsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.websecurityscanner.v1beta.ScanRun() + ), + generateSampleMessage( + new protos.google.cloud.websecurityscanner.v1beta.ScanRun() + ), + generateSampleMessage( + new protos.google.cloud.websecurityscanner.v1beta.ScanRun() + ), + ]; + client.descriptors.page.listScanRuns.createStream = + stubPageStreamingCall(expectedResponse); + const stream = client.listScanRunsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.websecurityscanner.v1beta.ScanRun[] = + []; + stream.on( + 'data', + (response: protos.google.cloud.websecurityscanner.v1beta.ScanRun) => { + 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.listScanRuns.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.listScanRuns, request) + ); + assert( + (client.descriptors.page.listScanRuns.createStream as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('invokes listScanRunsStream with error', async () => { + const client = + new websecurityscannerModule.v1beta.WebSecurityScannerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.websecurityscanner.v1beta.ListScanRunsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.websecurityscanner.v1beta.ListScanRunsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.descriptors.page.listScanRuns.createStream = stubPageStreamingCall( + undefined, + expectedError + ); + const stream = client.listScanRunsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.websecurityscanner.v1beta.ScanRun[] = + []; + stream.on( + 'data', + (response: protos.google.cloud.websecurityscanner.v1beta.ScanRun) => { + responses.push(response); + } + ); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(promise, expectedError); + assert( + (client.descriptors.page.listScanRuns.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.listScanRuns, request) + ); + assert( + (client.descriptors.page.listScanRuns.createStream as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with listScanRuns without error', async () => { + const client = + new websecurityscannerModule.v1beta.WebSecurityScannerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.websecurityscanner.v1beta.ListScanRunsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.websecurityscanner.v1beta.ListScanRunsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.websecurityscanner.v1beta.ScanRun() + ), + generateSampleMessage( + new protos.google.cloud.websecurityscanner.v1beta.ScanRun() + ), + generateSampleMessage( + new protos.google.cloud.websecurityscanner.v1beta.ScanRun() + ), + ]; + client.descriptors.page.listScanRuns.asyncIterate = + stubAsyncIterationCall(expectedResponse); + const responses: protos.google.cloud.websecurityscanner.v1beta.IScanRun[] = + []; + const iterable = client.listScanRunsAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + ( + client.descriptors.page.listScanRuns.asyncIterate as SinonStub + ).getCall(0).args[1], + request + ); + assert( + (client.descriptors.page.listScanRuns.asyncIterate as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with listScanRuns with error', async () => { + const client = + new websecurityscannerModule.v1beta.WebSecurityScannerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.websecurityscanner.v1beta.ListScanRunsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.websecurityscanner.v1beta.ListScanRunsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.descriptors.page.listScanRuns.asyncIterate = + stubAsyncIterationCall(undefined, expectedError); + const iterable = client.listScanRunsAsync(request); + await assert.rejects(async () => { + const responses: protos.google.cloud.websecurityscanner.v1beta.IScanRun[] = + []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + ( + client.descriptors.page.listScanRuns.asyncIterate as SinonStub + ).getCall(0).args[1], + request + ); + assert( + (client.descriptors.page.listScanRuns.asyncIterate as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + }); + + describe('listCrawledUrls', () => { + it('invokes listCrawledUrls without error', async () => { + const client = + new websecurityscannerModule.v1beta.WebSecurityScannerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.websecurityscanner.v1beta.ListCrawledUrlsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.websecurityscanner.v1beta.ListCrawledUrlsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.websecurityscanner.v1beta.CrawledUrl() + ), + generateSampleMessage( + new protos.google.cloud.websecurityscanner.v1beta.CrawledUrl() + ), + generateSampleMessage( + new protos.google.cloud.websecurityscanner.v1beta.CrawledUrl() + ), + ]; + client.innerApiCalls.listCrawledUrls = stubSimpleCall(expectedResponse); + const [response] = await client.listCrawledUrls(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.listCrawledUrls as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listCrawledUrls as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listCrawledUrls without error using callback', async () => { + const client = + new websecurityscannerModule.v1beta.WebSecurityScannerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.websecurityscanner.v1beta.ListCrawledUrlsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.websecurityscanner.v1beta.ListCrawledUrlsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.websecurityscanner.v1beta.CrawledUrl() + ), + generateSampleMessage( + new protos.google.cloud.websecurityscanner.v1beta.CrawledUrl() + ), + generateSampleMessage( + new protos.google.cloud.websecurityscanner.v1beta.CrawledUrl() + ), + ]; + client.innerApiCalls.listCrawledUrls = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.listCrawledUrls( + request, + ( + err?: Error | null, + result?: + | protos.google.cloud.websecurityscanner.v1beta.ICrawledUrl[] + | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.listCrawledUrls as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listCrawledUrls as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listCrawledUrls with error', async () => { + const client = + new websecurityscannerModule.v1beta.WebSecurityScannerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.websecurityscanner.v1beta.ListCrawledUrlsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.websecurityscanner.v1beta.ListCrawledUrlsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.listCrawledUrls = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.listCrawledUrls(request), expectedError); + const actualRequest = ( + client.innerApiCalls.listCrawledUrls as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listCrawledUrls as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listCrawledUrlsStream without error', async () => { + const client = + new websecurityscannerModule.v1beta.WebSecurityScannerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.websecurityscanner.v1beta.ListCrawledUrlsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.websecurityscanner.v1beta.ListCrawledUrlsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.websecurityscanner.v1beta.CrawledUrl() + ), + generateSampleMessage( + new protos.google.cloud.websecurityscanner.v1beta.CrawledUrl() + ), + generateSampleMessage( + new protos.google.cloud.websecurityscanner.v1beta.CrawledUrl() + ), + ]; + client.descriptors.page.listCrawledUrls.createStream = + stubPageStreamingCall(expectedResponse); + const stream = client.listCrawledUrlsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.websecurityscanner.v1beta.CrawledUrl[] = + []; + stream.on( + 'data', + ( + response: protos.google.cloud.websecurityscanner.v1beta.CrawledUrl + ) => { + 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.listCrawledUrls.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.listCrawledUrls, request) + ); + assert( + (client.descriptors.page.listCrawledUrls.createStream as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('invokes listCrawledUrlsStream with error', async () => { + const client = + new websecurityscannerModule.v1beta.WebSecurityScannerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.websecurityscanner.v1beta.ListCrawledUrlsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.websecurityscanner.v1beta.ListCrawledUrlsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.descriptors.page.listCrawledUrls.createStream = + stubPageStreamingCall(undefined, expectedError); + const stream = client.listCrawledUrlsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.websecurityscanner.v1beta.CrawledUrl[] = + []; + stream.on( + 'data', + ( + response: protos.google.cloud.websecurityscanner.v1beta.CrawledUrl + ) => { + responses.push(response); + } + ); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(promise, expectedError); + assert( + (client.descriptors.page.listCrawledUrls.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.listCrawledUrls, request) + ); + assert( + (client.descriptors.page.listCrawledUrls.createStream as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with listCrawledUrls without error', async () => { + const client = + new websecurityscannerModule.v1beta.WebSecurityScannerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.websecurityscanner.v1beta.ListCrawledUrlsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.websecurityscanner.v1beta.ListCrawledUrlsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.websecurityscanner.v1beta.CrawledUrl() + ), + generateSampleMessage( + new protos.google.cloud.websecurityscanner.v1beta.CrawledUrl() + ), + generateSampleMessage( + new protos.google.cloud.websecurityscanner.v1beta.CrawledUrl() + ), + ]; + client.descriptors.page.listCrawledUrls.asyncIterate = + stubAsyncIterationCall(expectedResponse); + const responses: protos.google.cloud.websecurityscanner.v1beta.ICrawledUrl[] = + []; + const iterable = client.listCrawledUrlsAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + ( + client.descriptors.page.listCrawledUrls.asyncIterate as SinonStub + ).getCall(0).args[1], + request + ); + assert( + (client.descriptors.page.listCrawledUrls.asyncIterate as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with listCrawledUrls with error', async () => { + const client = + new websecurityscannerModule.v1beta.WebSecurityScannerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.websecurityscanner.v1beta.ListCrawledUrlsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.websecurityscanner.v1beta.ListCrawledUrlsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.descriptors.page.listCrawledUrls.asyncIterate = + stubAsyncIterationCall(undefined, expectedError); + const iterable = client.listCrawledUrlsAsync(request); + await assert.rejects(async () => { + const responses: protos.google.cloud.websecurityscanner.v1beta.ICrawledUrl[] = + []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + ( + client.descriptors.page.listCrawledUrls.asyncIterate as SinonStub + ).getCall(0).args[1], + request + ); + assert( + (client.descriptors.page.listCrawledUrls.asyncIterate as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + }); + + describe('listFindings', () => { + it('invokes listFindings without error', async () => { + const client = + new websecurityscannerModule.v1beta.WebSecurityScannerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.websecurityscanner.v1beta.ListFindingsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.websecurityscanner.v1beta.ListFindingsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.websecurityscanner.v1beta.Finding() + ), + generateSampleMessage( + new protos.google.cloud.websecurityscanner.v1beta.Finding() + ), + generateSampleMessage( + new protos.google.cloud.websecurityscanner.v1beta.Finding() + ), + ]; + client.innerApiCalls.listFindings = stubSimpleCall(expectedResponse); + const [response] = await client.listFindings(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.listFindings as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listFindings as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listFindings without error using callback', async () => { + const client = + new websecurityscannerModule.v1beta.WebSecurityScannerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.websecurityscanner.v1beta.ListFindingsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.websecurityscanner.v1beta.ListFindingsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.websecurityscanner.v1beta.Finding() + ), + generateSampleMessage( + new protos.google.cloud.websecurityscanner.v1beta.Finding() + ), + generateSampleMessage( + new protos.google.cloud.websecurityscanner.v1beta.Finding() + ), + ]; + client.innerApiCalls.listFindings = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.listFindings( + request, + ( + err?: Error | null, + result?: + | protos.google.cloud.websecurityscanner.v1beta.IFinding[] + | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.listFindings as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listFindings as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listFindings with error', async () => { + const client = + new websecurityscannerModule.v1beta.WebSecurityScannerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.websecurityscanner.v1beta.ListFindingsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.websecurityscanner.v1beta.ListFindingsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.listFindings = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.listFindings(request), expectedError); + const actualRequest = ( + client.innerApiCalls.listFindings as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listFindings as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listFindingsStream without error', async () => { + const client = + new websecurityscannerModule.v1beta.WebSecurityScannerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.websecurityscanner.v1beta.ListFindingsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.websecurityscanner.v1beta.ListFindingsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.websecurityscanner.v1beta.Finding() + ), + generateSampleMessage( + new protos.google.cloud.websecurityscanner.v1beta.Finding() + ), + generateSampleMessage( + new protos.google.cloud.websecurityscanner.v1beta.Finding() + ), + ]; + client.descriptors.page.listFindings.createStream = + stubPageStreamingCall(expectedResponse); + const stream = client.listFindingsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.websecurityscanner.v1beta.Finding[] = + []; + stream.on( + 'data', + (response: protos.google.cloud.websecurityscanner.v1beta.Finding) => { + 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.listFindings.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.listFindings, request) + ); + assert( + (client.descriptors.page.listFindings.createStream as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('invokes listFindingsStream with error', async () => { + const client = + new websecurityscannerModule.v1beta.WebSecurityScannerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.websecurityscanner.v1beta.ListFindingsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.websecurityscanner.v1beta.ListFindingsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.descriptors.page.listFindings.createStream = stubPageStreamingCall( + undefined, + expectedError + ); + const stream = client.listFindingsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.websecurityscanner.v1beta.Finding[] = + []; + stream.on( + 'data', + (response: protos.google.cloud.websecurityscanner.v1beta.Finding) => { + responses.push(response); + } + ); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(promise, expectedError); + assert( + (client.descriptors.page.listFindings.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.listFindings, request) + ); + assert( + (client.descriptors.page.listFindings.createStream as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with listFindings without error', async () => { + const client = + new websecurityscannerModule.v1beta.WebSecurityScannerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.websecurityscanner.v1beta.ListFindingsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.websecurityscanner.v1beta.ListFindingsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.websecurityscanner.v1beta.Finding() + ), + generateSampleMessage( + new protos.google.cloud.websecurityscanner.v1beta.Finding() + ), + generateSampleMessage( + new protos.google.cloud.websecurityscanner.v1beta.Finding() + ), + ]; + client.descriptors.page.listFindings.asyncIterate = + stubAsyncIterationCall(expectedResponse); + const responses: protos.google.cloud.websecurityscanner.v1beta.IFinding[] = + []; + const iterable = client.listFindingsAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + ( + client.descriptors.page.listFindings.asyncIterate as SinonStub + ).getCall(0).args[1], + request + ); + assert( + (client.descriptors.page.listFindings.asyncIterate as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with listFindings with error', async () => { + const client = + new websecurityscannerModule.v1beta.WebSecurityScannerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.websecurityscanner.v1beta.ListFindingsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.websecurityscanner.v1beta.ListFindingsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.descriptors.page.listFindings.asyncIterate = + stubAsyncIterationCall(undefined, expectedError); + const iterable = client.listFindingsAsync(request); + await assert.rejects(async () => { + const responses: protos.google.cloud.websecurityscanner.v1beta.IFinding[] = + []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + ( + client.descriptors.page.listFindings.asyncIterate as SinonStub + ).getCall(0).args[1], + request + ); + assert( + (client.descriptors.page.listFindings.asyncIterate as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + }); + + describe('Path templates', () => { + describe('finding', () => { + const fakePath = '/rendered/path/finding'; + const expectedParameters = { + project: 'projectValue', + scan_config: 'scanConfigValue', + scan_run: 'scanRunValue', + finding: 'findingValue', + }; + const client = + new websecurityscannerModule.v1beta.WebSecurityScannerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.findingPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.findingPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('findingPath', () => { + const result = client.findingPath( + 'projectValue', + 'scanConfigValue', + 'scanRunValue', + 'findingValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.findingPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromFindingName', () => { + const result = client.matchProjectFromFindingName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.findingPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchScanConfigFromFindingName', () => { + const result = client.matchScanConfigFromFindingName(fakePath); + assert.strictEqual(result, 'scanConfigValue'); + assert( + (client.pathTemplates.findingPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchScanRunFromFindingName', () => { + const result = client.matchScanRunFromFindingName(fakePath); + assert.strictEqual(result, 'scanRunValue'); + assert( + (client.pathTemplates.findingPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchFindingFromFindingName', () => { + const result = client.matchFindingFromFindingName(fakePath); + assert.strictEqual(result, 'findingValue'); + assert( + (client.pathTemplates.findingPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('project', () => { + const fakePath = '/rendered/path/project'; + const expectedParameters = { + project: 'projectValue', + }; + const client = + new websecurityscannerModule.v1beta.WebSecurityScannerClient({ + 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('scanConfig', () => { + const fakePath = '/rendered/path/scanConfig'; + const expectedParameters = { + project: 'projectValue', + scan_config: 'scanConfigValue', + }; + const client = + new websecurityscannerModule.v1beta.WebSecurityScannerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.scanConfigPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.scanConfigPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('scanConfigPath', () => { + const result = client.scanConfigPath('projectValue', 'scanConfigValue'); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.scanConfigPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromScanConfigName', () => { + const result = client.matchProjectFromScanConfigName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.scanConfigPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchScanConfigFromScanConfigName', () => { + const result = client.matchScanConfigFromScanConfigName(fakePath); + assert.strictEqual(result, 'scanConfigValue'); + assert( + (client.pathTemplates.scanConfigPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('scanRun', () => { + const fakePath = '/rendered/path/scanRun'; + const expectedParameters = { + project: 'projectValue', + scan_config: 'scanConfigValue', + scan_run: 'scanRunValue', + }; + const client = + new websecurityscannerModule.v1beta.WebSecurityScannerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.scanRunPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.scanRunPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('scanRunPath', () => { + const result = client.scanRunPath( + 'projectValue', + 'scanConfigValue', + 'scanRunValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.scanRunPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromScanRunName', () => { + const result = client.matchProjectFromScanRunName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.scanRunPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchScanConfigFromScanRunName', () => { + const result = client.matchScanConfigFromScanRunName(fakePath); + assert.strictEqual(result, 'scanConfigValue'); + assert( + (client.pathTemplates.scanRunPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchScanRunFromScanRunName', () => { + const result = client.matchScanRunFromScanRunName(fakePath); + assert.strictEqual(result, 'scanRunValue'); + assert( + (client.pathTemplates.scanRunPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + }); +}); diff --git a/packages/google-cloud-websecurityscanner/tsconfig.json b/packages/google-cloud-websecurityscanner/tsconfig.json new file mode 100644 index 00000000000..c78f1c884ef --- /dev/null +++ b/packages/google-cloud-websecurityscanner/tsconfig.json @@ -0,0 +1,19 @@ +{ + "extends": "./node_modules/gts/tsconfig-google.json", + "compilerOptions": { + "rootDir": ".", + "outDir": "build", + "resolveJsonModule": true, + "lib": [ + "es2018", + "dom" + ] + }, + "include": [ + "src/*.ts", + "src/**/*.ts", + "test/*.ts", + "test/**/*.ts", + "system-test/*.ts" + ] +} diff --git a/packages/google-cloud-websecurityscanner/webpack.config.js b/packages/google-cloud-websecurityscanner/webpack.config.js new file mode 100644 index 00000000000..35f882c2dc6 --- /dev/null +++ b/packages/google-cloud-websecurityscanner/webpack.config.js @@ -0,0 +1,64 @@ +// Copyright 2021 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +const path = require('path'); + +module.exports = { + entry: './src/index.ts', + output: { + library: 'WebSecurityScanner', + filename: './web-security-scanner.js', + }, + node: { + child_process: 'empty', + fs: 'empty', + crypto: 'empty', + }, + resolve: { + alias: { + '../../../package.json': path.resolve(__dirname, 'package.json'), + }, + extensions: ['.js', '.json', '.ts'], + }, + module: { + rules: [ + { + test: /\.tsx?$/, + use: 'ts-loader', + exclude: /node_modules/, + }, + { + test: /node_modules[\\/]@grpc[\\/]grpc-js/, + use: 'null-loader', + }, + { + test: /node_modules[\\/]grpc/, + use: 'null-loader', + }, + { + test: /node_modules[\\/]retry-request/, + use: 'null-loader', + }, + { + test: /node_modules[\\/]https?-proxy-agent/, + use: 'null-loader', + }, + { + test: /node_modules[\\/]gtoken/, + use: 'null-loader', + }, + ], + }, + mode: 'production', +};